Hi all, I've seen this before too. On some places in the code of Zend Framework the Zend_Loader is hard coded as Tomáš mentioned. In my point of view "Zend_Loader::loadClass();" code gives the Framework a unneeded hard coupling to the Loader. Especially in the MVC-Components this coupling forced me to duplicate a lot of Zend code in my own subclasses.
This duplication was needed specially in the case of Zend_Controller_Front#setRequest($request) and Zend_Controller_Dispatcher_Standard, but I had the same problem in some other components I can't remember right now. Cheers, Leo -----Ursprüngliche Nachricht----- Von: Tomáš Procházka [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 25. Oktober 2007 07:20 An: [email protected] Betreff: Re: [fw-general] extended Zend_Loader Hi Matthew Weier O'Phinney. Maybe, you don't understand me. Static method Zend_Loader::loadClass(); doesn't use my registered class loader with MyZendLoader::registerAutoload('MyZendLoader'); I think, that this is bug. Zend Framework use Zend_Loader::loadClass() for loading my own classes, for example my rowClass in Zend_DB_Table_Abstract. But I don't have any way to use own classloader for it. I must modified Zend_Loader clas for do it. I added this to loadClass() if (spl_autoload_functions()!==false) { spl_autoload_call($class); return; } But I don't like if I must modify Zend Framework files. -------------------------- Original message -------------------------- From: Matthew Weier O'Phinney <[EMAIL PROTECTED]> Subject: [fw-general] extended Zend_Loader Date: Thursday, October 18, 2007, 7:59:16 PM Attachments: <none> msgid:[EMAIL PROTECTED] M> -- Tomáš Procházka <[EMAIL PROTECTED]> wrote M> (on Thursday, 18 October 2007, 07:37 PM +0200): >> Hi. >> I need use Zend for my old project which use different style of class >> name. I use class.ClassName.php. Problem of Zend_Loader that I can't >> modify it. I can make extension, but Zend Internal use >> "Zend_Loader::loadClass($this->_rowClass);" I think, that this is not >> good idea. >> When I have set this: >> MyZendLoader::registerAutoload('MyZendLoader'); >> Zend_Loader should use this. >> What about add this to loadClass() method? >> if (spl_autoload_functions()!==false) spl_autoload_call($class); M> The beauty of spl_autoload is that you can register as many autoloaders M> as you want. If you need to register a different one for your own M> classes, do so at any point either before or after calling M> Zend_Loader::registerAutoload(). ----------------------- End of original message ---------------------- -- Tomas Prochazka
