Class: I2CE Configurator: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 2: Line 2:
*Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]].
*Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]].
*Location: Part of the module [[I2CE Module List#I2CE|I2CE]] in the package [https://launchpad.net/i2ce I2CE]
*Location: Part of the module [[I2CE Module List#I2CE|I2CE]] in the package [https://launchpad.net/i2ce I2CE]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.1-release/annotate/head:/lib/I2CE_Configurator.php lib/I2CE_Configurator.php]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L40 lib/I2CE_Configurator.php] on line 40
==Variables==
==Variables==
===$mod_path===
===$mod_path===
Hack to store the paths to each config
Hack to store the paths to each config
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L53 i2ce/lib/I2CE_Configurator.php] on line 53
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $mod_path
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $mod_path


===$top_module===
===$top_module===
An associative array linking directory to top-level module
An associative array linking directory to top-level module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L59 i2ce/lib/I2CE_Configurator.php] on line 59
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $top_module
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $top_module


===$checked_paths===
===$checked_paths===
A list of the paths checked
A list of the paths checked
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L65 i2ce/lib/I2CE_Configurator.php] on line 65
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $checked_paths
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $checked_paths


===$found_modules===
===$found_modules===
Holds a list of found modules @var private array $found_module
Holds a list of found modules @var private array $found_module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L71 i2ce/lib/I2CE_Configurator.php] on line 71
*Type: private $found_modules
*Type: private $found_modules


===$errors===
===$errors===
Errors encountered
Errors encountered
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L76 i2ce/lib/I2CE_Configurator.php] on line 76
*Type: private [http://www.php.net/manual/en/language.types.string.php string ] $errors
*Type: private [http://www.php.net/manual/en/language.types.string.php string ] $errors


===$file_list===
===$file_list===
list of files for each module
list of files for each module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L81 i2ce/lib/I2CE_Configurator.php] on line 81
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $file_list
*Type: private [http://www.php.net/manual/en/language.types.array.php array ] $file_list


===$storage===
===$storage===
Where we are saving all configuration data
Where we are saving all configuration data
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L87 i2ce/lib/I2CE_Configurator.php] on line 87
*Type: protected [[Class: I2CE_MagicData | I2CE_MagicData]] $storage
*Type: protected [[Class: I2CE_MagicData | I2CE_MagicData]] $storage


===$template===
===$template===
the current template we are working with ;
the current template we are working with ;
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L93 i2ce/lib/I2CE_Configurator.php] on line 93
*Type: protected [[Class: I2CE_MagicDataTemplate | I2CE_MagicDataTemplate]] $template
*Type: protected [[Class: I2CE_MagicDataTemplate | I2CE_MagicDataTemplate]] $template


===$merges===
===$merges===
$var protected array $merges.  Keys are magic data paths, values are merge type
$var protected array $merges.  Keys are magic data paths, values are merge type
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L99 i2ce/lib/I2CE_Configurator.php] on line 99
*Type: protected $merges
*Type: protected $merges


===$locales===
===$locales===
The locales for which we check for config files.
The locales for which we check for config files.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L104 i2ce/lib/I2CE_Configurator.php] on line 104
*Type: protected $locales
*Type: protected $locales


===$hash===
===$hash===
.  The hash of the last config file processed.  It is a string, the hash, if the last config file loaded successully.  false if the last config file did not load succesully.  null if there was never a config file processed.
.  The hash of the last config file processed.  It is a string, the hash, if the last config file loaded successully.  false if the last config file did not load succesully.  null if there was never a config file processed.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L113 i2ce/lib/I2CE_Configurator.php] on line 113
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $hash
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $hash


