Axiom (v1.2.0)

A lightweight PHP framework
axModuleManager Class Reference

Module Manager. More...

Public Member Functions

 __construct ($path, $axiom_version, array $options=array())
 Constructor.
 getModules ()
 Get available modules.
 exists ($module)
 Check if the module exists.
 getInformations ($module)
 Get module meta-inf.
 load ($module)
 Load the given module.
 checkUpdates ($module)
 Check if updates are available for the given module.

Data Fields

const CACHE_FILE = "module.cache.php"

Protected Member Functions

 _getDependencies ($module)
 Get the given module dependencies.
 _checkDependencies ($module)
 Check dependencies according to version numbers.
 _loadDependencies ($module)
 Load dependencies for the given module.
 _cache ()
 Store modules informations for later use.

Static Protected Member Functions

static _parseModuleVersion ($version)
 Parses a version to an integer.
static _compareVersions ($version_a, $version_b)
 Check if the left version is higher than the right version.

Protected Attributes

 $_path
 Modules path.
 $_axiomVersion
 Axiom version.
 $_options
 Options.
 $_modules
 Module descriptors.

Detailed Description

Module Manager.

Todo:
Module manager long description
Author:
Delespierre
License:
http://www.gnu.org/licenses/lgpl.html Lesser General Public Licence version 3

Definition at line 17 of file axModuleManager.class.php.


Constructor & Destructor Documentation

axModuleManager::__construct ( path,
axiom_version,
array $  options = array() 
)

Constructor.

Options:

  • check_dependencies [boolean] wherever to check dependencies or not
  • cache_dir [string | false] false will disable caching
Parameters:
string$pathThe path to the modules directory
string$axiom_versionUsed during dependencies check
array$options[optional] [default array()] see above

Definition at line 60 of file axModuleManager.class.php.


Member Function Documentation

axModuleManager::_cache ( ) [protected]

Store modules informations for later use.

Will do nothing if cache is disabled

Returns:
boolean

Definition at line 230 of file axModuleManager.class.php.

axModuleManager::_checkDependencies ( module) [protected]

Check dependencies according to version numbers.

Parameters:
string$module
Exceptions:
RuntimeExceptionIf a module's meta-infs cannot be found
Returns:
boolean

Definition at line 178 of file axModuleManager.class.php.

static axModuleManager::_compareVersions ( version_a,
version_b 
) [static, protected]

Check if the left version is higher than the right version.

Both parameters can be either strings or integer so these calls are equivalents:

 self::_compareVersion('1.2.3', '1.0.2');
 self::_compareVersion(100203, 100002);
Parameters:
mixed$version_a
mixed$version_b
Returns:
boolean

Definition at line 262 of file axModuleManager.class.php.

axModuleManager::_getDependencies ( module) [protected]

Get the given module dependencies.

Parameters:
string$module
Exceptions:
RuntimeExceptionIf the module doesn't exists
Returns:
array

Definition at line 164 of file axModuleManager.class.php.

axModuleManager::_loadDependencies ( module) [protected]

Load dependencies for the given module.

Parameters:
string$module
Returns:
boolean

Definition at line 204 of file axModuleManager.class.php.

static axModuleManager::_parseModuleVersion ( version) [static, protected]

Parses a version to an integer.

Parameters:
string$version
Returns:
interger

Definition at line 244 of file axModuleManager.class.php.

Check if updates are available for the given module.

Parameters:
string$module
Returns:
boolean

Definition at line 154 of file axModuleManager.class.php.

axModuleManager::exists ( module)

Check if the module exists.

Parameters:
string$module
Returns:
boolena

Definition at line 102 of file axModuleManager.class.php.

Get module meta-inf.

Wil return false in case of error.

Parameters:
string$module
Returns:
array

Definition at line 114 of file axModuleManager.class.php.

Get available modules.

Returns:
array

Definition at line 79 of file axModuleManager.class.php.

axModuleManager::load ( module)

Load the given module.

Parameters:
string$module
Returns:
boolean

Definition at line 133 of file axModuleManager.class.php.


Field Documentation

string axModuleManager::$_axiomVersion [protected]

Axiom version.

Definition at line 35 of file axModuleManager.class.php.

array axModuleManager::$_modules [protected]

Module descriptors.

Definition at line 47 of file axModuleManager.class.php.

array axModuleManager::$_options [protected]

Options.

Definition at line 41 of file axModuleManager.class.php.

string axModuleManager::$_path [protected]

Modules path.

Definition at line 29 of file axModuleManager.class.php.

const axModuleManager::CACHE_FILE = "module.cache.php"

Definition at line 23 of file axModuleManager.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables