Project

General

Profile

Actions

Bug #55256

closed

Invalid class name to file path conversion

Added by Xavier Perseguers over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Caching
Target version:
Start date:
2014-01-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In an Extbase extension, the ClassLoader is called to store the PHP file name corresponding to a given class.

In some situations (loading of a class name from its table name - tx_extensionname_domain_model_somename), it fails to properly compute the corresponding file name as /path/to/extensionane/Classes/Domain/Model/Somename.php but computes it as /path/to/extensionname/Classes/domain/model/somename.php.

The computed filename is tested with file_exists() which will return FALSE (and give a cache miss, not dramatical) on case sensitive file systems. But on case insensitive file systems, such as by default on Mac OS X (or Windows), file_exists() will return TRUE and the pair class name <-> filename.php will be stored in typo3temp/Cache/Data/cache_classes/tx_extensionname_domain_model_somename

Now, at some point autoloader will properly load the class name without relying on this cache but \TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::isCoreType(), will under certain circumstance be called. Now this method calls "is_subclass_of" which will use the cache and try to load the file.

Problem is that the corresponding class has already been loaded using its proper file name which results into a PHP fatal exception:

Fatal error: Cannot redeclare class VendorName\Extension\Domain\Model\Somename


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #55418: Class Loader requires "wrong" class files if class string matches naming conventionClosed2014-01-29

Actions
Actions

Also available in: Atom PDF