One of the things that's always narked me when I'm making a moodle plugin is having to prefix my functions and classes with plugintype_pluginname_ to avoid potential name collisions with other plugins.
Given that PHP 5.3 has support for namespaces, which would eliminate this need while still avoiding collisions, and that Moodle 2.1 will require PHP 5.3, is it sensible to use namespaces in my plugins to avoid having to do this?
Potential problems that have occured to me include:
- Moodle might do something funky when including lib.php files that means namespaces will cause an issue
- There would need to be a standard namespace hierachy defined for plugins
- Some functions and classes (such as standard activity module functions) would still need to keep the current naming conventions.
Only 1 really applies to me since they're mainly in-house tools (although I'll be releasing them), and the plugins I'm thinking of don't rely on naming conventions for the functions like activities do.
Of course's there's also probably 4. A bunch of stuff I don't know about namespaces that makes this unfeasible