PHPStan tweaks

This commit is contained in:
Alex Cabal 2022-07-09 11:07:38 -05:00
parent edd032be2c
commit 7c087e0e13
2 changed files with 12 additions and 7 deletions

View file

@ -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");