Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ModuleInstall Class Reference

Inheritance diagram for ModuleInstall:

Inheritance graph
[legend]
Collaboration diagram for ModuleInstall:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleInstall ($path)
 SetSourcePath ($path)
 SetInfoFile ($name=DEFAULT_INFO_FILENAME)
GetModuleInfo ()
 Install ()
 FilesInstall ()
 ModulesInfoInstall ()
 TablesInstall ()
 PermissionsInstall ()
 _PermissionsInsert ($name)
 ConfigInstall ()
 _ConfigInsert ($configKey)
 _ConfigSetDefault ($configKey)
 RaiseError ($error, $extra="")

Public Attributes

 $modulesourcepath
 The path where is the source of the module.

 $infofile
 The config.xml path.

 $destpath
 The path where the module will be installed.

 $modinfo
 ModuleInfo.

 $moduleid
 The id of the module when it is added to the system.

 $dbObj
 The DB Object.

 $validModule
 Indicates if it is a valid module or not.


Detailed Description

Class to install new modules in the system.

It does not show any graphic interface (a module should be designed to do that thing). It is just about the installation logic.

Todo:
Add support for zipped files?

Definition at line 39 of file ModuleInstall.class.php.


Constructor & Destructor Documentation

ModuleInstall::ModuleInstall path  ) 
 

The constructor

Definition at line 57 of file ModuleInstall.class.php.


Member Function Documentation

ModuleInstall::_ConfigInsert configKey  ) 
 

Makes the concrete query in order to insert the config key in the DB

Parameters:
configKey An IModuleInfoExtractorConfig with the information of the key that will be inserted.
Returns:
JError if there was an error

Definition at line 315 of file ModuleInstall.class.php.

References MODULEINSTALL_ERROR_INSERT_CONFIG.

ModuleInstall::_ConfigSetDefault configKey  ) 
 

Sets the default value for the key if the module creator specified any.

Parameters:
configKey A IModuleInfoExtractorConfig
Returns:
JError if there was an error

Definition at line 340 of file ModuleInstall.class.php.

References ConfigCache::GetInstance().

ModuleInstall::_PermissionsInsert name  ) 
 

Does the concrete query in order to adding permissions in the DB.

It is given a name and a screenname instead of an IModuleInfoExtractors due to the hidden permission which is added "automagically".

Parameters:
name The name of the permission.
Returns:
JError if there was an error

Definition at line 260 of file ModuleInstall.class.php.

References MODULEINSTALL_ERROR_INSERT_PERMISSIONS.

ModuleInstall::ConfigInstall  ) 
 

Inserts the module's config keys into de DB

Returns:
JError if there was an error

Definition at line 283 of file ModuleInstall.class.php.

References JSystem::IsError().

ModuleInstall::FilesInstall  ) 
 

Copies the module files in the destination directory (jamesDir/modules)

Returns:
JError if there was an error

Definition at line 159 of file ModuleInstall.class.php.

References FileOps::cp(), MODULEINSTALL_ERROR_ALREADY_INSTALLED, and MODULEINSTALL_ERROR_DEST_PATH_NO_WRITABLE.

& ModuleInstall::GetModuleInfo  ) 
 

Gets an IModuleInfoExtractor with the information of the module

Returns:
IModuleInfoExtractor

Definition at line 113 of file ModuleInstall.class.php.

ModuleInstall::Install  ) 
 

Installs the module in the system

Returns:
The name of the installed module or JError if there was an error.

Definition at line 122 of file ModuleInstall.class.php.

References JSystem::IsError(), MODULEINSTALL_ERROR_NO_MODULE_DEFINED, and ThrowEvent().

ModuleInstall::ModulesInfoInstall  ) 
 

Inserts the module information into the Modules table in the DB

Returns:
JError if there was an error

Definition at line 179 of file ModuleInstall.class.php.

References MODULEINSTALL_ERROR_INSERT_MODULES.

ModuleInstall::PermissionsInstall  ) 
 

Inserts the module permissions into the DB

Returns:
JError if there was an error

Definition at line 234 of file ModuleInstall.class.php.

References JSystem::IsError().

ModuleInstall::RaiseError error,
extra = ""
 

Redefinition of this method in order to raise the error just giving the error code.

Parameters:
error The error code
extra Extra information about the error
Returns:
JError

Reimplemented from JBaseObject.

Definition at line 369 of file ModuleInstall.class.php.

References JERROR_DEFAULT, MODULEINSTALL_ERROR_ALREADY_INSTALLED, MODULEINSTALL_ERROR_DEST_PATH_NO_WRITABLE, MODULEINSTALL_ERROR_FILE_NOT_FOUND, MODULEINSTALL_ERROR_INSERT_CONFIG, MODULEINSTALL_ERROR_INSERT_CONFIG_DEFAULT, MODULEINSTALL_ERROR_INSERT_MODULES, MODULEINSTALL_ERROR_INSERT_PERMISSIONS, MODULEINSTALL_ERROR_INSERT_TABLES, MODULEINSTALL_ERROR_NO_MODULE_DEFINED, and MODULEINSTALL_ERROR_PATH.

ModuleInstall::SetInfoFile name = DEFAULT_INFO_FILENAME  ) 
 

Sets which is the file which contains the information about the module.

Parameters:
name The name of the info file.
Returns:
JError if there was an error

Definition at line 91 of file ModuleInstall.class.php.

References JSystem::GetConfig(), and MODULEINSTALL_ERROR_FILE_NOT_FOUND.

ModuleInstall::SetSourcePath path  ) 
 

Sets the source path of the module

Parameters:
path The path where is the source of the module.
Returns:
JError if there was an error

Definition at line 69 of file ModuleInstall.class.php.

References MODULEINSTALL_ERROR_PATH.

ModuleInstall::TablesInstall  ) 
 

Inserts the tables needed for the module into de DB

Returns:
JError if there was an error

Definition at line 206 of file ModuleInstall.class.php.

References MODULEINSTALL_ERROR_INSERT_TABLES.


Member Data Documentation

ModuleInstall::$dbObj
 

The DB Object.

Definition at line 53 of file ModuleInstall.class.php.

ModuleInstall::$destpath
 

The path where the module will be installed.

Definition at line 44 of file ModuleInstall.class.php.

ModuleInstall::$infofile
 

The config.xml path.

Definition at line 43 of file ModuleInstall.class.php.

ModuleInstall::$modinfo
 

ModuleInfo.

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

ModuleInstall::$moduleid
 

The id of the module when it is added to the system.

Definition at line 50 of file ModuleInstall.class.php.

ModuleInstall::$modulesourcepath
 

The path where is the source of the module.

Definition at line 42 of file ModuleInstall.class.php.

ModuleInstall::$validModule
 

Indicates if it is a valid module or not.

Definition at line 54 of file ModuleInstall.class.php.


The documentation for this class was generated from the following file:
Generated on Wed Nov 19 20:29:44 2003 for James by doxygen 1.3.4