[TYPO3-core] RFC: fix feature request #568

Bernhard Kraft kraftb at kraftb.at
Thu Feb 2 18:38:17 CET 2006


Grüzi :)

Wolfgang Klinger wrote:

> +		// $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php'][] = 'EXT:my_ext/class.browserinfo.php:MyBrowserInfoClass';
> +		if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php'])) {
> +			foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php'] as $classRef) {
> +				$this->hookObjectsArr[] = &t3lib_div::getUserObj($classRef, '');
> +			}
> +		}
> +	}

I see a problem here ... you created the array containig the class references (EXT:my_ext...) directly in the t3lib/class.t3lib_match...
key ...

But when an "old" hook is set :

> +		if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['devices_class']))	{
> +			foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['devices_class'] as $_classRef)	{
> +				$_procObj = &t3lib_div::getUserObj($_classRef);
> +				return $_procObj->whichDevice_ext($useragent);
> +			}
> +		}

'devices_class' which is an array will be one of the elements of the above array/foreach:

 > +			foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php'] as $classRef) {

So $classRef will be an array one time :(


I think the way to go is to keep the standards and have the new array of class reference "a level deeper":

$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'][] = 'EXT:my_ext/class.browserinfo.php:MyBrowserInfoClass';

This may look unnecessary at the first moment but it is somehow a standard to have
[SC_OPTIONS][filename][hookclassname][]



sorry for letting you change the patch so often ...

Also I don't know what exactly the problem where but Stucki or me will ask Kasper today and inform you via
private mail ...



greets,
Bernhard



More information about the TYPO3-team-core mailing list