Implements interfaces:
The Module Manager
The module manager is one of the core features of phpSATk. Our module management features multiple module (called Overlays here ModuleOverlay) repositories. E.g. there may be a global overlay which provides basic modules, a per-user/per-host overlay for user-installed modules and another overlay per application. Depencies are supported as well as so called virtual-modules, that means modules providing the same functionality (e.g. different authentication backends).
For performance reasons the various common attributes are indexed using ModuleIndexer, so dont use findModule() and findModules() whenever possible.
Only one instance is legal so this class is implemented using a singleton pattern. Also an iterator is available, allowing you to easily traverse the different overlays. Internally the overlays are stored in a linked list. Error handling is done using ModuleException exceptions.
Located in /phpsatk-lib/core/15.module.db.php (line 49)
Singleton instance storage
Initializes the ModuleDB
This function is protected to prevent users from instanciating another ModuleDB
Adds a overlay to the list
- ModuleDB::getInstance()->addOverlay(new ModuleOverlay('/some/path'));
This function binds a real module to a virtual
This function is internally used by the configuration component.
If a user wants to use for example a specific authentication backend he is able to because he can bind e.g. a module named 'org.eenterphace.sat.auth.rdbms' to the virtual role 'auth.backend'.
Finds the module containting a specified class.
- // If the class 'foo' was contained in a module called 'bar'
- $module = ModuleDB::getInstance()->findClass('foo');
- // will return a ModuleItem for the module 'bar'
Finds the first matching module in all overlays
Overlays are searched through in the order of adding them.
Finds all modules matching the search condition
Gets a module based on its ID
Directly gets the first matching class for a given role
Directly gets the first matching module for a given role
Directly gets all matching module for a given role
Gets the key of the overlay the iterator is pointing to
In this case the path to the overlay is returned.
- foreach(ModuleDB::getInstance() as $path => $overlay) {
- echo "Found Overlay at $path\n";
- }
Moves the iterator pointer to the next overlay
Rewinds the iterator pointer to the first added overlay
Iterator function
This function is interally used by PHP to determine when the iterator is at the end.
Documentation generated on Mon, 21 May 2007 10:34:36 +0200 by phpDocumentor 1.3.0RC5