Zend Resource Autoloaders not working for namespaces

前端 未结 3 1885
南旧
南旧 2021-01-13 21:09

I have this autloading struggle with the Zend Framework. Basically there is a folder named LunaZend in library folder. LunaZend has some classes which can be used in Zend Fr

3条回答
  •  北海茫月
    2021-01-13 22:02

    AFAIK, the ZF1 autoloader does not handle genuine PHP 5.3 namespaced classes. To use the ZF1 autoloader on true namespaced classes, you need to configure the separator variable to be \. (Thanks to @Mattieu for the correction). But Zend_Loader_Autoloader_Resource doesn't handle the path mapping the way we might expect.

    You could use a namespace-aware autoloader, like that of Doctrine2 or ZF2. Pushing one of these autoloaders onto the standard ZF1 autoloader stack should handle it.

提交回复
热议问题