Bug #81375
closed
Autoloader won't recognize case-sensitive vendor names
Added by Moritz Ngo over 7 years ago.
Updated almost 7 years ago.
Description
I had a "very old" extension thats VendorName was "Myvendor".
I wrote a new extension a while ago with the VendorName "MyVendor".
TYPO3 CMS 8.7.1 wont recognize the difference between "Myvendor" and "MyVendor" if both extensions are installed.
Thus TYPO3 CMS 8.7.1 won't autoload classes in my new extension.
That generated an Exception:
Uncaught TYPO3 Exception Class 'MyVendor\MyExt\Utility\ModifyTca' not found
- Description updated (diff)
- Status changed from New to Needs Feedback
Do both extensions have the same extension key? In PHP namespaces, class and function names, etcetera are case insensitive. Composer follows the PSR-4 standard which specifies that (fully qualified) class names must be specified (for the class loader) in a case sensitive way.
For PHP MyVendor\MyExt and Myvendor\MyExt are the same, but for the composer class loader they are different. If you use the same extension name with vendor names that only differ in case you can easily run into problems.
Is this the case for your extensions?
Both extensions have different keys. The FQCNs of both extensions would be something like this:
\Myext\OldExtension\Controller\FooController
\Myext\OldExtension\Utility\AwesomeUtility
\MyExt\NewExtension\Controller\BarController
\MyExt\NewExtension\Domain\Model\MyModel
Those extensions had nothing to do with each other except that \MyExt\NewExtension
used some utility functions of \Myext\OldExtension
.
BTW: I'm not using composer right now ...
Following questions on this:
- Which OS do you use? And does it have a case sensitive Filesystem?
- What are the extension keys for both?
- Did you use the Complete cache clearing and the generating autoloader files in the install tool?
- Status changed from Needs Feedback to Closed
No feedback since the last 90 days => closing this issue.
If you think that this is the wrong decision and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one. Thank you.
Also available in: Atom
PDF