[TYPO3-mvc] typo3.eclipse.extender with object manager in Extbase

Bastian Waidelich bastian at typo3.org
Wed Oct 6 10:06:52 CEST 2010


Martin Kutschker wrote:

Hi Masi,

>> Maybe Roberts RFC (http://wiki.php.net/rfc/customfactories) will get some attention one time.. then
>> we would not need custom IDE support anymore as far as I understood it..

> Why? The IDE would then need to know what factory does unless it will execute the PHP code of the
> factory.

It only needs to know the class/interface you're referring to.
Imagine you could write

$logger = new SomeLogger();

Instead of trying to instantiate the interface PHP would execute the 
factory method you registered with spl_factory_register().
But for the IDE it wouldn't matter - Code completion would work for the 
specified class. This would even work with interfaces:
$logger = new SomeLoggerInterface();
$logger->... triggers autocompletion for the interface methods.


> Anyway, I think the proposal as it is interferes with the auto-loader.

I don't think so..
spl_factory_register(array(new ObjectFactory(), 'create'));
$logger = new SomeLogger();

would be just the same as:
$objectFactory = new ObjectFactory();
$logger = $objectFactory->create('SomeLogger');

Anyways.. I doubt the RFC will make it into PHP looking at their 
restrictive policy..

Best,
Bastian




More information about the TYPO3-project-typo3v4mvc mailing list