[TYPO3-mvc] Scheduling Extbase Action (version 1.4.2)

Henjo Hoeksma me at henjohoeksma.nl
Sun Jul 1 15:37:18 CEST 2012


Do you happen to use some user agent switching in your localconf for
example?
In that case the server wouldn't know which uri to use...
Working from within the scheduler works fine but directly it won't...

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Fri, Jun 22, 2012 at 12:26 PM, SotirisBK <swtos at hotmail.com> wrote:

>
> Hi all,
>
> I have seen a thread here having many replies and a lot of people
> responding that had a confirmed solution. I believe this was for extbase
> version 1.3.
> Following your example I have created an extension and I have set a
> Schedule action. I see the scheduled action correctly in the schedule
> module and when I execute it through BE runs normally and completes what is
> to be done.
>
> so what I've done so far:
>
>
> (ext_localconf.php)
> $GLOBALS['TYPO3_CONF_VARS']['**SC_OPTIONS']['scheduler']['**
> tasks']['tx_extensionname_**utility_scheduler'] = array(
>     'extension'        => $_EXTKEY,
>     'title'            => 'This is a scheduler blah blah',
>     'description'      => 'And does this and that',
> );
>
>
>
> (ext_autoload.php)
> <?php
> $extensionPath = t3lib_extMgm::extPath('**extensionname');
>
> return array(
>     'tx_extensionname_utility_**scheduler' => $extensionPath .
> 'Utility/Scheduler.php',
> );
> ?>
>
>
>
> (I created under Utility folder the file Scheduler.php)
> <?php
>
> class tx_extensionname_utility_**scheduler extends tx_scheduler_Task {
>     public function execute() {
>         try {
>             t3lib_div::devlog('--- working ---', 'extensionname', 0);
>             $configuration = array(
>                 'extensionName' => 'extensionname',
>                 'pluginName' => 'Pi1',
>                 'controller' => 'Mycontroller',
>                 'action' => 'myaction',
>                 'switchableControllerActions' => array(
>                     'Mycontroller' => array(
>                         'actions' => 'myaction'
>                     )
>                 )
>             );
>             $_SERVER['REQUEST_METHOD'] = 'GET';
>             $_GET['tx_extensionname_**plugin']['controller'] =
> 'Mycontroller';
>             $_GET['tx_extensionname_**plugin']['action'] = 'myaction';
>
> $GLOBALS['TYPO3_CONF_VARS']['**EXTCONF']['extbase']['**
> extensions']['extensionname'][**'modules']['Pi1']['**controllers'] =
> array(
>               'Mycontroller' => array(
>                     'actions' => array(
>                       'myaction'
>                     )
>                 )
>             );
>             $bootstrap = t3lib_div::makeInstance('Tx_**
> Extbase_Core_Bootstrap');
>             $result = $bootstrap->run('', $configuration);
>             t3lib_div::devlog($result , 'extensionname', 0);
>             return TRUE;
>         }
>         catch(Exception $e) {
>             t3lib_div::devlog('--- error ---'.$e->getMessage(),
> 'extensionname', 3);
>             return FALSE;
>         }
>     }
> }
>
> ?>
>
> The problem:
> Unfortunately this doesn't happen when I try to execute it through
> "cli_dispatch.phpsh scheduler" command. In this case it seems that it gets
> into the scheduler class, reads configuration but never reaches into the
> Controller's Action but ends the scheduler normally. Of course no action
> was taken! The error that I get from Bootstrap is:
>
> Extbase 1.4.2 usage: ./cli_dispatch.phpsh extbase <command identifier> See
> './cli_dispatch.phpsh extbase help' for a list of all available commands.
>
>
> Does anybody have a clue why I can execute manually through Scheduler and
> fails when it comes to cronjob?
>
> Thanks,
> Sotiris
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list