Line 51: Line 62:
===__construct()===
===__construct()===
Constructor
Constructor
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L124 i2ce/lib/I2CE_Configurator.php] on line 124
*Signature: public function __construct($storage,$set_last_access)
*Signature: public function __construct($storage,$set_last_access)
*Parameters:
*Parameters:
Line 58: Line 70:
***Default Value: true
***Default Value: true
===__destruct()===
===__destruct()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L142 i2ce/lib/I2CE_Configurator.php] on line 142
*Signature: public function __destruct()
*Signature: public function __destruct()
===checkForConflicts()===
===checkForConflicts()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L960 i2ce/lib/I2CE_Configurator.php] on line 960
*Signature: protected function checkForConflicts($requirements,$enabled_modules)
*Signature: protected function checkForConflicts($requirements,$enabled_modules)
*Parameters:
*Parameters:
Line 66: Line 80:
===checkRequirements()===
===checkRequirements()===
Checks the requirements.  if all requirements are met and there are no conflicts, it returns a list of those that need to be installed, an empty array() if none are needed. On failure returns null. @param array $shortnames an array of shortnames @param array $remove an array of potential shortnames to remove -- if we did not find them somplace else. (it may have just been moved) defaults to an empty array.
Checks the requirements.  if all requirements are met and there are no conflicts, it returns a list of those that need to be installed, an empty array() if none are needed. On failure returns null. @param array $shortnames an array of shortnames @param array $remove an array of potential shortnames to remove -- if we did not find them somplace else. (it may have just been moved) defaults to an empty array.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L743 i2ce/lib/I2CE_Configurator.php] on line 743
*Signature: public function checkRequirements($updates,$disables,$removals,$enabled_modules,$required_modules)
*Signature: public function checkRequirements($updates,$disables,$removals,$enabled_modules,$required_modules)
*Parameters:
*Parameters:
Line 80: Line 95:
===extRequirements()===
===extRequirements()===
Get a list of External dependencies for the module
Get a list of External dependencies for the module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1356 i2ce/lib/I2CE_Configurator.php] on line 1356
*Signature: public function extRequirements($module)
*Signature: public function extRequirements($module)
*Parameters:
*Parameters:
Line 86: Line 102:
===findAvailableConfigs()===
===findAvailableConfigs()===
Searches the system for available configuration files (if not done already) and stores them in the given I2CE_MagicData @param I2CE_FileSearch A file search to use for modules. If null(default) uses I2CE::getFileSearch()
Searches the system for available configuration files (if not done already) and stores them in the given I2CE_MagicData @param I2CE_FileSearch A file search to use for modules. If null(default) uses I2CE::getFileSearch()
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L610 i2ce/lib/I2CE_Configurator.php] on line 610
*Signature: public function findAvailableConfigs($file_search,$deep,$extensions,$limit_to_subdir,$verbose_errors)
*Signature: public function findAvailableConfigs($file_search,$deep,$extensions,$limit_to_subdir,$verbose_errors)
*Parameters:
*Parameters:
Line 101: Line 118:
===findPotentialConfigs()===
===findPotentialConfigs()===
Return a list of potential configuration files.  "Potential config files" are those whose extension matches the regular expression. @param array @returns
Return a list of potential configuration files.  "Potential config files" are those whose extension matches the regular expression. @param array @returns
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L572 i2ce/lib/I2CE_Configurator.php] on line 572
*Signature: private function findPotentialConfigs($extensions,$file_search)
*Signature: private function findPotentialConfigs($extensions,$file_search)
*Parameters:
*Parameters:
Line 106: Line 124:
**$file_search  
**$file_search  
===flattenRequirements()===
===flattenRequirements()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L680 i2ce/lib/I2CE_Configurator.php] on line 680
*Signature: protected function flattenRequirements($requirementDOM)
*Signature: protected function flattenRequirements($requirementDOM)
*Parameters:
*Parameters:
Line 111: Line 130:
===getAvailableModules()===
===getAvailableModules()===
Scan a directory for available modules.
Scan a directory for available modules.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1718 i2ce/lib/I2CE_Configurator.php] on line 1718
*Signature: public function getAvailableModules($search_dirs,$limit_search,$rescan,$verbose)
*Signature: public function getAvailableModules($search_dirs,$limit_search,$rescan,$verbose)
*Parameters:
*Parameters:
Line 123: Line 143:
===getConflicts()===
===getConflicts()===
For a given module, find a list of conflicting modules.
For a given module, find a list of conflicting modules.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1415 i2ce/lib/I2CE_Configurator.php] on line 1415
*Signature: private function getConflicts($module)
*Signature: private function getConflicts($module)
*Parameters:
*Parameters:
Line 128: Line 149:
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>List of conflicts
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>List of conflicts
===getDefaultExtensions()===
===getDefaultExtensions()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L543 i2ce/lib/I2CE_Configurator.php] on line 543
*Signature: private function getDefaultExtensions()
*Signature: private function getDefaultExtensions()
===getDependencyList()===
===getDependencyList()===
Gets information about the dependecies for a module
Gets information about the dependecies for a module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1229 i2ce/lib/I2CE_Configurator.php] on line 1229
*Signature: public function getDependencyList($module)
*Signature: public function getDependencyList($module)
*Parameters:
*Parameters:
Line 137: Line 160:
===getDependsList()===
===getDependsList()===
Gets the list of modules depending on the specified module.
Gets the list of modules depending on the specified module.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1191 i2ce/lib/I2CE_Configurator.php] on line 1191
*Signature: public function getDependsList($shortname)
*Signature: public function getDependsList($shortname)
*Parameters:
*Parameters:
Line 142: Line 166:
===getDescription()===
===getDescription()===
Returns a brief one-line description of the module.
Returns a brief one-line description of the module.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1537 i2ce/lib/I2CE_Configurator.php] on line 1537
*Signature: public function getDescription($module)
*Signature: public function getDescription($module)
*Parameters:
*Parameters:
Line 148: Line 173:
===getEnabled()===
===getEnabled()===
Get enabled sub-modules
Get enabled sub-modules
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1324 i2ce/lib/I2CE_Configurator.php] on line 1324
*Signature: private function getEnabled($module)
*Signature: private function getEnabled($module)
*Parameters:
*Parameters:
Line 154: Line 180:
===getHash()===
===getHash()===
Get the hash of the contents of the last processConfifFile.
Get the hash of the contents of the last processConfifFile.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L191 i2ce/lib/I2CE_Configurator.php] on line 191
*Signature: public function getHash()
*Signature: public function getHash()
*Returns: mixed.<br/>String, the hash, if the last config file loaded successfully.  false if the last config file did not load succesully.  null if there was never a config file processed.
*Returns: mixed.<br/>String, the hash, if the last config file loaded successfully.  false if the last config file did not load succesully.  null if there was never a config file processed.
===getI2CERoot()===
===getI2CERoot()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1294 i2ce/lib/I2CE_Configurator.php] on line 1294
*Signature: public function getI2CERoot()
*Signature: public function getI2CERoot()
===getLongDescription()===
===getLongDescription()===
Returns a longer description of the module.
Returns a longer description of the module.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1546 i2ce/lib/I2CE_Configurator.php] on line 1546
*Signature: public function getLongDescription($module)
*Signature: public function getLongDescription($module)
*Parameters:
*Parameters:
Line 165: Line 194:
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getMaxChildOrder()===
===getMaxChildOrder()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1172 i2ce/lib/I2CE_Configurator.php] on line 1172
*Signature: protected function getMaxChildOrder($node,$xpath)
*Signature: protected function getMaxChildOrder($node,$xpath)
*Parameters:
*Parameters:
Line 171: Line 201:
===getMerges()===
===getMerges()===
Get the magic data paths whose status we are tracking. $retrurns array.  Keys are magic data paths, values are the merge type
Get the magic data paths whose status we are tracking. $retrurns array.  Keys are magic data paths, values are the merge type
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L517 i2ce/lib/I2CE_Configurator.php] on line 517
*Signature: public function getMerges()
*Signature: public function getMerges()
===getModuleDir()===
===getModuleDir()===
Return the directory of the module
Return the directory of the module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1305 i2ce/lib/I2CE_Configurator.php] on line 1305
*Signature: public function getModuleDir($module)
*Signature: public function getModuleDir($module)
*Parameters:
*Parameters:
Line 181: Line 213:
===getModuleFileList()===
===getModuleFileList()===
Get a list of files for a given module
Get a list of files for a given module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1694 i2ce/lib/I2CE_Configurator.php] on line 1694
*Signature: public function getModuleFileList($module)
*Signature: public function getModuleFileList($module)
*Parameters:
*Parameters:
Line 187: Line 220:
===getModuleFileMap()===
===getModuleFileMap()===
Get a list of each files under each path.
Get a list of each files under each path.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1623 i2ce/lib/I2CE_Configurator.php] on line 1623
*Signature: public function getModuleFileMap($module)
*Signature: public function getModuleFileMap($module)
*Parameters:
*Parameters:
Line 193: Line 227:
===getModulePath()===
===getModulePath()===
Return the path to the module configuration file
Return the path to the module configuration file
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1286 i2ce/lib/I2CE_Configurator.php] on line 1286
*Signature: public function getModulePath($module)
*Signature: public function getModulePath($module)
*Parameters:
*Parameters:
Line 198: Line 233:
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>Path to config file.
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>Path to config file.
===getModulePathList()===
===getModulePathList()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1605 i2ce/lib/I2CE_Configurator.php] on line 1605
*Signature: public function getModulePathList($module)
*Signature: public function getModulePathList($module)
*Parameters:
*Parameters:
**$module  
**$module  
===getNextUnchecked()===
===getNextUnchecked()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1004 i2ce/lib/I2CE_Configurator.php] on line 1004
*Signature: protected function getNextUnchecked($requirementDOM)
*Signature: protected function getNextUnchecked($requirementDOM)
*Parameters:
*Parameters:
Line 207: Line 244:
===getPackageAuthors()===
===getPackageAuthors()===
Returns a longer description of the module.
Returns a longer description of the module.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1564 i2ce/lib/I2CE_Configurator.php] on line 1564
*Signature: public function getPackageAuthors($module)
*Signature: public function getPackageAuthors($module)
*Parameters:
*Parameters:
Line 213: Line 251:
===getRequirements()===
===getRequirements()===
Get a list of requirements for the module
Get a list of requirements for the module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1372 i2ce/lib/I2CE_Configurator.php] on line 1372
*Signature: private function getRequirements($module)
*Signature: private function getRequirements($module)
*Parameters:
*Parameters:
Line 219: Line 258:
===getRoot()===
===getRoot()===
Get the root of where this I2CE instance started.
Get the root of where this I2CE instance started.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1259 i2ce/lib/I2CE_Configurator.php] on line 1259
*Signature: public function getRoot()
*Signature: public function getRoot()
*Returns: the<br/>fully resolved path to the starting directory
*Returns: the<br/>fully resolved path to the starting directory
===getStorage()===
===getStorage()===
Get the magic data node storage for the configurator
Get the magic data node storage for the configurator
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L46 i2ce/lib/I2CE_Configurator.php] on line 46
*Signature: public function getStorage()
*Signature: public function getStorage()
*Returns: [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]]
*Returns: [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]]
===getTopModule()===
===getTopModule()===
Find the top-level module in a directory.  (e.g. I2CE, ihris-common, ihris-manage)
Find the top-level module in a directory.  (e.g. I2CE, ihris-common, ihris-manage)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1586 i2ce/lib/I2CE_Configurator.php] on line 1586
*Signature: public function getTopModule($d,$verbose)
*Signature: public function getTopModule($d,$verbose)
*Parameters:
*Parameters:
Line 234: Line 276:
===getVersion()===
===getVersion()===
Return the version for a given module
Return the version for a given module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1525 i2ce/lib/I2CE_Configurator.php] on line 1525
*Signature: public function getVersion($module)
*Signature: public function getVersion($module)
*Parameters:
*Parameters:
Line 239: Line 282:
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===importLocalizedTemplates()===
===importLocalizedTemplates()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L351 i2ce/lib/I2CE_Configurator.php] on line 351
*Signature: public function importLocalizedTemplates($localized)
*Signature: public function importLocalizedTemplates($localized)
*Parameters:
*Parameters:
Line 245: Line 289:
===isReq()===
===isReq()===
Determine if this object is a I2CE_MagicDataNode that can be used as a requirement. @param mixed $string
Determine if this object is a I2CE_MagicDataNode that can be used as a requirement. @param mixed $string
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1214 i2ce/lib/I2CE_Configurator.php] on line 1214
*Signature: private function isReq($req)
*Signature: private function isReq($req)
*Parameters:
*Parameters:
Line 251: Line 296:
===loadConfigFile()===
===loadConfigFile()===
Load a config file with various extensions.
Load a config file with various extensions.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L170 i2ce/lib/I2CE_Configurator.php] on line 170
*Signature: protected function loadConfigFile($file,$verbose_errors)
*Signature: protected function loadConfigFile($file,$verbose_errors)
*Parameters:
*Parameters:
Line 259: Line 305:
===moduleConflicts()===
===moduleConflicts()===
Checks to see if a module conflicts with  by another module
Checks to see if a module conflicts with  by another module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1514 i2ce/lib/I2CE_Configurator.php] on line 1514
*Signature: public function moduleConflicts($module,$version,$conflicts,$deep)
*Signature: public function moduleConflicts($module,$version,$conflicts,$deep)
*Parameters:
*Parameters:
Line 269: Line 316:
===moduleRequires()===
===moduleRequires()===
Checks to see if a module is required by another module
Checks to see if a module is required by another module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1453 i2ce/lib/I2CE_Configurator.php] on line 1453
*Signature: public function moduleRequires($module,$version,$requirements,$deep,$cat)
*Signature: public function moduleRequires($module,$version,$requirements,$deep,$cat)
*Parameters:
*Parameters:
Line 280: Line 328:
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===processConfig()===
===processConfig()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L436 i2ce/lib/I2CE_Configurator.php] on line 436
*Signature: public function processConfig($process_configuration,$verbose_errors,$process_meta,$localized)
*Signature: public function processConfig($process_configuration,$verbose_errors,$process_meta,$localized)
*Parameters:
*Parameters:
Line 292: Line 341:
===processConfigFile()===
===processConfigFile()===
Loads in a config file and validates it against its referenced DTD.  Sets the access time and the shortname (provided in the metadata) for the file.  If there is already a config file with the same shortname, it will remove that fro the list of the config files.  Save all the configuration metadata under $storage->$shortname where $shortname is the shortname provided for by the config file.
Loads in a config file and validates it against its referenced DTD.  Sets the access time and the shortname (provided in the metadata) for the file.  If there is already a config file with the same shortname, it will remove that fro the list of the config files.  Save all the configuration metadata under $storage->$shortname where $shortname is the shortname provided for by the config file.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L224 i2ce/lib/I2CE_Configurator.php] on line 224
*Signature: public function processConfigFile($file,$process_configuration,$verbose_errors,$process_meta,$localized)
*Signature: public function processConfigFile($file,$process_configuration,$verbose_errors,$process_meta,$localized)
*Parameters:
*Parameters:
Line 306: Line 356:
===processRequirementsDOM()===
===processRequirementsDOM()===
@param boolean $options. Defaults to false.  Set to true if the new requests are optional i.e. don't cause a fatal error/add to the DOM if there a conflict
@param boolean $options. Defaults to false.  Set to true if the new requests are optional i.e. don't cause a fatal error/add to the DOM if there a conflict
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1046 i2ce/lib/I2CE_Configurator.php] on line 1046
*Signature: public function processRequirementsDOM($new_requests,$requests,$optional)
*Signature: public function processRequirementsDOM($new_requests,$requests,$optional)
*Parameters:
*Parameters:
Line 314: Line 365:
*Returns: an<br/>array of the new modules that were installed on sucess. A string on failure describing the failure reason.
*Returns: an<br/>array of the new modules that were installed on sucess. A string on failure describing the failure reason.
===recursiveScan()===
===recursiveScan()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L634 i2ce/lib/I2CE_Configurator.php] on line 634
*Signature: private function recursiveScan($shortnames,$extensions,$limit_to_subdir,$verbose)
*Signature: private function recursiveScan($shortnames,$extensions,$limit_to_subdir,$verbose)
*Parameters:
*Parameters:
Line 322: Line 374:
===requirements()===
===requirements()===
Get a list of requirement objects for the module
Get a list of requirement objects for the module
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1340 i2ce/lib/I2CE_Configurator.php] on line 1340
*Signature: public function requirements($module)
*Signature: public function requirements($module)
*Parameters:
*Parameters:
Line 327: Line 380:
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>List of requirement objects
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>List of requirement objects
===resetCheckedPaths()===
===resetCheckedPaths()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L706 i2ce/lib/I2CE_Configurator.php] on line 706
*Signature: public function resetCheckedPaths()
*Signature: public function resetCheckedPaths()
===resetMerges()===
===resetMerges()===
Reset the tracked data.
Reset the tracked data.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L523 i2ce/lib/I2CE_Configurator.php] on line 523
*Signature: public function resetMerges()
*Signature: public function resetMerges()
===setLocales()===
===setLocales()===
Set the locales used when handingling the processing of config data.
Set the locales used when handingling the processing of config data.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L152 i2ce/lib/I2CE_Configurator.php] on line 152
*Signature: public function setLocales($locales)
*Signature: public function setLocales($locales)
*Parameters:
*Parameters:
Line 338: Line 394:
===setModulePath()===
===setModulePath()===
Set the module's path, usually used for testing.
Set the module's path, usually used for testing.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1269 i2ce/lib/I2CE_Configurator.php] on line 1269
*Signature: public function setModulePath($module,$path)
*Signature: public function setModulePath($module,$path)
*Parameters:
*Parameters:
Line 344: Line 401:
===setRoot()===
===setRoot()===
Set the root of where this I2CE instance started.
Set the root of where this I2CE instance started.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1246 i2ce/lib/I2CE_Configurator.php] on line 1246
*Signature: public function setRoot($dir)
*Signature: public function setRoot($dir)
*Parameters:
*Parameters:
Line 351: Line 409:
===setTopModule()===
===setTopModule()===
Set the top level module for a directory.
Set the top level module for a directory.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L1572 i2ce/lib/I2CE_Configurator.php] on line 1572
*Signature: public function setTopModule($dir,$module)
*Signature: public function setTopModule($dir,$module)
*Parameters:
*Parameters:
Line 356: Line 415:
**$module  
**$module  
===setupFileSearch()===
===setupFileSearch()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L527 i2ce/lib/I2CE_Configurator.php] on line 527
*Signature: private function setupFileSearch($mod,$path)
*Signature: private function setupFileSearch($mod,$path)
*Parameters:
*Parameters:
Line 363: Line 423:
***Default Value: "MODULES"
***Default Value: "MODULES"
===shallowScan()===
===shallowScan()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/lib/I2CE_Configurator.php#L656 i2ce/lib/I2CE_Configurator.php] on line 656
*Signature: private function shallowScan($potential_configs,$verbose)
*Signature: private function shallowScan($potential_configs,$verbose)
*Parameters:
*Parameters:

