Class ModuleOperations

Description

A singleton utility class to allow for working with modules.

  • since: 0.9

Located in /class.moduleoperations.inc.php (line 36)


	
			
Method Summary
static object &get_instance ()
static array get_modules_with_capability (string $capability, [mixed $args = ''])
boolean ActivateModule (string $module_name, [boolean $activate = true])
string CreateXMLPackage ( &$modinstance,  &$message,  &$filecount, mixed $modinstance, string $message, integer $filecount)
array ExpandXMLPackage ( $xmluri, [boolean $overwrite = 0], [boolean $brief = 0], string $xml)
array FindAllModules ()
array GetInstalledModules ([ $include_all = FALSE])
void GetQueueResults (string 0)
null &GetSyntaxHighlighter ([string $module_name = ''])
void &GetSyntaxModule ([ $module_name = ''])
null &GetWYSIWYGModule ([string $module_name = ''])
mixed &get_module_instance (string $module_name, [string $version = ''], [boolean $force = FALSE])
array InstallModule (string $module, [boolean $loadifnecessary = false])
void IsModuleActive ( $module_name)
boolean IsSystemModule (string $module_name)
void LoadModules ([loadall $loadall = false], [noadmin $noadmin = false], [no_lazyload $no_lazyload = false])
void QueueForInstall (string $module_name)
boolean UninstallModule (string $module)
void unload_module (string $module_name)
boolean UpgradeModule ( $module_name, [ $to_version = ''], string $module)
Methods
static method get_instance (line 85)

Get the only permitted instance of this object. It will be created if necessary

  • access: public
static object &get_instance ()
static method get_modules_with_capability (line 1028)

Returns an array of installed modules that have a certain capabilies This method will force the loading of all modules regardless of the module settings.

  • return: List of all the module objects with that capability
  • access: public
static array get_modules_with_capability (string $capability, [mixed $args = ''])
  • string $capability: The capability name
  • mixed $args: Capability arguments
ActivateModule (line 953)

Activate a module

  • access: public
boolean ActivateModule (string $module_name, [boolean $activate = true])
  • string $module_name: module name
  • boolean $activate: flag indicating wether to activate or deactivate the module
CreateXMLPackage (line 132)

Creates an xml data package from the module directory.

  • return: an XML string comprising the module and its files
string CreateXMLPackage ( &$modinstance,  &$message,  &$filecount, mixed $modinstance, string $message, integer $filecount)
  • mixed $modinstance: The instance of the module object
  • string $message: Reference to a string which will be filled with the message created by the run of the method
  • integer $filecount: Reference to an interger which will be filled with the total # of files in the package
  • &$modinstance
  • &$message
  • &$filecount
ExpandXMLPackage (line 203)

Unpackage a module from an xml string does not touch the database

  • return: A hash of details about the installed module
array ExpandXMLPackage ( $xmluri, [boolean $overwrite = 0], [boolean $brief = 0], string $xml)
  • string $xml: The xml data for the package
  • boolean $overwrite: Should we overwrite files if they exist?
  • boolean $brief: If set to true, less checking is done and no errors are returned
  • $xmluri
FindAllModules (line 723)

A function to return a list of all modules that appear to exist properly in the modules directory.

  • return: of complete specifications to module files
  • access: public
array FindAllModules ()
GetAllModuleNames (line 993)

Return an array of the names of all modules that we currently know about

  • access: public
void GetAllModuleNames ()
GetInstalledModules (line 1003)

Returns an array of the names of all installed modules.

  • return: of strings
  • access: public
array GetInstalledModules ([ $include_all = FALSE])
  • $include_all
GetLoadedModules (line 984)

Returns a hash of all loaded modules. This will include all modules loaded into memory at the current time

  • return: The hash of all loaded modules
  • access: public
array &GetLoadedModules ()
GetQueueResults (line 1243)

Get list of modules queued for install.

  • since: 1.10
  • access: public
void GetQueueResults (string 0)
  • string 0: module name
GetSearchModule (line 1179)

Return the current search module object

This method returns module object for the currently selected search module.

  • return: on failure, an object of type CmsModule on success
  • since: 1.10
  • access: public
null &GetSearchModule ()
GetSyntaxHighlighter (line 1111)

Return the current syntax highlighter module object

This method retrieves the specified syntax highlighter module, or uses the current current user preference for the syntax hightlighter module for a name.

  • return: on failure, an object of type CmsModule On success.
  • since: 1.10
  • access: public
null &GetSyntaxHighlighter ([string $module_name = ''])
  • string $module_name: allows bypassing the automatic detection process and specifying a wysiwyg module.
GetSyntaxModule (line 1198)

Alias for the GetSyntaxHiglighter method.

void &GetSyntaxModule ([ $module_name = ''])
  • $module_name
GetWYSIWYGModule (line 1144)

Return the current wysiwyg module object

This method makes an attempt to find the appropriate wysiwyg module given the current request context and admin user preference.

  • return: on failure, an object of type CmsModule On success.
  • deprecated:
  • since: 1.10
  • access: public
null &GetWYSIWYGModule ([string $module_name = ''])
  • string $module_name: allows bypassing the automatic detection process and specifying a wysiwyg module.
get_module_instance (line 1056)

A function to return the object reference to the module object if the module is not already loaded, it will be loaded. Version checks are done with the module to allow only loading versions of modules that are greater than the specified value.

  • return: Null on failure, or an object of type CmsModule on success.
  • access: public
mixed &get_module_instance (string $module_name, [string $version = ''], [boolean $force = FALSE])
  • string $module_name: The module name
  • string $version: an optional version string.
  • boolean $force: an optional flag to indicate wether the module should be force loaded if necesary.
InstallModule (line 494)

Install a module into the database

  • return: Returns a tuple of whether the install was successful and a message if applicable
  • access: public
array InstallModule (string $module, [boolean $loadifnecessary = false])
  • string $module: The name of the module to install
  • boolean $loadifnecessary: If true, loads the module before trying to install it
IsModuleActive (line 936)

Test if a module is active

  • access: public
void IsModuleActive ( $module_name)
  • $module_name
IsSystemModule (line 1094)

Test if the specified module name is a system module

  • access: public
boolean IsSystemModule (string $module_name)
  • string $module_name: The module name
LoadModules (line 783)

Finds all modules that are available to be loaded...

this method uses the information in the database to load the modules that are necessary to load it also, will go through any queued installs/upgrades and force those modules to load, which will in turn do the upgrading and installing if necessary.

  • access: public
void LoadModules ([loadall $loadall = false], [noadmin $noadmin = false], [no_lazyload $no_lazyload = false])
  • loadall $loadall: boolean indicates wether ALL modules in the filesystem should be loaded, default is false
  • noadmin $noadmin: boolean indicates that modules marked as admin_only in the database should not be loaded, default is false
  • no_lazyload $no_lazyload: boolean indicates that modules marked as lazy_loadable should be loaded anywayz, default is falze
QueueForInstall (line 1220)

Queue a module for install

  • since: 1.10
  • access: public
void QueueForInstall (string $module_name)
  • string $module_name: module name
UninstallModule (line 876)

Uninstall a module

  • return: Whether or not the upgrade was successful
  • access: public
boolean UninstallModule (string $module)
  • string $module: The name of the module to upgrade
unload_module (line 1262)

Unload a module from memory

  • since: 1.10
  • access: public
void unload_module (string $module_name)
  • string $module_name: module name
UpgradeModule (line 862)

Upgrade a module

This is an internal method, subject to change in later releases. It should never be called for upgrading arbitrary modules. Any use of this function by third party code will not be supported. Use at your own risk and do not report bugs or issues related to your use of this module.

  • return: Whether or not the upgrade was successful
  • access: public
boolean UpgradeModule ( $module_name, [ $to_version = ''], string $module)
  • string $module: The name of the module to upgrade
  • $module_name
  • $to_version

Documentation generated on Sun, 12 Aug 2012 08:38:30 -0600 by phpDocumentor 1.3.2