From 2e666d8b665c3ce3e342ad054a9112edcd802e11 Mon Sep 17 00:00:00 2001 From: wrenge Date: Mon, 16 Dec 2024 18:02:32 +0300 Subject: [PATCH] Dir need regen support --- helpers.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/helpers.inc.php b/helpers.inc.php index 55d667e..ac86d0c 100644 --- a/helpers.inc.php +++ b/helpers.inc.php @@ -170,14 +170,21 @@ function json_make_pretty(string $json) : string function need_to_regen(string $file, array $deps, bool $debug = false) : bool { - if(!is_file($file)) + if(is_file($file)) + { + $fmtime = filemtime($file); + } + else if(is_dir($file)) + { + $fmtime = filectime($file); + } + else { if($debug) echo "! $file\n"; return true; } - $fmtime = filemtime($file); foreach($deps as $dep) { if($dep && is_file($dep) && (filemtime($dep) > $fmtime))