Revision as of 09:48, 10 November 2009

This article describes the class I2CE_Configurator.

Variables

$mod_path

Hack to store the paths to each config

$top_module

An associative array linking directory to top-level module

$checked_paths

A list of the paths checked

$found_modules

Holds a list of found modules @var private array $found_module

$errors

Errors encountered

$file_list

list of files for each module

$storage

Where we are saving all configuration data

$template

the current template we are working with ;

$merges

$var protected array $merges. Keys are magic data paths, values are merge type

$locales

The locales for which we check for config files.

$hash

. The hash of the last config file processed. It is a string, the hash, if the last config file loaded successully. false if the last config file did not load succesully. null if there was never a config file processed.

Methods

__construct()

Constructor

  • Defined in i2ce/lib/I2CE_Configurator.php on line 124
  • Signature: public function __construct($storage,$set_last_access)
  • Parameters:
    • I2CE_MagicData $storage
      if none is passed in, then a simple MagicData and config storage object using MagicDataStorageMem will be set up.
      • Default Value: null
    • boolean $set_last_access
      • Default Value: true

__destruct()

checkForConflicts()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 960
  • Signature: protected function checkForConflicts($requirements,$enabled_modules)
  • Parameters:
    • $requirements
    • $enabled_modules

checkRequirements()

