开发者

Zend Framework switchting to native namespace

since PHP 5.3 Zend Framework definetly supports namespace as I assume. But the tutorials, examples, and also the ZF.sh tools still开发者_运维技巧 uses the old "fake" namespacing.

My question is, how do I get Zend using the new, real namespace system?


There is nothing to do, their autoloader can find My_Namespace_Class1 as well as My\Namespace\Class1 (by replacing the namespace separator by "/" to find the file).

So you just have to use their autoloader and configure it the same way you would with old/fake namespaces.


The ZF team is actively working on ZF2, the next major version of ZF that would support native namespaces and is much faster. I remember Mathew Weierophinney (ZF core developer), said in a conference that in his initial tests the autoloading was 7 times faster than current version of ZF.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