为 CakePHP 1.2 编写仅 PHP5 的代码
鉴于 CakePHP 1.2 同时支持 PHP 4 和 5,编写仅在 PHP5 中运行的插件、帮助程序、组件等与公众共享有何政治意义?
我想改进自己的代码,正确地将函数标记为受保护或私有,这只有在 PHP5 中才可能实现,但同时制作可重用的代码,使其他人受益。
Given that CakePHP 1.2 supports both PHP 4 and 5, what's the politics on writing plug-ins, helpers, components etc to be shared with the public that only run in PHP5?
I want to be better my own code, properly marking functions as protected or private which is only possible in PHP5, but at the same time make reusable code that benefits others.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你环顾一下面包店,就会发现在 php4> 中运行的蛋糕有相当多的额外部分。还有一些需要 php5,使用 php5 编写一个出色的插件并将其发布给公众并没有什么问题,因为 php5 包含了 php 需要的许多改进。
在我看来,php4 是一个正在消亡的品种,cake2 转向 php5 只是因为速度的提高,而 php5 已经退出太久了,我不认为有太多理由只编写 php4 应用程序,只是因为有人还没有抽出时间来使用 php5。升级他们的网络服务器可以使用你的插件。
If you look around on the bakery there are quite a bit of extra bits for cake that run in php4> and some that require php5, There is nothing wrong with writing a great plug-in using php5 and releasing it to the public as php5 contains many improvements that php needs.
In my opinion php4 is a dieing breed, with cake2 moving to php5 only due to the amount of speed increases and php5 being out for so long i don't see much reason in writing php4 only apps just because someone who has not gotten around to upgrading their web server can use your plug-in.