Checks the requirements. if all requirements are met and there are no conflicts, it returns a list of those that need to be installed, an empty array() if none are needed. On failure returns null. @param array $shortnames an array of shortnames @param array $remove an array of potential shortnames to remove -- if we did not find them somplace else. (it may have just been moved) defaults to an empty array.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 743
  • Signature: public function checkRequirements($updates,$disables,$removals,$enabled_modules,$required_modules)
  • Parameters:
    • $updates
    • mixed $disables
      a shortname or an array of shortnames of modules to disable. Defaults to empty array
      • Default Value: array()
    • $removals
      • Default Value: array()
    • array $enabled_modules
      An array of shortnames of enabled modules -- we check for conflicts against this array
      • Default Value: array()
    • mixed $required_modules
      A shortname or an array of shortnames of required modules -- if a module is set to be updated and it is not required by on of the modules in this array, it will be set as an optional modules. Defaults to the empty array
      • Default Value: array()
  • Returns: array.
    Keys are: 'failure' - string with the reason for failture 'requirements' - array which has as keys shortnames and values files for the requirements. 'removals' - array of shortnames that need to be removed. 'optional' - array with key shortnames and value true 'moved' - array with key shortnames and value true

extRequirements()

Get a list of External dependencies for the module

findAvailableConfigs()

