Task #56944
closedCheck for a proper extension key on load
100%
Description
I discussed this with Stefan Neufeind yesterday and are now submitting this as a task. The aim is mainly to enforce the CGL for extension keys, so developers won't run into errors which are very frustrating and time-consuming to resolve.
When developing an extension, and the first character of the vendor name is not uppercase, you will run into troubles when trying to implement model relations. The error you'll get is Found an invalid element type declaration in %s. A type "'\\vendor\\package\\Domain\\Repository\\FooRepository'" does not exist
.
I ran into that very problem yesterday and would have loved to get some guidance from TYPO3 instead of an error which you need to google to get your solution, and this at a very late point.
My suggestion is to implement a check when loading the extension in the extension manager. If the key is not well formatted, it won't be loaded and you'll see a clear error telling you the actual problem. This clearly is a "nice to have" feature. As the check only happens when loading the extension, the general performance of the extension should not be affected.
Updated by Pascal Dürsteler over 10 years ago
Doing it through the extension manager would be a lot of work. I decided to put it into the ExtensionUtility, since there are other checks performing. I am working on this, however, I have a few questions here..
http://docs.typo3.org/typo3cms/CodingGuidelinesReference/PhpFileFormatting/FileStructure/Index.html?highlight=namespace only mentions that "TYPO3 Core" extensions are UpperCamelCase. So, does that also count for other extensions? And if so...
There are extensions which do not comply to these CGL (UpperCamelCase). If the extension is just providing libraries, there most likely won't be any issue using them. So I am not sure if we should throw exceptions (which would render them unusable) or just log something into the deprecation log, which may be ignored by the developer.
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28469
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28469
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28469
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28469
Updated by Gerrit Code Review over 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28469
Updated by Gerrit Code Review over 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28469
Updated by Gerrit Code Review over 9 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/28469
Updated by Gerrit Code Review over 9 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/28469
Updated by Pascal Dürsteler over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9e182550f8505f01a172f20b31d5a856bb2e3a11.