Upgraded to latest icehrm core
This commit is contained in:
22
src/crons/cron.php
Normal file
22
src/crons/cron.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include dirname(__FILE__).'/include.cron.php';
|
||||
|
||||
$cron = new Cron();
|
||||
$crons = $cron->Find("status = ?",array('Enabled'));
|
||||
|
||||
if(!$crons){
|
||||
LogManager::getInstance()->info(CLIENT_NAME." error :".$cron->ErrorMsg());
|
||||
}
|
||||
|
||||
LogManager::getInstance()->info(CLIENT_NAME." cron count :".count($crons));
|
||||
foreach($crons as $cron){
|
||||
$count++;
|
||||
$iceCron = new IceCron($cron);
|
||||
LogManager::getInstance()->info(CLIENT_NAME." check cron :".$cron->name);
|
||||
if($iceCron->isRunNow()){
|
||||
LogManager::getInstance()->info(CLIENT_NAME." execute cron :".$cron->name);
|
||||
$iceCron->execute();
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ $basePath = $opts['p'];
|
||||
|
||||
include (dirname(__FILE__)."/../classes/CronUtils.php");
|
||||
|
||||
$cronUtils = CronUtils::getInstance($basePath, dirname(__FILE__)."/".$file);
|
||||
$cronUtils = CronUtils::getInstance($basePath, $file);
|
||||
|
||||
echo "Cron Runner created \r\n";
|
||||
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
if(php_sapi_name() != 'cli'){
|
||||
exit();
|
||||
}
|
||||
$opts = getopt('c:');
|
||||
$clientPath = $opts['c'];
|
||||
|
||||
if(empty($clientPath)){
|
||||
echo "No client path defined\r\n";
|
||||
exit();
|
||||
}
|
||||
define('CLIENT_PATH',dirname(__FILE__)."/..");
|
||||
|
||||
include (APP_BASE_PATH."config.base.php");
|
||||
|
||||
include $clientPath."/config.php";
|
||||
include (APP_BASE_PATH."include.common.php");
|
||||
include("server.includes.inc.php");
|
||||
include(APP_BASE_PATH."server.includes.inc.php");
|
||||
Reference in New Issue
Block a user