Searches the system for available configuration files (if not done already) and stores them in the given I2CE_MagicData @param I2CE_FileSearch A file search to use for modules. If null(default) uses I2CE::getFileSearch()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 610
  • Signature: public function findAvailableConfigs($file_search,$deep,$extensions,$limit_to_subdir,$verbose_errors)
  • Parameters:
    • $file_search
      • Default Value: null
    • boolean $deep
      Defaults to false. If false, only checks the module paths of the currently enabled modules. If true, checks the module paths of all modules which are either enabled or disabled.
      • Default Value: false
    • array $extensions
      An array containing file extensions which we wish to test if they are a config file. Defaults to the empty array in which case we look for files with the 'xml' extension and any additional extensions registered under I2CE::getConfig()->config->additional_configuration_extensions
      • Default Value: array()
    • string $limit_to_subdir
      If $file_search is given and this is set, we only add in the directories which are subdirectorues of $limit_to_subdir (check is by string comparision)
      • Default Value:
    • $verbose_errors
      • Default Value: false
  • Returns: array
    of string the list of shortnames found

findPotentialConfigs()

Return a list of potential configuration files. "Potential config files" are those whose extension matches the regular expression. @param array @returns

  • Defined in i2ce/lib/I2CE_Configurator.php on line 572
  • Signature: private function findPotentialConfigs($extensions,$file_search)
  • Parameters:
    • $extensions
    • $file_search

