Task #40870

Add Utility Functions to retreive Information from Class Names

Added by Sebastian Michaelsen over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Won't have this time
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-09-12
Due date:
% Done:

0%

TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

patch_commit_3a60e55cd377.patch View (2.59 KB) Sebastian Michaelsen, 2012-09-12 16:38

History

#1 Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14555

#2 Updated by Sebastian Michaelsen over 7 years ago

Just to make the usage more obvious I append the patch for the autoloader (will be subject of another issue).

#3 Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14555

#4 Updated by Thomas Maroschik over 7 years ago

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.

#5 Updated by Ernesto Baschny over 6 years ago

  • Status changed from Under Review to Closed
  • Priority changed from Should have to Won't have this time

Abandoned by author

Also available in: Atom PDF