mise en place de la release 0.7
passage pour le trunk a la version PHP 5 (voir le fichier RELEASE.fr pourplus de renseignement sur la nouvelle version de developpement)
This commit is contained in:
parent
0d66093946
commit
3145e721c3
286 changed files with 1971 additions and 78266 deletions
42
inc/class/cron.class.php
Normal file
42
inc/class/cron.class.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* Class for manage the job scheduler
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl.html GPL
|
||||
* @copyright 2009 Johann Dréo, Simon Leblanc
|
||||
* @package stripit
|
||||
*/
|
||||
class Cron
|
||||
{
|
||||
/**
|
||||
* 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 method launch the job
|
||||
*
|
||||
* @access protected
|
||||
* @static
|
||||
*/
|
||||
protected static function launch()
|
||||
{
|
||||
Strip::createCache();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue