phpDocumentor epesi-base
module
[ class tree: epesi-base ] [ index: epesi-base ] [ all elements ]

Class: ModuleManager

Source Location: /include/module_manager.php

Class ModuleManager

Property Summary
static mixed   $loaded_modules  
static mixed   $modules  
static mixed   $modules_common  
static mixed   $modules_install  
static mixed   $not_loaded_modules  
static mixed   $root  

[ Top ]
Method Summary
static bool   backup()   Creates module backup point.
static void   call_common_methods()  
static bool   check_access()   Checks access to a method.
static void   check_common_methods()  
static void   create_common_cache()  
static bool   create_data_dir()   Creates default data directory for module.
static array   create_load_priority_array()   Creates array of installed modules indexed by priority of loading, based on dependencies.
static void   &create_root()   Creates root(first) module instance.
static bool   downgrade()   This function performs downgrade process when it is requested by Setup module.
static bool   exists()   Check if module passed as first parameter with version passed as second parameter can be found in Modules' directory.
static void   get_data_dir()  
static bool   &get_instance()   Returns instance of module.
static array   get_load_priority_array()   Returns an array of installed modules indexed by priority of loading, based on dependencies.
static string   get_module_dir_path()   Returns directory path to the module including module main directory.
static string   get_module_file_name()   Returns main filename part of the module.
static void   get_processed_modules()  
static void   include_common()   Includes file with module common class.
static void   include_install()   Includes file with module installation class.
static void   include_main()   Includes file with module main class.
static bool   install()   Installs module given as first parameter.
static integer   is_installed()   Checks if module is installed.
static array   list_backups()   Returns list of available backups.
static array   list_modules()   Creates list of modules currently available to install along with list of available versions.
static void   load_modules()   Loads all installed classes definitions.
static object newly   &new_instance()   Creates new module instance.
static void   register()   Registers module passed as first parameter in array passed as third parameter.
static bool   remove_data_dir()   Removes default data directory of a module.
static bool   restore()   Restores module data based from backup.
static bool   uninstall()   Uninstalls module.
static void   unregister()   Unregisters module passed as first parameter from array passed as third parameter.
static bool   upgrade()   This function performs upgrade process when it is requested by Setup module.

[ Top ]
Properties
static mixed   $loaded_modules = array() [line 18]
API Tags:
Access:  public


[ Top ]
static mixed   $modules = array() [line 19]
API Tags:
Access:  public


[ Top ]
static mixed   $modules_common = array() [line 21]
API Tags:
Access:  public


[ Top ]
static mixed   $modules_install = array() [line 20]
API Tags:
Access:  public


[ Top ]
static mixed   $not_loaded_modules = null [line 17]
API Tags:
Access:  public


[ Top ]
static mixed   $root = array() [line 22]
API Tags:
Access:  public


[ Top ]
Methods
static method backup  [line 626]

  static bool backup( string $module  )

Creates module backup point.

Parameters:
string   $module:  module name

API Tags:
Return:  true on success, false otherwise
Access:  public


[ Top ]
static method call_common_methods  [line 986]

  static void call_common_methods( $method, [ $cached = true], [ $args = array()]  )

Parameters:
   $method: 
   $cached: 
   $args: 

API Tags:
Access:  public


[ Top ]
static method check_access  [line 975]

  static bool check_access( object module $mod, string $m  )

Checks access to a method.

First parameter is a module object and second is a method in this module.

If you want to restric access to a method just create a method called 'methodname_access' returning false if you want restrict user from accessing 'methodname' method.

check_access is called automatically with each pack_module call.

Parameters:
object module   $mod: 
string   $m:  function name

API Tags:
Return:  true if access is granted, false otherwise
Access:  public


[ Top ]
static method check_common_methods  [line 1002]

  static void check_common_methods( $method, [ $cached = true]  )

Parameters:
   $method: 
   $cached: 

API Tags:
Access:  public


[ Top ]
static method create_common_cache  [line 916]

  static void create_common_cache( )


API Tags:
Access:  public


[ Top ]
static method create_data_dir  [line 856]

  static bool create_data_dir( string $name  )

Creates default data directory for module.

Do not use directly.

Parameters:
string   $name:  module name

API Tags:
Return:  true if directory was created or already exists, false otherwise
Access:  public


[ Top ]
static method create_load_priority_array  [line 102]

  static array create_load_priority_array( )

Creates array of installed modules indexed by priority of loading, based on dependencies.

Do not use directly.


API Tags:
Return:  array containing information about modules priorities
Access:  public


[ Top ]
static method create_root  [line 947]

  static void &create_root( )

Creates root(first) module instance.

Do not use directly.


API Tags:
Access:  public


[ Top ]
static method downgrade  [line 388]

  static bool downgrade( string $module, int $to_version  )

This function performs downgrade process when it is requested by Setup module.

Do not use directly.

Parameters:
string   $module:  module name
int   $to_version:  version to which module should be downgraded

API Tags:
Return:  true if module was downgraded sucesfully, false otherwise
Access:  public


[ Top ]
static method exists  [line 272]

  static bool exists( $mod  )

Check if module passed as first parameter with version passed as second parameter can be found in Modules' directory.

Parameters:
   $mod: 

API Tags:
Return:  true if module was found, false otherwise
Access:  public


[ Top ]
static method get_data_dir  [line 882]

  static void get_data_dir( $name  )

Parameters:
   $name: 

API Tags:
Access:  public


[ Top ]
static method get_instance  [line 823]

  static bool &get_instance( string $path  )

Returns instance of module.

Parameters:
string   $path:  module name

API Tags:
Return:  null if module instance was not found, requested module object otherwise
Access:  public


[ Top ]
static method get_load_priority_array  [line 771]

  static array get_load_priority_array( [ $force = false]  )

Returns an array of installed modules indexed by priority of loading, based on dependencies.

Do not use directly.

Parameters:
   $force: 

API Tags:
Return:  array containing information with modules priorities
Access:  public


[ Top ]
static method get_module_dir_path  [line 212]

  static string get_module_dir_path( string $name  )

Returns directory path to the module including module main directory.

Parameters:
string   $name:  module name

API Tags:
Return:  directory path to the module
Access:  public


[ Top ]
static method get_module_file_name  [line 226]

  static string get_module_file_name( $name  )

Returns main filename part of the module.

Module named Box, instance 1: get_module_file_name returns 'Box'

Note that file names always contain some other parts like 'Box_0.php'

Parameters:
   $name: 

API Tags:
Return:  directory path to the module
Access:  public


[ Top ]
static method get_processed_modules  [line 760]

  static void get_processed_modules( )


API Tags:
Access:  public


[ Top ]
static method include_common  [line 53]

  static void include_common( string $class_name, $version  )

Includes file with module common class.

Do not use directly.

Parameters:
string   $class_name:  module name
   $version: 

API Tags:
Access:  public


[ Top ]
static method include_install  [line 33]

  static void include_install( string $class_name  )

Includes file with module installation class.

Do not use directly.

Parameters:
string   $class_name:  module name

API Tags:
Access:  public


[ Top ]
static method include_main  [line 79]

  static void include_main( string $class_name, $version  )

Includes file with module main class.

Do not use directly.

Parameters:
string   $class_name:  module name
   $version: 

API Tags:
Access:  public


[ Top ]
static method install  [line 454]

  static bool install( string $module_to_install, [integer $version = null], [ $check = true]  )

Installs module given as first parameter.

Additionally, this function calls upgrade to version given as second parameter.

Parameters:
string   $module_to_install:  module name
integer   $version:  module version
   $check: 

API Tags:
Return:  true if installation success, false otherwise
Access:  public


[ Top ]
static method is_installed  [line 313]

  static integer is_installed( string $module_to_install  )

Checks if module is installed.

Parameters:
string   $module_to_install:  module name

API Tags:
Return:  version of installed module or -1 when it's not installed
Access:  public


[ Top ]
static method list_backups  [line 682]

  static array list_backups( )

Returns list of available backups.


API Tags:
Return:  list of backups, each backup point is described as an array with fields 'name', 'version', 'date'
Access:  public


[ Top ]
static method list_modules  [line 236]

  static array list_modules( )

Creates list of modules currently available to install along with list of available versions.


API Tags:
Return:  array built as follows: array('Box'=>array(0,1)...)
Access:  public


[ Top ]
static method load_modules  [line 892]

  static void load_modules( )

Loads all installed classes definitions.

Do not use directly.


API Tags:
Access:  public


[ Top ]
static method new_instance  [line 794]

  static object newly &new_instance( module $mod, $parent, $name, [ $clear_vars = false]  )

Creates new module instance.

Do not use directly. Use pack_module instead.

Parameters:
module   $mod:  name
   $parent: 
   $name: 
   $clear_vars: 

API Tags:
Return:  created module object
Access:  public

Information Tags:
Throws:  exception 'module not loaded' if the module is not registered

[ Top ]
static method register  [line 289]

  static void register( string $mod, integer $version, array &$module_table  )

Registers module passed as first parameter in array passed as third parameter.

It is used to mark in an array that module is loaded and provides some external modules.

Do not use directly.

Parameters:
string   $mod:  module name
integer   $version:  module version
array   &$module_table:  modules list

API Tags:
Access:  public


[ Top ]
static method remove_data_dir  [line 874]

  static bool remove_data_dir( string $name  )

Removes default data directory of a module.

Do not use directly.

Parameters:
string   $name:  module name

API Tags:
Return:  true if directory was removed or did not exist, false otherwise
Access:  public


[ Top ]
static method restore  [line 558]

  static bool restore( string $module, string $date, [bool $delete_old_data = true]  )

Restores module data based from backup.

Parameters:
string   $module:  module name
string   $date:  date on which desired backup was made
bool   $delete_old_data:  if set to true it will delete all current module data

API Tags:
Return:  true on success, false otherwise
Access:  public


[ Top ]
static method uninstall  [line 700]

  static bool uninstall( string $module_to_uninstall  )

Uninstalls module.

Parameters:
string   $module_to_uninstall:  module name

API Tags:
Return:  true if uninstallation success, false otherwise
Access:  public


[ Top ]
static method unregister  [line 303]

  static void unregister( string $mod, integer &$module_table, array 2  )

Unregisters module passed as first parameter from array passed as third parameter.

It is used to mark in an array that module is not loaded and doesn't provide some external modules anymore.

Do not use directly.

Parameters:
array   2:  modules list
string   $mod:  module name
integer   &$module_table:  module version

API Tags:
Access:  public


[ Top ]
static method upgrade  [line 329]

  static bool upgrade( string $module, int $to_version  )

This function performs upgrade process when it is requested by Setup module.

Do not use directly.

Parameters:
string   $module:  module name
int   $to_version:  version to which module should be upgraded

API Tags:
Return:  true is module was upgraded sucesfully, false otherwise
Access:  public


[ Top ]

Documentation generated on Fri, 26 Dec 2008 21:44:25 -0500 by phpDocumentor 1.4.2