我正在尝试让调度程序类在typo3 上运行。
ext_autoload.php:
$extensionPath = t3lib_extMgm::extPath('mh_compass');
$loaderClass = array(
'tx_monitorcompassdailyreset_sched' => $extensionPath.'scheduler/class.tx_monitorcompassdailyreset_sched.php',
);
return $loaderClass;
ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_monitorcompassdailyreset_sched'] = array(
'extension' => $_EXTKEY,
'title' => 'Compass Monitor Daily Reset Scheduler',
'description' => 'Reset daily Monitor Jobs',
);
class.tx_monitorcompassdailyreset_sched.php:
class tx_monitorcompassdailyreset_sched extends tx_scheduler_Task {
public function execute() {
error_log( "Start Compass Monitor Daily Reset Scheduled Job" );
//do some stuff
error_log( "Finished Compass Monitor Scheduled Job" );
}
}
当我尝试在后端的调度程序中添加任务时,出现以下错误:
Fatal error: Class 'tx_monitorcompassdailyreset_sched' not found in /var/www/typo3_src-4.5.22/t3lib/class.t3lib_div.php on line 5375
这没有任何意义,因为 a) 我在该函数上使用了调试,它加载了所有其他类,并且 b) 我看不到我的类命名存在差异。
php的版本是5.3.10(5.3.2有这样的bug,但是消失了)