Project

General

Profile

Actions

Bug #18369

closed

EM warns No XCLASS inclusion code found if you use $GLOBALS['TYPO3_CONF_VARS']

Added by Franz Holzinger over 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-03-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Some newer PHP5 versions did not find the $TYPO3_CONF_VARS variable. You have had to set explcitely global $TYPO3_CONF_VARS in each PHP file. And inspite of this, sometimes it still did not have it.
To solve this issue I have changed $TYPO3_CONF_VARS to $GLOBALS['TYPO3_CONF_VARS'] in each PHP file.

But now the EM warns with many red lines even if the XCLASS is provided. Example:

if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tt_products/view/class.tx_ttproducts_single_view.php']) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tt_products/view/class.tx_ttproducts_single_view.php']);
}

(issue imported from #M7753)


Files

7753.diff (2.26 KB) 7753.diff Administrator Admin, 2008-10-24 19:35
7753-static_info_tables-1.png (22.7 KB) 7753-static_info_tables-1.png Administrator Admin, 2008-11-01 10:18
patch2-7753.diff (3.44 KB) patch2-7753.diff Administrator Admin, 2010-05-01 08:46
7753_v3.diff (2.61 KB) 7753_v3.diff Administrator Admin, 2010-05-20 13:50
Actions #1

Updated by Dmitry Dulepov about 16 years ago

It looks like you try to include files inside functions, not on the global level. Quite logical that $TYPO£_CONF_VARS is not visible there. See how t3lib_div::requireOnce() does it.

Actions #2

Updated by Steffen Kamper about 16 years ago

don't use $GLOBALS['TYPO3_CONF_VARS'] for XCLASS, EM won't recognize, use $'TYPO3_CONF_VARS instead and all is fine.

Actions #3

Updated by Franz Holzinger about 16 years ago

No Steffen, nothing would be fine with your proposal under some PHP5 or TYPO3 versions. The extensions needed bug fixes for this, because under some TYPO3 and PHP5 versions the $'TYPO3_CONF_VARS has been empty.

Actions #4

Updated by Franz Holzinger about 16 years ago

No Dmitry, it did not help to include even a
global $TYPO3_CONF_VARS;
before all includes in a php file.
You cannot include
t3lib_div::requireOnce()
inside of extensions, if you want it to remain executable also under TYPO3 4.x.
This is the reason why exttensions must move from $TYPO3_CONF_VARS to $GLOBALS['TYPO3_CONF_VARS'] for XCLASS and hooks.

Actions #5

Updated by Franz Holzinger about 16 years ago

This patch is necessary, to not show any more the wrong Code warnings in the EM.
Please open another bug report if you want to have code changes in extensions.

Actions #6

Updated by Franz Holzinger over 14 years ago

reminder

Actions #7

Updated by Franz Holzinger over 14 years ago

reminder no. 2

Actions #8

Updated by Christian Kuhn over 14 years ago

committed v3 to:
- trunk, rev. 7644.
- TYPO3_4-3, rev. 7645

Actions

Also available in: Atom PDF