Feature #19

Add a feature for replacing "new" with "getComponent" in php source files

Added by Robert Lemke over 14 years ago. Updated almost 11 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Has patch:


The AOP Framework should have a feature (which can be enabled through the Component configuration) which results in parsing the php source files and replace the new operator with a getComponent call. These modified files should be written into the FileCache and the modified classes used as the parent class for AOP proxies or, if no such proxy exists, registered as the implementation class of the component with that class name.


Updated by Sudara Williams - over 14 years ago

I'm excited by this feature, especially as the default.

It is these kinds of features that really make a framework powerful - doing the heavy lifting in the background and providing a simple and intuitive API for the developers.


Updated by Robert Lemke about 14 years ago

I implemented this feature but after a discussion with Karsten removed it again - at least disabled it by default. I suggest we make it configurable in the Components configuration so it's easy to integrate legacy PHP code.



Updated by Robert Lemke almost 14 years ago

  • Status changed from New to Accepted

Currently this feature does not work and is disabled. Don't forget to either fix or remove it ...


Updated by Malte Jansen almost 14 years ago

The TYPO3CGL validates the Code in the main folder 'Classes' for 'new'.
'new' will be only allowed, if a component is not registered (e.g. PHPUnit or PHP_CodeSniffer).
The folder 'Resources/PHP/' will be ignored.

It's still needs to be discussed, if a Package can be released/published on the TER.
So everybody could be forced to use to CM.


Updated by Malte Jansen over 13 years ago

The ComponentManager does not know the classes provided by PHP.
e.g. ArrayObject()


Updated by Robert Lemke over 13 years ago

  • Target version deleted (1)

Updated by Robert Lemke almost 13 years ago

  • Status changed from Accepted to Closed

This feature is postponed for now as we probably find a better solution with spl_factory_register()

Also available in: Atom PDF