flattenRequirements()

getAvailableModules()

Scan a directory for available modules.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1718
  • Signature: public function getAvailableModules($search_dirs,$limit_search,$rescan,$verbose)
  • Parameters:
    • array $search_dirs
      List of Directories to search
    • boolean $limit_search
      Don't scan by depth (true)
      • Default Value: true
    • boolean $rescan
      Whether to force a rescan (false)
      • Default Value: false
    • boolean $verbose
      Verbose errors (false)
      • Default Value: false
  • Returns: array
    List of modules found

getConflicts()

For a given module, find a list of conflicting modules.

getDefaultExtensions()

getDependencyList()

Gets information about the dependecies for a module

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1229
  • Signature: public function getDependencyList($module)
  • Parameters:
  • Returns: array
    indexed by 'requirements', 'conflicts' 'enable', 'path', and 'badness' where 'badness' is an array of strings of error messages and the other are arrays of shortnames

getDependsList()

Gets the list of modules depending on the specified module.

getDescription()

Returns a brief one-line description of the module.

getEnabled()

Get enabled sub-modules

getHash()

Get the hash of the contents of the last processConfifFile.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 191
  • Signature: public function getHash()
  • Returns: mixed.
    String, the hash, if the last config file loaded successfully. false if the last config file did not load succesully. null if there was never a config file processed.

