* adjust the include path.

* set time zone.
This commit is contained in:
wangchunsheng
2013-01-30 06:08:35 +00:00
parent e57a66b18a
commit b4b94c6227

View File

@@ -10,10 +10,12 @@
* @version $Id$
* @link http://www.zentao.net
*/
/* Set pathes and include crontab.class.php. */
$zentaoPath = dirname(dirname(dirname(__FILE__))) . "\\";
$cronPath = dirname(dirname(dirname(__FILE__))) . '/bin/cron';
include $zentaoPath . '/lib/crontab/crontab.class.php';
/* Set pathes and timezone. */
$zentaoPath = dirname(dirname(dirname(__FILE__))) . "/";
$cronPath = $zentaoPath . 'bin/cron';
include $zentaoPath . 'config/config.php';
include $zentaoPath . 'lib/crontab/crontab.class.php';
date_default_timezone_set($config->timezone);
/* Parase crons. */
$crons = parseCron($cronPath);
@@ -43,7 +45,7 @@ while(true)
$log = '';
exec($cron['command'], $output, $return);
$time = $now->format('H:i:s');
$time = $now->format('G:i:s');
foreach($output as $out) $log .= $out . "\n";
$log = "$time task " . ($key + 1) . " executed,\ncommand: $cron[command].\nreturn : $return.\noutput : $log\n";
echo $log;