/** * Checks if any content of the site has been * modified after the given unix timestamp * This is mainly used to auto-update the cache * * @return boolean */ public function wasModifiedAfter($time) { return dir::wasModifiedAfter($this->root(), $time); }
/** * Checks if the directory or any subdirectory has been * modified after the given timestamp * * @param string $dir * @param int $time * @return boolean */ public static function wasModifiedAfter($dir, $time) { if (filemtime($dir) > $time) { return true; } $content = dir::read($dir); foreach ($content as $item) { $subdir = $dir . DS . $item; if (filemtime($subdir) > $time) { return true; } if (is_dir($subdir) and dir::wasModifiedAfter($subdir, $time)) { return true; } } return false; }