From 7c087e0e1325fdfe1e41d2083b0c507b02611180 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 9 Jul 2022 11:07:38 -0500 Subject: [PATCH] PHPStan tweaks --- scripts/generate-monthly-downloads | 6 +----- www/patrons-circle/downloads/index.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/generate-monthly-downloads b/scripts/generate-monthly-downloads index 36abec49..12c93e28 100755 --- a/scripts/generate-monthly-downloads +++ b/scripts/generate-monthly-downloads @@ -11,10 +11,6 @@ $contentFiles = explode("\n", trim(shell_exec('find ' . escapeshellarg($webRoot $ebooksByMonth = []; $lastUpdatedTimestamps = []; -if(!is_dir(WEB_ROOT . '/patrons-circle/downloads')){ - mkdir(WEB_ROOT . '/patrons-circle/downloads'); -} - // Iterate over all ebooks and arrange them by publication month foreach($contentFiles as $path){ if($path == '') @@ -50,7 +46,7 @@ foreach($ebooksByMonth as $month => $ebooks){ $filename = 'se-ebooks-' . $month . '.zip'; $filePath = $webRoot . '/www/patrons-circle/downloads/' . $filename; - // If the file doesn't exist, or if the content.opf last updated time is newer than the file creation time + // If the file doesn't exist, or if the content.opf last updated time is newer than the file modification time if(!file_exists($filePath) || filemtime($filePath) < $lastUpdatedTimestamps[$month]){ print('Creating ' . $filePath . "\n"); diff --git a/www/patrons-circle/downloads/index.php b/www/patrons-circle/downloads/index.php index 1fbb8433..42a09abc 100644 --- a/www/patrons-circle/downloads/index.php +++ b/www/patrons-circle/downloads/index.php @@ -1,9 +1,18 @@ $items){ ?>
  • -

    +

    @@ -75,7 +84,7 @@ foreach($files as $file){ - +
    Month) ?> Count)) ?> Size) ?>Updated) ?>Updated) ?>