public function cached() { // Check for non-existant cache file if (!file_exists('data/cache/language_registry')) { return false; } // Get directory modification date clearstatcache(); $dir_modified = array_element(lstat('./locale/'), 9); // Get cache modification date clearstatcache(); $cache_modified = array_element(lstat('data/cache/language_registry'), 9); // If the cache is older than the directory if ($cache_modified < $dir_modified) { //print "rebuild<br/>\n"; // Rebuild cache return false; } else { // Otherwise cache is up to date //print "fine<br/>\n"; return true; } }
private function IsCached() { // Check for a cache file not existing, if so, it's not cached if (!file_exists($this->cache_file)) { return false; } // Get cached modification time $cache_modified = $GLOBALS['sql']->queryOne('SELECT MAX(stamp) AS cache_modified FROM modules'); // Get directory modification date clearstatcache(); $dir_modified = array_element(lstat($dir_name), 9); print "DEBUG: dir_modified = {$dir_modified}<br/>\n"; // If the cache is older than the directory... if ($cache_modified < $dir_modified) { // .. the cache needs to be rebuilt return false; } else { // Or else, we have a cached copy return true; } // end checking cache time }
function numericAge() { return array_element(date_diff($this->local_record["ptdob"]), 0); }
function IsCached() { if (!file_exists($this->cache_file)) { return false; } clearstatcache(); $dir_modified = array_element(stat('data/form/templates'), 9); clearstatcache(); $cache_modified = array_element(stat($this->cache_file), 9); if ($cache_modified < $dir_modified) { return false; } return true; }