简体   繁体   English

命名PHP核心和库的举措

[英]Initiatives to namespace PHP core and libraries

With the introduction of Object-Oriented and Namespacing capabilities in PHP, I am loving the new found cleanliness of PHP code that can be produced. 随着PHP中面向对象和命名空间功能的引入,我很喜欢可以生成的PHP代码的新清洁度。 The annoying thing though is that the core of PHP is still cluttered, unorganized mess of functions. 令人烦恼的是,PHP的核心仍然是混乱,无组织的混乱功能。

Are there any initiatives to organize the PHP core and "common" libraries into namespaces and classes? 是否有任何举措将PHP核心和“常见”库组织成名称空间和类?

There's been some discussion, but no real will -- the PHP dev team is too short for the size of the project and there are other priorities. 有一些讨论,但没有真正的意愿 - PHP开发团队对于项目的规模太短,还有其他优先事项。 You should note that it that would break backwards compatibility with older scripts, even if the current global names are left as is. 您应该注意它会破坏与旧脚​​本的向后兼容性,即使当前的全局名称保留原样。 See here . 看到这里

You might want to see the RFC that proposes the use of namespaces for internal classes and its discussion in the internals mailing list here and here . 您可能希望在此处此处看到建议在内部类中使用名称空间的RFC及其在内部邮件列表中的讨论。

SPL is a good start in this direction. SPL是朝着这个方向迈出的良好开端。

http://php.net/manual/en/book.spl.php http://php.net/manual/en/book.spl.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM