Project

General

Profile

Actions

Task #66390

closed

Conflicting "use" namespace in extension extLocalconf.php and extTables.php breaks cache

Added by Sven Flesch about 9 years ago. Updated almost 9 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2015-04-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Using shortened namespaces with "use" in the files extLocalconf.php and extTables.php for an extension breaks the cache. These files are concatenated which might lead to multiple "uses" of the same namespace.

Classic example would be "TYPO3\CMS\Core\Utility\ExtensionManagementUtility".

Solution would be to parse for "use" statements during concatenation, store them in an array, remove them from the code, remove duplicates from the array and then add the whole of it back to the top of the concatenated file.

Actions #1

Updated by Markus Klein about 9 years ago

  • Status changed from New to Rejected
  • Target version deleted (6.2.12)

Usage of "use" statement inside those files is strictly forbidden, exactly because of this issue.

It is way more efficient to solve the issue by changing the extension than doing magic rewrites for the cache.

Actions #2

Updated by Philipp Wrann almost 9 years ago

Strictly forbidden? I didnt know that and ran into the same problem.

TYPO3 supports php namespaces and should (imo) also respect their usage when concatenating php code.

The solution described by sven seems good enough, it would only cost a few nanoseconds to do that on the very first page hit.

Actions #3

Updated by Markus Klein almost 9 years ago

How would you deal with those two ext_localconf.php files?

ext1:

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility as ExtUtil;

ext2:

use TYPO3\CMS\Extbase\Utility\ExtensionUtility as ExtUtil;

If you combine them, you gonna die.

There is more edge-cases than normal cases. So no way to guarantee that we parse the files correctly.

Actions

Also available in: Atom PDF