Fix OPDS/RSS scripts"

This commit is contained in:
Alex Cabal 2020-06-24 20:23:45 -05:00
parent 905aef22fa
commit 1f6170d23a
2 changed files with 4 additions and 2 deletions

4
scripts/generate-opds.php Executable file → Normal file
View file

@ -1,4 +1,6 @@
<? <?
require_once('/standardebooks.org/web/lib/Core.php');
use function Safe\krsort; use function Safe\krsort;
use function Safe\getopt; use function Safe\getopt;
use function Safe\preg_replace; use function Safe\preg_replace;
@ -8,8 +10,6 @@ $options = getopt("", $longopts);
$webRoot = $options["webroot"] ?? "/standardebooks.org/web"; $webRoot = $options["webroot"] ?? "/standardebooks.org/web";
$webUrl = $options["weburl"] ?? "https://standardebooks.org"; $webUrl = $options["weburl"] ?? "https://standardebooks.org";
require_once($webRoot . '/lib/Core.php');
$contentFiles = explode("\n", trim(shell_exec('find ' . escapeshellarg($webRoot . '/www/ebooks/') . ' -name "content.opf" | sort') ?? '')); $contentFiles = explode("\n", trim(shell_exec('find ' . escapeshellarg($webRoot . '/www/ebooks/') . ' -name "content.opf" | sort') ?? ''));
$allEbooks = []; $allEbooks = [];
$newestEbooks = []; $newestEbooks = [];

View file

@ -1,4 +1,6 @@
<? <?
require_once('/standardebooks.org/web/lib/Core.php');
use function Safe\file_get_contents; use function Safe\file_get_contents;
use function Safe\getopt; use function Safe\getopt;
use function Safe\krsort; use function Safe\krsort;