Splitting the administration module is the part that I dont like. I removed RegisterModule(), UnregisterModule(), and ExtractFunctions() and placed them in a new file, modules.php, which isnt associated with any specific module (like my database and session manager classes). Each module returns the name of the function that will go in the new Function field of the regitration database and I will guarantee that the first time a module is included during its registration is in RegisterModule(). RegisterModule() is the only function that cares about the return value which is why I need to make the guarantee. I dont like that I still rely on the module returning this function no do I like even storing a name of a function that will return the interface functions to the module. Finally, I dont like that RegisterModule(), UnregisterModule(), and ExtractFunctions() are not in the main admin module even though they are the main admin functions.
I wish that PHP had packages or namespaces and that I could use the reflection API to get a list of classes contained within that package. If I had that then my solution would be this:
I would create a module interface, IModule, that all modules would be required to implement. I would then load the package and use reflection to find the class within the module that implements IModule. The end.
I guess the closest thing to that would be to require each module PHP file to contain a single class whose name followed a strict set of rules so that you could use ReflectionClass on that class. That class would contain a subclass that implemented IModule and that subclass would be your interface.
I'm using PHP 4 so I cant do that either. [crying]