[TYPO3-dev] connecting to backend for cronjob fails

Cyrill Helg phlogsmailinglists at gmail.com
Sat Oct 4 11:41:16 CEST 2008


Hello 

I have a script from an extension that will be called for a cronjob. With the 
code below however I get some warnings from 

typo3_src/t3lib/class.t3lib_userauth.php on line 311 ###to line 314

and then the typo3 backend login appears.

Anyone has an idea why? I created a normal backend user called 
_cli_visualizexml and also have this in my localconf.php:

$TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys']['visualizexml']
= array('EXT:visualizexml/res/scripts/importXMLcron.php','_CLI_visualizexml');

Thanks for any help.

Here is the code from the cronjob script:

define('TYPO3_MODE','BE');

define('PATH_thisScript',trim($GLOBALS['_SERVER']['SCRIPT_FILENAME']));

define('TYPO3_MOD_PATH', '../typo3conf/ext/visualizexml/res/scripts/');
$BACK_PATH = '../../../../../typo3/';
$MCONF['name'] = '_cli_visualizexml';
require(dirname(PATH_thisScript).'/'.$BACK_PATH.'init.php');

ini_set('max_execution_time',0);

require_once(PATH_t3lib.'class.t3lib_div.php');
require_once(PATH_t3lib.'class.t3lib_extmgm.php');
require_once(PATH_t3lib.'class.t3lib_befunc.php');
require_once(PATH_t3lib.'class.t3lib_parsehtml.php');
require_once(PATH_t3lib.'class.t3lib_htmlmail.php');
require_once(PATH_t3lib.'config_default.php');
require_once(PATH_t3lib.'stddb/tables.php');
include (PATH_t3lib.'stddb/load_ext_tables.php');



if (!defined ("TYPO3_db"))      die ("The configuration file was not 
included.");

require_once(PATH_t3lib.'class.t3lib_db.php');          // The database 
library
$TYPO3_DB = t3lib_div::makeInstance('t3lib_db');
$TYPO3_DB->sql_pconnect (TYPO3_db_host, TYPO3_db_username, TYPO3_db_password);

$TYPO3_DB->sql_select_db (TYPO3_db);


Greets
Cyrill




More information about the TYPO3-dev mailing list