From 925335b6f980d839ef11902e0cca230ffcb2bcfa Mon Sep 17 00:00:00 2001 From: Miraty Date: Tue, 17 Mar 2020 14:03:25 +0100 Subject: [PATCH] Fix style.min.css updating --- index.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 05d4046..c2dbf30 100755 --- a/index.php +++ b/index.php @@ -105,20 +105,18 @@ if (badQuery()) { setVariables($variablesTheme); // Rends ces couleurs utilisables dans style.less - // If style.min.css exists if (file_exists("style.min.css")) - // And if it's older than the theme config - if (filemtime("themes/" . $theme . "/theme.php") < filemtime("style.min.css")) + // And if it's older than theme.php or config.inc.php (so not up to date) + if (filemtime("themes/" . $theme . "/theme.php") > filemtime("style.min.css") OR filemtime("config.inc.php") > filemtime("style.min.css")) // Then delete it unlink("style.min.css"); - // Compile, minimise et met en cache style.less dans style.min.css + require "lessphp/lessc.inc.php"; + $less = new lessc; + $less->setVariables($variablesTheme); // Rends ces couleurs utilisables dans style.less $less->setFormatter("compressed"); - $less->checkedCompile("style.less", "style.min.css"); + $less->checkedCompile("style.less", "style.min.css"); // Compile, minimise et met en cache style.less dans style.min.css ?>