XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Legacy_ModuleInstallUtils Class Reference

Static Public Member Functions

static & createInstaller ($dirname)
 
static & createUpdater ($dirname)
 
static & createUninstaller ($dirname)
 
static & _createInstaller ($dirname, $mode, $defaultClassName)
 
static installSQLAutomatically (&$module, &$log)
 
static installAllOfModuleTemplates (&$module, &$log)
 
static installModuleTemplate ($module, $template, &$log)
 
static _uninstallAllOfModuleTemplates (&$module, $tplset, &$log)
 
static uninstallAllOfModuleTemplates (&$module, &$log)
 
static clearAllOfModuleTemplatesForUpdate (&$module, &$log)
 
static installAllOfBlocks (&$module, &$log)
 
static uninstallAllOfBlocks (&$module, &$log)
 
static & createBlockByInfo (&$module, $block, $func_num)
 
static installBlock (&$module, &$blockObj, &$block, &$log)
 
static uninstallBlock (&$block, &$log)
 
static installBlockTemplate (&$block, &$module, &$log)
 
static readTemplateFile ($dirname, $fileName, $isblock=false)
 
static installAllOfConfigs (&$module, &$log)
 
static installPreferenceByInfo (&$info, &$module, &$log)
 
static & getConfigInfosFromManifesto (&$module)
 
static uninstallAllOfConfigs (&$module, &$log)
 
static smartUpdateAllOfBlocks (&$module, &$log)
 
static smartUpdateAllOfPreferences (&$module, &$log)
 
static updateBlockTemplateByInfo (&$info, &$module, &$log)
 
static updateBlockByInfo (&$info, &$module, &$log)
 
static updatePreferenceByInfo (&$info, &$module, &$log)
 
static updatePreferenceOrderByInfo (&$info, &$module, &$log)
 
static installBlockByInfo (&$info, &$module, &$log)
 
static uninstallBlockByFuncNum ($func_num, &$module, &$log)
 
static _uninstallBlockTemplate (&$block, &$module, $tplset, &$log)
 
static uninstallBlockTemplate (&$block, &$module, &$log)
 
static clearBlockTemplateForUpdate (&$block, &$module, &$log)
 
static uninstallPreferenceByOrder ($order, &$module, &$log)
 
static DBquery ($query, &$module, $log)
 
static deleteAllOfNotifications (&$module, &$log)
 
static deleteAllOfComments (&$module, &$log)
 

Detailed Description

This class is collection of static utility functions for module installation. These functions are useful for Legacy modules' system-fixed-installer and modules' custom-installer. All functions for the custom-installer are added notes as "FOR THE CUSTOM-ISNTALLER".

For more attentions, see base classes for the custom-installer.

See also
Legacy_PhasedUpgrader

Definition at line 73 of file ModuleInstallUtils.class.php.

Member Function Documentation

◆ _createInstaller()

static & _createInstaller ( $dirname,
$mode,
$defaultClassName )
static

The generic factory for installers. This function is used by other utility functions.

Parameters
string$dirname
string$mode'installer' 'updater' or 'uninstaller'
string$defaultClassName
Returns
mixed

Definition at line 119 of file ModuleInstallUtils.class.php.

◆ _uninstallAllOfModuleTemplates()

static _uninstallAllOfModuleTemplates ( & $module,
$tplset,
& $log )
static

Uninstalls all module templates $module specify. This function is useful for uninstaller and updater. In the case of update, you should call this function before installAllOfModuleTemplates(). In the case of uninstall, you must set 'false' to $defaultOnly.

This function gets information about templates from the database.

Warning

This function depends on the specific spec of Legacy_RenderSystem, but this static function is needed by the 2nd installer of Legacy System.

Parameters
XoopsModule$module
$tplset
Legacy_ModuleInstallLog$log
Note
FOR THE CUSTOM-INSTALLER
See also
Legacy_ModuleInstallUtils\installAllOfModuleTemplates()

Definition at line 364 of file ModuleInstallUtils.class.php.

◆ _uninstallBlockTemplate()

static _uninstallBlockTemplate ( & $block,
& $module,
$tplset,
& $log )
static

Uninstalls the block template data specified by $block of $module.

Parameters
XoopsBlock$block
XoopsModule$moduleThis object is must the module which has $block.
string$tplsetA name of the template set. If this is null, uninstalls all templates of any template-sets.
$log
Remarks
This method users template handlers of the kernel. But, if they are hooked, they may not do something. So, abstraction mechanism is possible enough.

Definition at line 1232 of file ModuleInstallUtils.class.php.

◆ clearAllOfModuleTemplatesForUpdate()

