Task #40870
closed
Add Utility Functions to retreive Information from Class Names
Added by Sebastian Michaelsen about 12 years ago.
Updated over 11 years ago.
Priority:
Won't have this time
Description
My intention is to introduce these 2 Utility Functions:
\TYPO3\CMS\Core\Extension\ExtensionManager::getClassNameWithoutVendorAndProduct($className)
\TYPO3\CMS\Core\Extension\ExtensionManager::getExtensionKeyFromClassName($className)
These can be used in the the Autoloader for example (will be a separate patch, when this one is done).
Also Extbase can make use of these functions to resolve #40742.
Files
- Status changed from New to Under Review
Just to make the usage more obvious I append the patch for the autoloader (will be subject of another issue).
Keep in mind that extension keys will change their format in the future.
They will follow the schema {vendor}.{product} where the product can be divided further by dots. By that it get's easy to distinguish for the autoloader if the class is in a known extension or in a subpackage of an extension. Core extensions currently are subproducts in the form {vendor}.{product}.{subproduct} (eg TYPO3.CMS.Form), but this is hardcoded as the current extension keys don't support the dot notation yet.
Example:
FLOW3 is using a package called "Symfony.Component.Yaml". Their autoloader knows that the class Symfony\Component\Yaml\Parser has to be in the Symfony.Component.Yaml package. So with a list of loaded package names their autoloader knows where the vendor and product name ends and the class name starts.
We're looking forward to support that for 6.1 too to allow further integration of the two projects.
- Status changed from Under Review to Closed
- Priority changed from Should have to Won't have this time
Also available in: Atom
PDF