Bug #65803
closedClassLoader Bug with psr-0 autoload configuration - results in double slashes in filepath!
0%
Description
In an extension configure the composer.json with 'psr-0' autoload
... "autoload": { "psr-0": { "Vendor\\NameSpace\\": "Classes/" } } ...
Bug is located in class TYPO3\CMS\Core\Core\ClassLoader in method buildClassLoadingInformationForClassFromRegisteredPackages
.. if ($packageData['substituteNamespaceInPath']) { // If it's a TYPO3 package, classes don't comply to PSR-0. // The namespace part is substituted. $classPathAndFilename = '/' . str_replace('\\', '/', ltrim(substr($className, $packageData['namespaceLength']), '\\')) . '.php'; } else { ... ... } else { $classPathAndFilename = $packageData['classesPath'] . $classPathAndFilename; } ...
$classPathAndFilename is created with a beginning slash - that's wrong,
because the classesPath in $packageData['classesPath'] is always ending with a slash - it's filtered with Files::getNormalizedPath!
Bugfix
$classPathAndFilename = str_replace('\\', '/', ltrim(substr($className, $packageData['namespaceLength']), '\\')) . '.php';
Files
Updated by Wouter Wolters over 9 years ago
- Status changed from New to Needs Feedback
Hi, can you try 7.3 or master?
The TYPO3 classloader is gone now in favor of the composer classloader.
Updated by Helmut Hummel over 9 years ago
- Category set to 1594
Current state is, that we only support psr-4 in non composer mode, and anything composer is capable of in composer mode.
Updated by Helmut Hummel about 9 years ago
- Status changed from Needs Feedback to Rejected
This will not be fixed in 6.2 and in master the code is gone anyway.
but psr-0 will not be supported in non composer mode