[Typo3-dev] annoying difference between 3.5 and 3.6 extmng class extension warnings

Martin T. Kutschker Martin.T.Kutschker at blackbox.net
Mon Mar 22 16:49:18 CET 2004


Martin T. Kutschker wrote:
> Martin T. Kutschker wrote:
> 
>> Hi!
>>
>> For 3.5 I used to write the class extension code like this (with 
>> double quotes)
>>
>> if (defined("TYPO3_MODE") && 
>> $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/gsi_whoisonline/pi1/class.tx_gsiwhoisonline_pi1.php"]) 
>> {
>>
>> include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/gsi_whoisonline/pi1/class.tx_gsiwhoisonline_pi1.php"]); 
>>
>> }
>>
>> I had to, because otherwise I'd get warnings.
>>
>> Now in 3.6RC1 I have to use single quotes. That's great, but now I 
>> have warnings for my old code. Perhaps both could be supported in 3.6 
>> final? 
> 
> 
> File: typo3/mod/tools/em/index.php
> Line 2431:
> 
> Change from
> 
> $XclassParts = explode('if (defined(\'TYPO3_MODE\') && 
> $TYPO3_CONF_VARS[TYPO3_MODE][\'XCLASS\']',$fContent,2);
> if (count($XclassParts)==2)     {
> 
> to
> 
> if (ereg("\n\w*if *\( *defined\(['\"]TYPO3_MODE['\"]\) *&& 
> *[$]TYPO3_CONF_VARS\[TYPO3_MODE\]\[['\"]XCLASS['\"]\]([^}]*)}",$fContent,$XclassParts))      
> {

I goofed and forgot the other two comparisons:

1)

The next reg.exp. in the code must read as follows.

ereg('^\[[\'"]([[:alnum:]_/.]+)[\'"]\]',$XclassParts[1],$reg);

2)

The strstr() some lines down must be converted to an ereg() call.

ereg('include_once 
*\([$]TYPO3_CONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]\[[\'"]'.$cmpF.'[\'"]\]\);',$XclassParts[1])

Does anybody with CVS write access read and care about this?

Masi





More information about the TYPO3-dev mailing list