MediaWiki
REL1_22
|
This class holds a list of modules and handles instantiation. More...
Public Member Functions | |
__construct (ApiBase $parentModule) | |
Construct new module manager. | |
addModule ($name, $group, $class) | |
Add or overwrite a module in this ApiMain instance. | |
addModules (array $modules, $group) | |
Add a list of modules to the manager. | |
getGroups () | |
Get a list of groups this manager contains. | |
getModule ($moduleName, $group=null, $ignoreCache=false) | |
Get module instance by name, or instantiate it if it does not exist. | |
getModuleGroup ($moduleName) | |
Returns the group name for the given module. | |
getNames ($group=null) | |
Get an array of modules in a specific group or all if no group is set. | |
getNamesWithClasses ($group=null) | |
Create an array of (moduleName => moduleClass) for a specific group or for all. | |
isDefined ($moduleName, $group=null) | |
Returns true if the specific module is defined at all or in a specific group. | |
Private Attributes | |
$mGroups = array() | |
$mInstances = array() | |
$mModules = array() | |
$mParent |
This class holds a list of modules and handles instantiation.
Definition at line 34 of file ApiModuleManager.php.
ApiModuleManager::__construct | ( | ApiBase $ | parentModule | ) |
Construct new module manager.
ApiBase | $parentModule | Parent module instance will be used during instantiation |
Definition at line 45 of file ApiModuleManager.php.
ApiModuleManager::addModule | ( | $ | name, |
$ | group, | ||
$ | class | ||
) |
Add or overwrite a module in this ApiMain instance.
Intended for use by extending classes who wish to add their own modules to their lexicon or override the behavior of inherent ones.
string | $group | Name of the module group |
string | $name | The identifier for this module. |
string | $class | The class where this module is implemented. |
Definition at line 69 of file ApiModuleManager.php.
References $name, and array().
Referenced by addModules().
ApiModuleManager::addModules | ( | array $ | modules, |
$ | group | ||
) |
Add a list of modules to the manager.
array | $modules | A map of ModuleName => ModuleClass |
string | $group | Which group modules belong to (action,format,...) |
Definition at line 54 of file ApiModuleManager.php.
References $name, addModule(), and as.
Get a list of groups this manager contains.
Definition at line 168 of file ApiModuleManager.php.
ApiModuleManager::getModule | ( | $ | moduleName, |
$ | group = null , |
||
$ | ignoreCache = false |
||
) |
Get module instance by name, or instantiate it if it does not exist.
string | $moduleName | module name |
string | $group | optionally validate that the module is in a specific group |
bool | $ignoreCache | if true, force-creates a new instance and does not cache it |
Definition at line 81 of file ApiModuleManager.php.
ApiModuleManager::getModuleGroup | ( | $ | moduleName | ) |
Returns the group name for the given module.
string | $moduleName |
Definition at line 156 of file ApiModuleManager.php.
ApiModuleManager::getNames | ( | $ | group = null | ) |
ApiModuleManager::getNamesWithClasses | ( | $ | group = null | ) |
ApiModuleManager::isDefined | ( | $ | moduleName, |
$ | group = null |
||
) |
Returns true if the specific module is defined at all or in a specific group.
string | $moduleName | module name |
string | $group | group name to check against, or null to check all groups, |
Definition at line 143 of file ApiModuleManager.php.
ApiModuleManager::$mGroups = array() [private] |
Definition at line 38 of file ApiModuleManager.php.
ApiModuleManager::$mInstances = array() [private] |
Definition at line 37 of file ApiModuleManager.php.
ApiModuleManager::$mModules = array() [private] |
Definition at line 39 of file ApiModuleManager.php.
ApiModuleManager::$mParent [private] |
Definition at line 36 of file ApiModuleManager.php.