getI2CERoot()

getLongDescription()

Returns a longer description of the module.

getMaxChildOrder()

getMerges()

Get the magic data paths whose status we are tracking. $retrurns array. Keys are magic data paths, values are the merge type

getModuleDir()

Return the directory of the module

getModuleFileList()

Get a list of files for a given module

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1694
  • Signature: public function getModuleFileList($module)
  • Parameters:
  • Returns: array
    List of files in the module. Paths are relative to the directory where the module's configuration file is.

getModuleFileMap()

Get a list of each files under each path.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1623
  • Signature: public function getModuleFileMap($module)
  • Parameters:
  • Returns: array
    List of file maps in the module. Paths are relative to the directory where the module's configuration file is. @todo Contains a hack for the special case where CLASSES directory is ./

getModulePath()

Return the path to the module configuration file

getModulePathList()

getNextUnchecked()

getPackageAuthors()

Returns a longer description of the module.

getRequirements()

Get a list of requirements for the module

getRoot()

Get the root of where this I2CE instance started.

getStorage()

Get the magic data node storage for the configurator

getTopModule()

Find the top-level module in a directory. (e.g. I2CE, ihris-common, ihris-manage)

getVersion()

Return the version for a given module

importLocalizedTemplates()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 351
  • Signature: public function importLocalizedTemplates($localized)
  • Parameters:
    • $localized
      • Default Value: array()

isReq()

Determine if this object is a I2CE_MagicDataNode that can be used as a requirement. @param mixed $string

loadConfigFile()

Load a config file with various extensions.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 170
  • Signature: protected function loadConfigFile($file,$verbose_errors)
  • Parameters:
    • string $file
      Path to the config file
    • boolean $verbose_errors
      (true)
      • Default Value: true
  • Returns: booolean
    true on success

moduleConflicts()

