[TYPO3-core] RFC #13604: Bug: Concept of registering extbase BE modules causes massive php warnings with php version >= 5.3

Oliver Hader oliver at typo3.org
Wed May 26 17:24:08 CEST 2010


Hi Xavier,

Am 26.05.10 07:27, schrieb Xavier Perseguers:
> ###########################
> ## EXTENSION: cms
> ## FILE:     
> /Users/xavier/Sites/lionsbase.loc/cms/typo3/sysext/cms/ext_localconf.php
> ###########################
> 
> $_EXTKEY = 'cms';
> $_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];
> 
> 
> Undefined index: T3_SERVICES in /path/to/t3lib/class.t3lib_extmgm.php on
> line 858
> Undefined offset: 2 in /path/to/t3lib/class.t3lib_div.php on line 1026
> 
> ....

Correct, that's also why we should use isset() on array keys to
determine first whether they are really available. Thus, concerning your
example that would be

$_EXTCONF = (isset($TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY]) ?
$_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY] : NULL);

or a bit simpler

$_EXTCONF =& $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];

If the accordant index is not set, using the reference operator would
just set $_EXTCONF to NULL, but would not throw the PHP notice...

olly
-- 
Oliver Hader
TYPO3 v4 Core Team Leader


More information about the TYPO3-team-core mailing list