I have a working patch for adding some basic namespace support into sapphire. Currently it only supports namespaced classes, though adding it for interfaces will be a very minor adaption to the class code. I just wanted to get some testing in before I started duplicating code.
It currently supports only one namespace in a file, using the namespace name; format (not namespace name { code }). You can use namespaced classes anywhere you would use ones in the global space, so long as you provide the correct path. This includes DataObject::get() calls and Director rules.
Controllers will fall back to the namespace-less class name when looking for templates.
I have not tested this with PHP <5.3 yet, nor have I tested the CMS (the project I want namespaces for doesn't use it).
I am thinking of replacing the \ in class names when looking for template files (Windows probably wont like them) and in table names (MySQL seems to handle the \ fine, but others may not) with some other character. Something like a plus or hyphen (can't use an underscore as there could be naming conflicts).
The current state of the patch is available at http://s.geek.nz/A
---
Simon Welsh
Admin of http://simon.geek.nz/
Who said Microsoft never created a bug-free program? The blue screen never, ever crashes!