Class: I2CE ModuleFactory (Development)
This article describes the class I2CE_ModuleFactory .
- Location: Part of the module I2CE in the package I2CE 4.1-dev
- Source: Defined in the file lib/I2CE_ModuleFactory.php on line 36
Module Factory @todo Better Documentation
Variables
$instance
The singleton instance of this class.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 40
- Type: static protected I2CE_ModuleFactory $instance
$classCache
an array indexed by shortname of classes subclassing I2CE_Module
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 72
- Type: protected array $classCache
$path_categories
An array of path categories together with information if the priorities should be offeset from the postive or negative from 0. 1 indicates positive, -1 indicates negative. The more negative the quicker they get searched. If a category is not present, it defaults to -1.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 79
- Type: static protected $path_categories
$loadedPaths
protected @var loadedPaths -- an array of the paths that have been loaded
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 260
- Type: protected $loadedPaths
Methods
__construct()
Create a new instance of a report factory.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 56
- Signature: public function __construct()
callHooks()
Calls the specified module hooks with the specifed arguements @param string $hook the name of a hook @param mixed $arg1,$arg2,... The argument to pass to the methods. Defaults to null, meaning there is no argument.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 766
- Signature: static public function callHooks()
- Returns: an
array containing all the return values of each of the hooked methods.
checkForNewModules()
Finds newly available configuration files and stores them in the magic data.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 843
- Signature: public function checkForNewModules($modules)
- Parameters:
- mixed $modules
a string or array of strings: the shortnames of modules we wish to look for sub-modules. If null (default), we check all enabled modules.- Default Value: null
- mixed $modules
- Returns: array
of string the shortname of any modules we found (old and new)
checkLocalesUptoDate()
Checks to see if the locales for a given module are up to date
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1062
- Signature: public function checkLocalesUptoDate($shortname,$file)
- Parameters:
- Returns: booolean.
True if all is up to date.
disable()
Disable a module by its shortname. Not intended for casul use. WARNING -- does not remove any modules that this module depends on!!! @param string $shortname
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 599
- Signature: public function disable($shortnames)
- Parameters:
- $shortnames
enable()
Enable a module by its shortname. Takes care of loading paths etc. WARNING -- does not check to see if there are conflicts with enabled modules @param string $shortname
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 634
- Signature: public function enable($shortnames)
- Parameters:
- $shortnames
exists()
Check to see if this module exists
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1236
- Signature: public function exists($shortname)
- Parameters:
- string $shortname
- Returns: boolean @deprecated
getAvailable()
Gets a list of the available modules
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1205
- Signature: public function getAvailable()
- Returns: array
of string (the modules' shortnames)
getClass()
Gets the I2CE_Module object, if any, associated to this module.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 283
- Signature: public function getClass($shortname)
- Parameters:
- $shortname
- Returns: mixed.
string or null on failure.
getClassName()
Gets the class name of the I2CE_Module object, if any, associated to this module.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 265
- Signature: public function getClassName($shortname)
- Parameters:
- $shortname
- Returns: mixed.
string or null on failure.
getEnabled()
Gets a list of the enabled modules
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1193
- Signature: public function getEnabled()
- Returns: array
of string (the modules' shortnames)
getHooks()
Get the (callable) hooked methods associated to a hook.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 797
- Signature: public function getHooks($hook,$only_enabled)
- Parameters:
- Returns: array
indexed by integer of arrays with keys 'module' and 'method. The arrays are indexed by decreasing priority
getMethod()
Get the data for the fuzzy method
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 702
- Signature: public function getMethod($className,$method)
- Parameters:
- Returns: array
getMethods()
Gets the fuzzy methods associated to the class
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 682
- Signature: public function getMethods($className,$check_parent_class)
- Parameters:
- string $className @param $check_parentclass. Defaults to true. Check the parent classes for fuzzy methods
- $check_parent_class
- Default Value: true
- Returns: array
indexed by class names of arrays of fuzzy method names
getOutOfDateConfigFiles()
Checks the registered config files {@see addConfigFile() } to make sure that they have been initialized. If the modified time is more recent than the last access time, then it will re-initialize the files. It also checks all loaded config files for enabled modules/components to make sure that they are up-to-date in a simmiar way. @param mixed $module. A string or an arry of string of the modules to check. Othwerwise we check all enabled modules.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 868
- Signature: public function getOutOfDateConfigFiles($shortnames,$no_messages)
- Parameters:
- $shortnames
- Default Value: null
- $no_messages
- Default Value: true
- $shortnames
- Returns: array
with keys 'updates' and 'removals' and values arrays of string, the shortname of the relevant modules.
hasConfigData()
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1179
- Signature: public function hasConfigData($shortname)
- Parameters:
- $shortname
instance()
Return the instance of this factory and create it if it doesn't exist.
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 45
- Signature: static public function instance()
- Returns: I2CE_ModuleFactory
isAvailable()
Checks to see if a module is available
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1220
- Signature: public function isAvailable($shortname)
- Parameters:
- string $shortname
- Returns: boolean
isEnabled()
Checks to see if a module is enabled
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1144
- Signature: public function isEnabled($shortname)
- Parameters:
- string $shortname
- Returns: boolean
isInitialized()
Checks to see if a module is intialized. Returns true either 1) there is a class associated to the module and the aciton_initialize() method has been called succesfuuly 2) there is no class associated with the module but the config data has been processed
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 1160
- Signature: public function isInitialized($shortname)
- Parameters:
- string $shortname
- Returns: boolean
isUpToDate()
Checks to see if a module is up to date according to the given config file
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 997
- Signature: public function isUpToDate($shortname,$file)
- Parameters:
- Returns: boolean
isUpToDateModule()
Checks to see if a module is up to date according to its module file
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 962
- Signature: public function isUpToDateModule($shortname)
- Parameters:
- string $shortname
- Returns: boolean
loadPaths()
Loads the class path by the indicated shortnames
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 115
- Signature: public function loadPaths($shortnames,$category,$force,$fileSearch,$data)
- Parameters:
- mixed $shortnames
either a string, a shortname of a module, an array of shortnames, or null to indicate all enabled modules- Default Value: NULL
- mixed $category
A string or an array of strings of the categories to load. Defaults to null which means to load all paths.- Default Value: NULL
- boolean $force
Defaults to false. Load the class path even if the module is not enabled. @param I2CE_FileSearch A file search to use to store the module paths. If null(default) uses I2CE::getFileSearch() @param $data Defaults to null meaninging use the config data stored in I2CE::getConfig(). If non-null uses the given value for the config data. NOTE: This needs to be cleaned up!- Default Value: FALSE
- $fileSearch
- Default Value: NULL
- $data
- Default Value: NULL
- mixed $shortnames
removeClassPaths()
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 221
- Signature: public function removeClassPaths($shortnames)
- Parameters:
- $shortnames
- Default Value: null
- $shortnames
removeHooks()
Remove hooks associated to (a) module(s)
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 526
- Signature: public function removeHooks($shortnames)
- Parameters:
- mixed $shortnames
either a string, a shortname of a module, an array of shortnames, or null to indicate all enabled modules
- mixed $shortnames
resetStoredLoadedPaths()
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 88
- Signature: public function resetStoredLoadedPaths()
setModuleClassHash()
Sets the hashes for the class file for the given module(s)
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 455
- Signature: public function setModuleClassHash($modules,$strict)
- Parameters:
setModuleHash()
Sets the hashes for the class file for the given module(s)
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 489
- Signature: public function setModuleHash($modules)
- Parameters:
- mixed $modules
String or array if string
- mixed $modules
setStorage()
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 64
- Signature: public function setStorage()
updateHooks()
Loads/updates the hooks associated with an enabled module
- Defined in i2ce/lib/I2CE_ModuleFactory.php on line 308
- Signature: public function updateHooks($shortnames,$force,$checkAccessTime)
- Parameters:
- mixed $shortnames
either a string, a shortname of a module, an array of shortnames, or null to indicate all enabled modules- Default Value: null
- boolean $force
If true (defaults to false) then we update the hooks even if the module is not enabled- Default Value: false
- boolean $checkAccessTime
defaults to true which means that we only update the hooks if the last recorded access time (in magic data) for the module's config file is less than its last modified time.- Default Value: true
- mixed $shortnames