I like PHP; its fun, quick and easy… most of the time. However, I have recently had the misfortune of attempting to make WordPress, Wikka Wiki and Vanilla work together. Although, individually, they are very powerful and superb examples of open source development, they suck at working with other projects.
Two things immediately struck me: 1) lack of a common templating system and 2) lack of a common authentication /authorisation system
Now, I don’t mean that there should be a single templating system used by all, but there should at least be support for a simple border template system. Such a system could let me define the basic outline, css, scripts, divs, etc and then nominate extention points, i.e. places in the template other systems can hook into and publish their content. HTML with some proprietry xml tags embedded could be transformed using XSLT into the project specific template format. Indeed, drivers could be provided to allow converstion to most popular templating systems.
Templating is a big issue with me, everyone has their own way of doing it. I do not agree with systems like Smarty that try to seperate the user from the structures of php in order to prevent them from embedding control logic in their templates. Of course, a developer shouldn’t be doing this, but this is a self-discipline issue, not a need to develop a non-standard scripting language on top of another, perfectly functional, scripting language.
The templating issue was overcome, if in a rather hacked manner, by reducing the templates of each project to the bare minimum, ie, no css, simple div structures, etc. A proxy-like service would then explode the head and body section and recombine it using a standard template. This could be seem as object-like inheritance of a standard template dom tree (similar to the concept of XUL overlays).
Although templating is an irritating issue, it is not quite as irritating as the authentication issue. Here we have three seperate projects, each with their own authentication system, and although some allow the easy application of your own code, quite why the community cannot make efforts to agree on a common authentication API, is beyond me.
PHP needs to be distributed with a set of APIs that cover these common problem areas. Additionally, if you want to include code from several projects into one, you NEED some form of namespacing standard. I would love to see some sort of PHP community standards effort that would lay down the law for such things. Projects built to these specifications would automagically behave well together and allow coders to get on with writing Cool Shit rather than hacking a project’s ludircrously over-complex templating system.