Checks to see if a module conflicts with by another module

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1514
  • Signature: public function moduleConflicts($module,$version,$conflicts,$deep)
  • Parameters:
    • string $module
      Module to check
    • string $version
      Version of the module
    • mixed $conflicts
      Module name or an array of module names
    • boolean $deep
      Whether to recursively check the requirements (true)
      • Default Value: true
  • Returns: boolean

moduleRequires()

Checks to see if a module is required by another module

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1453
  • Signature: public function moduleRequires($module,$version,$requirements,$deep,$cat)
  • Parameters:
    • string $module
    • string $version
    • mixed $requirements
      a module name or an array of module names
    • boolean $deep
      Defaults to true meaning we should check requirements of requiremnets of requirements of ...
      • Default Value: true
    • $cat
      • Default Value: 'requirement'
  • Returns: boolean

processConfig()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 436
  • Signature: public function processConfig($process_configuration,$verbose_errors,$process_meta,$localized)
  • Parameters:
    • $process_configuration
      • Default Value: false
    • $verbose_errors
      • Default Value: true
    • $process_meta
      • Default Value: true
    • $localized
      • Default Value: array()

processConfigFile()

Loads in a config file and validates it against its referenced DTD. Sets the access time and the shortname (provided in the metadata) for the file. If there is already a config file with the same shortname, it will remove that fro the list of the config files. Save all the configuration metadata under $storage->$shortname where $shortname is the shortname provided for by the config file.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 224
  • Signature: public function processConfigFile($file,$process_configuration,$verbose_errors,$process_meta,$localized)
  • Parameters:
    • string $file
      The full path to the config file. If this is less than the time the file was last accessed, it does not load the file/set the access time.
    • mixed $process_configuration
      Boolean -- true if you want to save the configuration data into (defaults to false). If true process all config data. If it is a string, then we assume that it is a version number, in which case we process all configuration data that is versioned after the specified version
      • Default Value: false
    • boolean $verbose_errors
      defaults to true.
      • Default Value: true
    • $process_meta
      • Default Value: true
    • array $localized
      Data on localized versions of the file already loaded.
      • Default Value: array()
  • Returns: string
    the shortname provided for by this config file or null on failure.

processRequirementsDOM()

@param boolean $options. Defaults to false. Set to true if the new requests are optional i.e. don't cause a fatal error/add to the DOM if there a conflict

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1046
  • Signature: public function processRequirementsDOM($new_requests,$requests,$optional)
  • Parameters:
    • mixed $new_requests
      a shortname or an array of shortnames of module we wish to be loaded.
    • DOMDocument $requests
      The existing requests. Each node should have an order attribute. Optionally hey may have the attribute 'checked' meaning that we consider this node to be checked.
    • $optional
      • Default Value: false
  • Returns: an
    array of the new modules that were installed on sucess. A string on failure describing the failure reason.

recursiveScan()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 634
  • Signature: private function recursiveScan($shortnames,$extensions,$limit_to_subdir,$verbose)
  • Parameters:
    • &$shortnames
    • $extensions
    • $limit_to_subdir
    • $verbose

requirements()

Get a list of requirement objects for the module

resetCheckedPaths()

resetMerges()

Reset the tracked data.

setLocales()

Set the locales used when handingling the processing of config data.

setModulePath()

Set the module's path, usually used for testing.

setRoot()

Set the root of where this I2CE instance started.

  • Defined in i2ce/lib/I2CE_Configurator.php on line 1246
  • Signature: public function setRoot($dir)
  • Parameters:
    • string $dir
      Directory (defaults to getcwd()) where this instance of Configurator was created.
      • Default Value: null
  • Returns: the
    fully resolved path to $dir

setTopModule()

Set the top level module for a directory.

setupFileSearch()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 527
  • Signature: private function setupFileSearch($mod,$path)
  • Parameters:
    • $mod
      • Default Value: null
    • $path
      • Default Value: "MODULES"

shallowScan()

  • Defined in i2ce/lib/I2CE_Configurator.php on line 656
  • Signature: private function shallowScan($potential_configs,$verbose)
  • Parameters:
    • $potential_configs
    • $verbose
      • Default Value: false

Inherited Methods

_hasMethod()

This public method is inherited from I2CE_Fuzzy->_hasMethod()

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()

Fuzzy Methods

loadConfigFile_YAML()

This method is implemented by I2CE_Module_YAML->loadConfigFile_YAML()