Fix bad detection for change file or folder

This commit is contained in:
Knah Tsaeb 2024-10-14 11:42:28 +02:00
parent fb1d1557f4
commit a95e3120fa

View file

@ -14,25 +14,7 @@ ini_set("memory_limit", "256M");
/*
Not edit this param directly
1 - Create /datas/config.php file.
2 - Create $userconfig array like :
$userConfig = [
'templateFile' => 'board', // Template filename (must be placed in 'public/templates' folder)
'title' => 'NanoGal', // Text to be displayed in browser titlebar
'description' => 'My gallery', // Use in meta tag "description"
'author' => 'NanoGal', // Your name
'skipObjects' => ['comment.html', '.gitkeep', 'aFolder', 'aFile.ext'], //Those files and folders will not be displayed (affects the page and the RSS feed)
'imageCaptionPosition' => 'right', // Position of caption in lightbox
'sortBy' => 'name', // Sort by name or date
'orderBy' => 'desc', // Order by asc or desc
'thumbSize' => 250, // Thumbnail height/width (square thumbs)
'displayExifInfo' => false, // Display Exif info in caption
'disableCache' => false, // Enable or disable cache
'showShareLink' => false, // Show link for thumb, full, markdown link (thumb + link to full)
'nbItemsAtom' => 25 // Number of item in atom feed
];
See README.md
*/
$config = [
'templateFile' => 'board', // Template filename (must be placed in 'public/templates' folder)
@ -76,12 +58,15 @@ if ($config['disableCache'] === false) {
$cache->countDirsAndFiles();
}
if ($cache->changeFile() || $cache->changeConf() || !file_exists($cacheHash . '.html') || $config['disableCache'] === true) {
$fileChange = $cache->changeFile();
$configChange = $cache->changeConf();
if ($fileChange || $configChange || !file_exists($cacheHash . '.html') || $config['disableCache'] === true) {
if ($cache->changeConf()) {
$cache->clearCache();
}
if($cache->changeFile() || $cache->changeConf()){
if ($fileChange || $configChange) {
Cache::clearAtomFeed();
}
@ -102,7 +87,6 @@ if ($cache->changeFile() || $cache->changeConf() || !file_exists($cacheHash . '.
$userCss = '<style>' . file_get_contents('../datas/user.css') . '</style>';
}
if (file_exists('templates/' . $config['templateFile'] . '/' . $config['templateFile'] . '.php')) {
require 'templates/' . $config['templateFile'] . '/' . $config['templateFile'] . '.php';
} else {