static clearAllOfModuleTemplatesForUpdate ( & $module,
& $log )
static

Definition at line 394 of file ModuleInstallUtils.class.php.

◆ clearBlockTemplateForUpdate()

static clearBlockTemplateForUpdate ( & $block,
& $module,
& $log )
static

Removes a template data from only default group of some render-system.

Parameters
$block
$module
$log

Definition at line 1261 of file ModuleInstallUtils.class.php.

◆ createBlockByInfo()

static & createBlockByInfo ( & $module,
$block,
$func_num )
static

Create XoopsBlock object by array that is defined in xoops_version, return it.

Parameters
XoopsModule$module
array$block
$func_num
Returns
XoopsBlock

Definition at line 504 of file ModuleInstallUtils.class.php.

◆ createInstaller()

static & createInstaller ( $dirname)
static

This is factory for the installer. The factory reads xoops_version without modulehandler, to prevent cache in modulehandler.

Parameters
$dirname
Returns
mixed

Definition at line 81 of file ModuleInstallUtils.class.php.

◆ createUninstaller()

static & createUninstaller ( $dirname)
static

This is factory for the uninstaller. The factory reads xoops_version without modulehandler, to prevent cache in modulehandler.

Parameters
$dirname
Returns
mixed

Definition at line 105 of file ModuleInstallUtils.class.php.

◆ createUpdater()

static & createUpdater ( $dirname)
static

This is factory for the updater. The factory reads xoops_version without modulehandler, to prevent cache in modulehandler.

Parameters
$dirname
Returns
mixed

Definition at line 93 of file ModuleInstallUtils.class.php.

◆ DBquery()

static DBquery ( $query,
& $module,
$log )
static

Executes SQL query as cube style.

Parameters
$query
$module
$log
Returns
bool

Definition at line 1293 of file ModuleInstallUtils.class.php.

◆ deleteAllOfComments()

static deleteAllOfComments ( & $module,
& $log )
static

Definition at line 1328 of file ModuleInstallUtils.class.php.

◆ deleteAllOfNotifications()

static deleteAllOfNotifications ( & $module,
& $log )
static

Definition at line 1321 of file ModuleInstallUtils.class.php.

◆ getConfigInfosFromManifesto()

static & getConfigInfosFromManifesto ( & $module)
static

Get & build config items from Manifesto by specific module object.

Parameters
$module
Returns
array

Definition at line 798 of file ModuleInstallUtils.class.php.

◆ installAllOfBlocks()

static installAllOfBlocks ( & $module,
& $log )
static

Installs all blocks $module specify.

This function gets information about blocks from xoops_version.

Parameters
XoopsModule$module
Legacy_ModuleInstallLog$log
Note
FOR THE CUSTOM-INSTALLER
Returns
bool
See also
Legacy_ModuleInstallUtils\uninstallAllOfBlocks()

Definition at line 411 of file ModuleInstallUtils.class.php.

◆ installAllOfConfigs()

static installAllOfConfigs ( & $module,
& $log )
static

Definition at line 733 of file ModuleInstallUtils.class.php.

◆ installAllOfModuleTemplates()

static installAllOfModuleTemplates ( & $module,
& $log )
static

Installs all module templates $module specify. This function is useful for installer and updater. In the case of updater, you should uninstall all module templates before this function.

This function gets information about templates from xoops_version.

Warning

This function depends on the specific spec of Legacy_RenderSystem, but this static function is needed by the 2nd installer of Legacy System.

Parameters
XoopsModule$module
Legacy_ModuleInstallLog$log
Note
FOR THE CUSTOM-INSTALLER
See also
Legacy_ModuleInstallUtils\uninstallAllOfModuleTemplates()

Definition at line 276 of file ModuleInstallUtils.class.php.

◆ installBlock()

static installBlock ( & $module,
& $blockObj,
& $block,
& $log )
static

This function can receive both new and update.

Parameters
XoopsModule$module
XoopsBlock$blockObj
array$block
$log
Returns
bool

Definition at line 553 of file ModuleInstallUtils.class.php.

◆ installBlockByInfo()

static installBlockByInfo ( & $info,
& $module,
& $log )
static

Definition at line 1164 of file ModuleInstallUtils.class.php.

◆ installBlockTemplate()

static installBlockTemplate ( & $block,
& $module,
& $log )
static

Save the information of block's template specified and the source code of it to database.

Parameters
$block
$module
$log
Returns
bool

Definition at line 652 of file ModuleInstallUtils.class.php.

◆ installModuleTemplate()

static installModuleTemplate ( $module,
$template,
& $log )
static

