The AutoLoader
as of: February 14, 2013
The AutoLoader is the backbone of the POS module system.
It's responsible for discovering and including all the
available modules. There are a few things to be aware of
when interacting with this system:
- The name of your module's class must match the file's name. If
you create a class named MyNewModule it needs to go in a file named
MyNewModule.php. The AutoLoader will not find the module correctly
if the class and file names do not correspond.
- Modules are identified via inheritence. If your module's class does not
extend one of the base module AutoLoader won't find it.
- Modules located inside plugins are only loaded if that plugin is enabled.
- AutoLoader::ListModules($base_class) will return a list of all modules that
implement a specified base class. This list is ordered such that all
plugin-provided modules are at the front of the list before any of the modules
that are included by default. Plugins can often use this fact to override
default behavior.