This is interesting. When oxnew is used i think every class is already checked for modules in oxUtilsObject->getClassName( $sClassName ).
What is this “special case”, is it ever used?
[QUOTE=leofonic;29413]This is interesting. When oxnew is used i think every class is already checked for modules in oxUtilsObject->getClassName( $sClassName ).
What is this “special case”, is it ever used?[/QUOTE]
Yes, many times, to load classes which are used, but not yet explicitly loaded.
Just set a debugger breakpoint there, and look what happens…
Well every class is checked for overloading modules by the factory oxnew. The additional check in the autoloader looks like some superfluous code to me.
[QUOTE=avenger;29443]
[B]Why is there noch check for these classes, if they should be overloaded???[/B][/QUOTE]
But how should the autoloader do this? If you use “new oxarticle” you will always get an oxarticle object. Only when the factory is used: “oxnew(‘oxarticle’)” the factory will execute “new myoxarticle”.
Hi,
I think you don’t realize the __autoload purpose.
__autoload is called then the class is used in new statment (like $oObject = new oxActicle())
so if class will not be loaded, PHP will throw Fatal Error.
special case in this autoloader is used for creating modules parents if it is not created before.
so the flow is this:
$oObject = oxNew(‘oxlist’);
// finds the module for oxlist
// creates all parrents of oxlist modules
// calls __autoload to init the core/oxlist.php
[QUOTE=wanis;29476]
special case in this autoloader is used for creating modules parents if it is not created before.
[/QUOTE]
But how could this ever happen, module parent files are already included by oxnew?