[TYPO3-mvc] Scheduler & ext_base?

Eat Dimanche dimanche at web-essentials.asia
Tue Jan 11 06:14:15 CET 2011


Hi Micheal,

I am using Extbase from a scheduler task like you did, and it is working 
fine when I executed task in the backend(Manually). But now I dont want 
to do it manually, I want scheduler to run my task automatically by 
using cronjob. When the cronjob executed the scheduler task I found that 
an object of dispatcher class which is calling a function, doesn't work. 
I don't know what cause the problem.

$dispatcher = new Tx_Extbase_Dispatcher();
$dispatcher->dispatch('', $configuration); // It doesn't work when 
calling its function.

I really appreciate for any way you found.

Thanks,
Dimanche

On 07/26/2010 10:01 PM, Michael Feinbier wrote:
> Hi Braulio,
>
> I am using Extbase from a scheduler task like this:
>
> class Tx_Hettich_Service_PressSubscriptionScheduler extends
> tx_scheduler_Task {
>
> /**
> * Macht eigentlich nichts weiter als ExtBase aufrufen
> * Presse->notify
> *
> * @return boolean
> * @see typo3/sysext/scheduler/tx_scheduler_Task::execute()
> */
> public function execute() {
> $configuration = array(
> 'extensionName' => 'hettich',
> 'action' => 'notify',
> 'controller' => 'Presse',
> 'switchableControllerActions' => array(
> array('controller' => 'Presse', 'actions' => 'notify')
> )
> );
>
> $dispatcher = new Tx_Extbase_Dispatcher();
> $dispatcher->dispatch('', $configuration);
>
> return true;
> }
> }
>
> This works fine for me but as already mentioned this is just a kind of
> hack because it is no "real" HTTP-Request.
>
> Hope, that helps
>
> Micha
>
>
> Am 22.07.10 21:42, schrieb Braulio J. Solano-Rojas:
>> Hello.
>>
>> I would like to know if it is possible to dispatch a controller inside a
>> task (before I try). I would like to do something like this:
>>
>> class Tx_Magazine_Task_EmailTask extends tx_scheduler_Task {
>> public function execute() {
>> // Create a Tx_Extbase_MVC_Request $request object.
>> // Set parameters for request.
>> // Create a response object $response.
>> $controller =
>> t3lib_div::makeInstance('Tx_Extbase_MVC_Controller_ActionController');
>> $controller.processRequest($request, $response);
>> // use t3lib_div to email $response.getContent();
>> return True;
>> }
>> }
>>
>> Am I understanding fine the API?
>>
>> I will appreciate very much any help.
>>
>> Best regards,
>>
>> B.
>



More information about the TYPO3-project-typo3v4mvc mailing list