Skip to content
Snippets Groups Projects
Commit 39789b9c authored by Helmut Hummel's avatar Helmut Hummel
Browse files

[TASK] Introduce object implementation registry

With 6.0 all Xclass inclusion in the classes have been
removed and registration of Xclasses have previously been
moved to the autoloader. This added additional complexity 
and another concern to the class loader.

To enable extensions to override classes, an object
implementation registry is now introduced, where you
can now define which implementation class name should 
be used for an original class.

This not only is a complete replacement for former
Xclasses, but at the same time adds the possibility
to have the implementation class name within the namespace
and scope of the extension which registers the override.

On top it would also be possible to register implementations
for interfaces.

Since only class names are mapped here, we again have a
clear separation of concerns, where the class loader
is only responsible to resolve paths for class names
and the "object manager" method makeInstance for resolving
the final class name to instantiate.

The path of the target class can be resolved automatically
by the class loader if naming conventions are met or the
target class name is put into the autoloading registry.

An implementation of a class can be registered like this:

$TYPO3_CONF_VARS['SYS']['Objects']['originalClass'] = 
  array('className' => 'targetClass');

The patch adjusts the ClassLoader and makeInstance.
The unit tests for the ClassLoader are removed since
it is not responsible for resolving Xclasses any more.

Instead unit tests for makeInstance are added to test
the new behavior.

Resolves: #43269
Releases: 6.0

Change-Id: I04198b178aa41f02d7a5b7ee990ff24f483990f5
Reviewed-on: http://review.typo3.org/16712
Reviewed-by: Steffen Ritter
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Tested-by: Steffen Ritter
Reviewed-by: Christian Kuhn
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
parent d6d98473
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment