From: vincent@cubedesigners.com Date: Wed, 27 Oct 2021 11:03:17 +0000 (+0000) Subject: wait #4840 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=07296b7c29ff5c426cb526a3467b4dc12ac2b2d0;p=cubeextranet.git wait #4840 @1.5 --- diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 78eb1bfa7..c368c392b 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -30,6 +30,38 @@ class wsMaintenance } } + public static function cleanCompiledBooks() + { + cubePHP::neverStop(); + $dir = WS_BOOKS . '/compiletime/'; + $hdir = WS_BOOKS . '/html5/'; + $limit = time() - (3600 * 24 * 7); + $stop = 1500; + $i = 0; + $dr = opendir($hdir); + while ($f = readdir($dr)) { + if ($f === '.' || $f === '..') { + continue; + } + $timefile = $dir . $f; + if (file_exists($timefile) && filemtime($timefile) >= $limit) { + continue; + } + + $fbdir = $hdir . $f; + if (!file_exists($fbdir)) { + continue; + } + + echo 'Clean ' . $f . "(" . $fbdir . ")
"; + `rm -rf $fbdir`; + $i++; + if ($i === $stop) { + break; + } + } + } + public static function initCompositionVersions($args) { global $core; diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index f3c6927fa..64848c9fa 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -934,6 +934,7 @@ class wsHTML5Compiler $this->log('Js written'); $this->vdir->sync($delete, $this); $this->log('Files Synced'); + touch(rtrim(str_replace('/html5/', '/compiletime/', $this->dir))); } protected function writeStats()