[TYPO3-mvc] cli_dispatch.phpsh runs on BE scheduler not in crontab

Rayuth You (Yuth) rayuth at typo3cambodia.org
Wed Feb 8 05:10:59 CET 2012


On 02/03/2012 04:07 PM, Rayuth You (Yuth) wrote:
> Hi list
>
> Using extbase 1.2.0, I run task scheduler in BE and it work fine.
> But I got nothing when I run from crontab
> 30 18 * * * php /var/www/demo/typo3/cli_dispatch.phpsh scheduler
>
> My configuration
> =====================================================================
> $settings =
> unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['myext']);
> $configuration = array(
> 'pluginName' => 'Pi1',
> 'extensionName' => 'myext',
> 'settings' => '< plugin.tx_myext.settings',
> 'persistence' => '< plugin.tx_myext.persistence',
> 'view' => '< plugin.tx_myext.view',
> 'persistence' => array(
> 'storagePid' => $settings['storagePid']
> ),
> '_LOCAL_LANG' => '< plugin.tx_myext._LOCAL_LANG',
> 'controller' => 'ControllerName',
> 'action' => 'actionName',
> 'switchableControllerActions' => array (
> '1' => array('controller' => 'ControllerName', 'actions' => 'actionName')
> )
> );
> t3lib_div::_GETset(1,'id'); // Root page uid where we include plugin
> t3lib_div::_GETset('ControllerName','tx_myext_pi1|controller');
> t3lib_div::_GETset('actionName','tx_myext_pi1|action');
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['myext']['modules']['Pi1']['controllers']
> = array(
> 'ControllerName' => array('actions' => array('actionName'))
> );
> $dispatcher = new Tx_Extbase_Dispatcher();
> $dispatcher->dispatch('', $configuration);
> return true;
> =====================================================================
>
> Any solution or hint?
>
> Regards,
> Yuth

Now it works, I change this 3 lines

t3lib_div::_GETset(1,'id');
t3lib_div::_GETset('ControllerName','tx_myext_pi1|controller');
t3lib_div::_GETset('actionName','tx_myext_pi1|action');

To

$_SERVER['REQUEST_METHOD'] = 'GET';
$_GET['id'] = 1;
$_GET['tx_myext_pi1']['controller'] = 'ControllerName';
$_GET['tx_myext_pi1']['action'] = 'actionName';

But I dunno it's a rite solution or not.

Thanks for your answers.

-- 
Khmer TYPO3 User Group
Spirit of sharing

Rayuth You
Web Developer

M: +855 11 262 078
E: rayuth at typo3cambodia.org


More information about the TYPO3-project-typo3v4mvc mailing list