Let's just turn every module into a static class, and change the whole hook system to call namespace-contained methods rather than plain functions. * ducks for cover... Take it easy, people - that was a JOKE! Cheers, Jaza. On 5/17/06, Karoly Negyesi <karoly@negyesi.net> wrote:
Hi!
We have a namespace problem. As PHP identifiers can have only letters, numbers and underscores we are using underscores for the hook identifier, ie. we have a hook_menu etc.
On the other hand, when a module is best described with more than one word, the words are separated by underscores. This can lead to clashes, like foo.module defines a function called foo_bar_that and when foo_bar.module would like to implement the newly introduced hook_that.... then we have a problem. This already means that if you have a foo.module then you are better not using any function that's called foo_X_hookname.
We discussed several solutions on IRC.
One of them is using double underscores somewhere. But where? If you use them as hook identifiers you have 35K LoC in core to look through (and change a significant percentage). It will be fun, fun, fun! It's visually very confusing to rename taxonomy_menu to taxonomy__menu because then the hook_menu will look like taxonomy__menu_menu and the two menus look as if they belong together.
So, that won't work.
Another solution is to use zero underscores somewhere. But where? Again, changing core is not a good option, and I won't like hookmenu instead of hook_menu.
So, with perfect logic we arrived to a very ugly point: we shall rename axonomy_menu to taxonomyMenu . Do I like this? _No_! But...
Regards
NK