开发者

Why does Joomla not use private, public and protected keywords?

I noticed that Joomla uses less secure var type for variables in classes

Why is this?

In my own components,plugins,modules should I follow this convention or use a more secure private, public and protected 开发者_StackOverflowkeywords.


Joomla's roots are in PHP 4, (and as @Palantir notes, they even still support it!).

It is very difficult to "add" PHP 5's new OOP features like private / public / protected to a complex system like that. There are too many dependencies to be aware of, and too much potential for obscure bugs.

They will probably start appearing in the future when PHP 4 support is dropped (shouldn't be long anymore), and parts of the system undergo a fundamental rewrite.


That is to be compatible with PHP4, which does not allow access modifiers and relies on the var keyword. See requirements here: http://www.joomla.org/technical-requirements.html, they support PHP4, though they do not recommend it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