Inserts the specified template to DB.

Warning

This function depends on the specific spec of Legacy_RenderSystem, but this static function is needed by the 2nd installer of Legacy System.

Parameters
XoopsModule$module
string[][]$template
Legacy_ModuleInstallLog$log
Returns
bool
Note
This is not useful for custom-installers.
Todo
We'll need a way to specify the template by identity or others.

Definition at line 303 of file ModuleInstallUtils.class.php.

◆ installPreferenceByInfo()

static installPreferenceByInfo ( & $info,
& $module,
& $log )
static

Definition at line 762 of file ModuleInstallUtils.class.php.

◆ installSQLAutomatically()

static installSQLAutomatically ( & $module,
& $log )
static

Executes SQL file which xoops_version of $module specifies. This function is usefull for installers, but it's impossible to control for detail.

Parameters
XoopsModule$module
Legacy_ModuleInstallLog$log
Note
FOR THE CUSTOM-INSTALLER
Returns
bool|void

Definition at line 169 of file ModuleInstallUtils.class.php.

◆ readTemplateFile()

static readTemplateFile ( $dirname,
$fileName,
$isblock = false )
static

Read template file, return it.

Note
This is must, but it depends on ...
Parameters
$dirname
$fileName
bool$isblock
Returns
bool|string

Definition at line 702 of file ModuleInstallUtils.class.php.

◆ smartUpdateAllOfBlocks()

static smartUpdateAllOfBlocks ( & $module,
& $log )
static

Definition at line 909 of file ModuleInstallUtils.class.php.

◆ smartUpdateAllOfPreferences()

static smartUpdateAllOfPreferences ( & $module,
& $log )
static

Definition at line 942 of file ModuleInstallUtils.class.php.

◆ uninstallAllOfBlocks()

static uninstallAllOfBlocks ( & $module,
& $log )
static

Uninstalls all of blocks which $module specifies, and its permissions.

This function gets informations about templates from the database.

Parameters
XoopsModule$module
Legacy_ModuleInstallLog$log
Returns
bool
Note
FOR THE CUSTOM-INSTALLER
See also
Legacy_ModuleInstallUtils\installAllOfBlocks()
Legacy_ModuleInstallUtils\uninstallBlock()

Definition at line 481 of file ModuleInstallUtils.class.php.

◆ uninstallAllOfConfigs()

static uninstallAllOfConfigs ( & $module,
& $log )
static

Delete all configs of $module.

Parameters
XoopsModule$module
$log

Definition at line 891 of file ModuleInstallUtils.class.php.

◆ uninstallAllOfModuleTemplates()

static uninstallAllOfModuleTemplates ( & $module,
& $log )
static

Definition at line 389 of file ModuleInstallUtils.class.php.

◆ uninstallBlock()

static uninstallBlock ( & $block,
& $log )
static

Uninstalls a block which $block specifies. In the same time, deletes permissions for the block.

Parameters
XoopsBlock$block
Legacy_ModuleInstallLog$log
Note
FOR THE CUSTOM-INSTALLER
Todo
error handling & delete the block's template.

Definition at line 627 of file ModuleInstallUtils.class.php.

◆ uninstallBlockByFuncNum()

static uninstallBlockByFuncNum ( $func_num,
& $module,
& $log )
static
Parameters
$func_num
$module
$log
Todo
Need a message in the fail case.

Definition at line 1200 of file ModuleInstallUtils.class.php.

◆ uninstallBlockTemplate()

static uninstallBlockTemplate ( & $block,
& $module,
& $log )
static

Definition at line 1249 of file ModuleInstallUtils.class.php.

◆ uninstallPreferenceByOrder()

static uninstallPreferenceByOrder ( $order,
& $module,
& $log )
static

Definition at line 1266 of file ModuleInstallUtils.class.php.

◆ updateBlockByInfo()

static updateBlockByInfo ( & $info,
& $module,
& $log )
static

Definition at line 1039 of file ModuleInstallUtils.class.php.

◆ updateBlockTemplateByInfo()

static updateBlockTemplateByInfo ( & $info,
& $module,
& $log )
static

Definition at line 1024 of file ModuleInstallUtils.class.php.

◆ updatePreferenceByInfo()

static updatePreferenceByInfo ( & $info,
& $module,
& $log )
static

Definition at line 1067 of file ModuleInstallUtils.class.php.

◆ updatePreferenceOrderByInfo()

static updatePreferenceOrderByInfo ( & $info,
& $module,
& $log )
static

Definition at line 1139 of file ModuleInstallUtils.class.php.


The documentation for this class was generated from the following file: