/** * This method is use for check if you must launch the job * * @access public * @static */ public static function exec() { $cache_file = Config::getCacheFolder() . '/' . Config::getCacheFilename(); if (file_exists($cache_file) === false) { self::launch(); } else { $cache_mtime = filemtime($cache_file); $cache_regenerate = time() - Config::getCacheTime() * 60; if ($cache_mtime < $cache_regenerate) { self::launch(); } } }
/** * This function initialize, if neccesary, the filename with the configuration * * @access protected * @static */ protected static function init() { if (self::$filename === null) { self::$filename = Config::getCacheFolder() . '/' . Config::getCacheFilename(); } }