}
}
+ 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 . ")<br>";
+ `rm -rf $fbdir`;
+ $i++;
+ if ($i === $stop) {
+ break;
+ }
+ }
+ }
+
public static function initCompositionVersions($args)
{
global $core;
$this->log('Js written');
$this->vdir->sync($delete, $this);
$this->log('Files Synced');
+ touch(rtrim(str_replace('/html5/', '/compiletime/', $this->dir)));
}
protected function writeStats()