[TYPO3-dev] ext_autoload.php not used
Thomas Mammitzsch
thomas at visualworx.de
Thu Mar 4 16:28:28 CET 2010
Am 04.03.2010 07:53, schrieb Stefan Frömken:
> Steffen Ritter schrieb:
>> Thomas Mammitzsch schrieb:
>>> Am 03.03.2010 17:27, schrieb Stefan Frömken:
>>>> Thomas Mammitzsch schrieb:
>>>>> hi list,
>>>>>
>>>>> i tried to use the new autoload functionality for scheduler tasks
>>>>> created by me. I created an ext_autoload.php in the root folder of the
>>>>> extension containing the task, but it is not used. Do i miss anything?
>>>>>
>>>>> regards, Thomas
>>>> I don't know if you speek german, but I have written a documentation
>>>> about scheduler:
>>>> http://typo3.sfroemken.de/index.php?id=102
>>>>
>>>> on the second page you also see how your ext_autoload.php should be:
>>>> http://typo3.sfroemken.de/index.php?id=103
>>>
>>> yes i do :)
>>> my ext_autoload.php looks exactyl like this. The return of the array
>>> never happens, i checked it with my debugger (for other extensions it
>>> does). Does the extension have to register somewhere, that there is
>>> an ext_autoload.php? I looked for that in the scheduler ext, but
>>> couldn't find anything.
>>>
>>> regards, Thomas
>> have the same problem...
>> Class is listet in "Task-List" on create. But class could not be
>> found... autoload file ist there...
> Is there somebody how can show us some code? ext_autoload.php and/or
> class-file?!
just to mention. the task is working correctly if i requiring the class
in ext_localconf.php. The problem is that the frontend doesn't know
tx_scheduler_Task, so i worked around like that in ext_localconf.php:
if(TYPO3_MODE != 'FE'){
require_once(t3lib_extMgm::extPath('ux_insideclearcache').'ux_insideclearcache_task.php');
}
Working but not as elegant as using the autoload feature.
ok, here is one of my tasks:
tx_sphinx_import_task.php:
<?php
class ux_insideclearcache_task extends tx_scheduler_Task {
public function execute()
{
require_once(t3lib_extMgm::extPath('ux_insideclearcache').'class.tx_uxinsideclearcache.php');
$clearcacheObj = t3lib_div::makeInstance('tx_uxinsideclearcache');
if($clearcacheObj->CLI_main())
{
return true;
}
else
{
return false;
}
}
}
ext_autoload.php:
<?php
return array(
'ux_insideclearcache_task' =>
t3lib_extMgm::extPath('ux_insideclearcache', 'ux_insideclearcache_task.php')
);
regards, Thomas
More information about the TYPO3-dev
mailing list