Permalink
Browse files

[legacy] add `public static` keyword to all functions of ModuleInstal…

…lUtils
  • Loading branch information...
nao-pon committed Apr 20, 2015
1 parent 4e52532 commit 528c80a5097aa8325329910ad5c59248559a8460
Showing with 36 additions and 36 deletions.
  1. +36 −36 html/modules/legacy/admin/class/ModuleInstallUtils.class.php
@@ -72,7 +72,7 @@ class Legacy_ModuleInstallUtils
* This is factory for the installer. The factory reads xoops_version
* without modulehandler, to prevent cache in modulehandler.
*/
function &createInstaller($dirname)
public static function &createInstaller($dirname)
{
$installer =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'installer', 'Legacy_ModuleInstaller');
return $installer;
@@ -82,7 +82,7 @@ function &createInstaller($dirname)
* This is factory for the updater. The factory reads xoops_version
* without modulehandler, to prevent cache in modulehandler.
*/
function &createUpdater($dirname)
public static function &createUpdater($dirname)
{
$updater =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'updater', 'Legacy_ModulePhasedUpgrader');
return $updater;
@@ -92,7 +92,7 @@ function &createUpdater($dirname)
* This is factory for the uninstaller. The factory reads xoops_version
* without modulehandler, to prevent cache in modulehandler.
*/
function &createUninstaller($dirname)
public static function &createUninstaller($dirname)
{
$uninstaller =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'uninstaller', 'Legacy_ModuleUninstaller');
return $uninstaller;
@@ -105,7 +105,7 @@ function &createUninstaller($dirname)
* @param string $mode 'installer' 'updater' or 'uninstaller'
* @param string $defaultClassName
*/
function &_createInstaller($dirname, $mode, $defaultClassName)
public static function &_createInstaller($dirname, $mode, $defaultClassName)
{
$info = array();
@@ -151,7 +151,7 @@ function &_createInstaller($dirname, $mode, $defaultClassName)
* @param Legacy_ModuleInstallLog $log
* @note FOR THE CUSTOM-INSTALLER
*/
function installSQLAutomatically(&$module, &$log)
public static function installSQLAutomatically(&$module, &$log)
{
$dbTypeAliases = array(
'mysqli' => 'mysql'
@@ -261,7 +261,7 @@ function installSQLAutomatically(&$module, &$log)
* @note FOR THE CUSTOM-INSTALLER
* @see Legacy_ModuleInstallUtils::uninstallAllOfModuleTemplates()
*/
function installAllOfModuleTemplates(&$module, &$log)
public static function installAllOfModuleTemplates(&$module, &$log)
{
$templates = $module->getInfo('templates');
if ($templates != false) {
@@ -288,7 +288,7 @@ function installAllOfModuleTemplates(&$module, &$log)
* @note This is not usefull a litte for custom-installers.
* @todo We'll need the way to specify the template by identity or others.
*/
function installModuleTemplate($module, $template, &$log)
public static function installModuleTemplate($module, $template, &$log)
{
$tplHandler =& xoops_gethandler('tplfile');
@@ -350,7 +350,7 @@ function installModuleTemplate($module, $template, &$log)
* @note FOR THE CUSTOM-INSTALLER
* @see Legacy_ModuleInstallUtils::installAllOfModuleTemplates()
*/
function _uninstallAllOfModuleTemplates(&$module, $tplset, &$log)
public static function _uninstallAllOfModuleTemplates(&$module, $tplset, &$log)
{
//
// The following processing depends on the structure of Legacy_RenderSystem.
@@ -375,12 +375,12 @@ function _uninstallAllOfModuleTemplates(&$module, $tplset, &$log)
}
}
function uninstallAllOfModuleTemplates(&$module, &$log)
public static function uninstallAllOfModuleTemplates(&$module, &$log)
{
Legacy_ModuleInstallUtils::_uninstallAllOfModuleTemplates($module, null, $log);
}
function clearAllOfModuleTemplatesForUpdate(&$module, &$log)
public static function clearAllOfModuleTemplatesForUpdate(&$module, &$log)
{
Legacy_ModuleInstallUtils::_uninstallAllOfModuleTemplates($module, 'default', $log);
}
@@ -396,7 +396,7 @@ function clearAllOfModuleTemplatesForUpdate(&$module, &$log)
* @note FOR THE CUSTOM-INSTALLER
* @see Legacy_ModuleInstallUtils::uninstallAllOfBlocks()
*/
function installAllOfBlocks(&$module, &$log)
public static function installAllOfBlocks(&$module, &$log)
{
$definedBlocks = $module->getInfo('blocks');
if($definedBlocks == false) {
@@ -466,7 +466,7 @@ function installAllOfBlocks(&$module, &$log)
* @see Legacy_ModuleInstallUtils::installAllOfBlocks()
* @see Legacy_ModuleInstallUtils::uninstallBlock()
*/
function uninstallAllOfBlocks(&$module, &$log)
public static function uninstallAllOfBlocks(&$module, &$log)
{
$handler =& xoops_gethandler('block');
$criteria = new Criteria('mid', $module->get('mid'));
@@ -488,7 +488,7 @@ function uninstallAllOfBlocks(&$module, &$log)
* @param $block array
* @return XoopsBlock
*/
function &createBlockByInfo(&$module, $block, $func_num)
public static function &createBlockByInfo(&$module, $block, $func_num)
{
$options = isset($block['options']) ? $block['options'] : null;
$edit_func = isset($block['edit_func']) ? $block['edit_func'] : null;
@@ -537,7 +537,7 @@ function &createBlockByInfo(&$module, $block, $func_num)
* @param $block array
* @return bool
*/
function installBlock(&$module, &$blockObj, &$block, &$log)
public static function installBlock(&$module, &$blockObj, &$block, &$log)
{
$isNew = $blockObj->isNew();
$blockHandler =& xoops_gethandler('block');
@@ -612,7 +612,7 @@ function installBlock(&$module, &$blockObj, &$block, &$log)
*
* @todo error handling & delete the block's template.
*/
function uninstallBlock(&$block, &$log)
public static function uninstallBlock(&$block, &$log)
{
$blockHandler =& xoops_gethandler('block');
$blockHandler->delete($block);
@@ -634,7 +634,7 @@ function uninstallBlock(&$block, &$log)
* to database.
* @return bool
*/
function installBlockTemplate(&$block, &$module, &$log)
public static function installBlockTemplate(&$block, &$module, &$log)
{
if ($block->get('template') == null) {
return true;
@@ -682,7 +682,7 @@ function installBlockTemplate(&$block, &$module, &$log)
*
* @note This is must, but it depends on ...
*/
function readTemplateFile($dirname, $fileName, $isblock = false)
public static function readTemplateFile($dirname, $fileName, $isblock = false)
{
//
// Load template data
@@ -714,7 +714,7 @@ function readTemplateFile($dirname, $fileName, $isblock = false)
return $tpldata;
}
function installAllOfConfigs(&$module, &$log)
public static function installAllOfConfigs(&$module, &$log)
{
$dirname = $module->get('dirname');
@@ -743,7 +743,7 @@ function installAllOfConfigs(&$module, &$log)
}
}
function installPreferenceByInfo(&$info, &$module, &$log)
public static function installPreferenceByInfo(&$info, &$module, &$log)
{
$handler =& xoops_gethandler('config');
$config =& $handler->createConfig();
@@ -778,7 +778,7 @@ function installPreferenceByInfo(&$info, &$module, &$log)
/**
* Get & build config items from Manifesto by specific module object.
*/
function &getConfigInfosFromManifesto(&$module)
public static function &getConfigInfosFromManifesto(&$module)
{
$configInfos = $module->getInfo('config');
@@ -868,7 +868,7 @@ function &getConfigInfosFromManifesto(&$module)
*
* @param $module XoopsModule
*/
function uninstallAllOfConfigs(&$module, &$log)
public static function uninstallAllOfConfigs(&$module, &$log)
{
if ($module->get('hasconfig') == 0) {
return;
@@ -886,7 +886,7 @@ function uninstallAllOfConfigs(&$module, &$log)
}
}
function smartUpdateAllOfBlocks(&$module, &$log)
public static function smartUpdateAllOfBlocks(&$module, &$log)
{
$dirname = $module->get('dirname');
@@ -919,7 +919,7 @@ function smartUpdateAllOfBlocks(&$module, &$log)
}
}
function smartUpdateAllOfPreferences(&$module, &$log)
public static function smartUpdateAllOfPreferences(&$module, &$log)
{
$dirname = $module->get('dirname');
@@ -1001,7 +1001,7 @@ function smartUpdateAllOfPreferences(&$module, &$log)
}
}
function updateBlockTemplateByInfo(&$info, &$module, &$log)
public static function updateBlockTemplateByInfo(&$info, &$module, &$log)
{
$handler =& xoops_getmodulehandler('newblocks', 'legacy');
@@ -1016,7 +1016,7 @@ function updateBlockTemplateByInfo(&$info, &$module, &$log)
}
}
function updateBlockByInfo(&$info, &$module, &$log)
public static function updateBlockByInfo(&$info, &$module, &$log)
{
$handler =& xoops_getmodulehandler('newblocks', 'legacy');
@@ -1045,7 +1045,7 @@ function updateBlockByInfo(&$info, &$module, &$log)
}
}
function updatePreferenceByInfo(&$info, &$module, &$log)
public static function updatePreferenceByInfo(&$info, &$module, &$log)
{
$handler =& xoops_gethandler('config');
@@ -1117,7 +1117,7 @@ function updatePreferenceByInfo(&$info, &$module, &$log)
}
}
function updatePreferenceOrderByInfo(&$info, &$module, &$log)
public static function updatePreferenceOrderByInfo(&$info, &$module, &$log)
{
$handler =& xoops_gethandler('config');
@@ -1142,7 +1142,7 @@ function updatePreferenceOrderByInfo(&$info, &$module, &$log)
}
}
function installBlockByInfo(&$info, &$module, &$log)
public static function installBlockByInfo(&$info, &$module, &$log)
{
$handler =& xoops_gethandler('block');
$block =& $handler->create();
@@ -1176,7 +1176,7 @@ function installBlockByInfo(&$info, &$module, &$log)
/**
* @todo Need a message in the fail case.
*/
function uninstallBlockByFuncNum($func_num, &$module, &$log)
public static function uninstallBlockByFuncNum($func_num, &$module, &$log)
{
$handler =& xoops_getmodulehandler('newblocks', 'legacy');
@@ -1209,7 +1209,7 @@ function uninstallBlockByFuncNum($func_num, &$module, &$log)
* This method users template handlers of the kernel. But, if they are hooked,
* they may not do something. So, abstraction mechanism is possible enough.
*/
function _uninstallBlockTemplate(&$block, &$module, $tplset, &$log)
public static function _uninstallBlockTemplate(&$block, &$module, $tplset, &$log)
{
$handler =& xoops_gethandler('tplfile');
$criteria =new CriteriaCompo();
@@ -1226,7 +1226,7 @@ function _uninstallBlockTemplate(&$block, &$module, $tplset, &$log)
$handler->deleteAll($criteria);
}
function uninstallBlockTemplate(&$block, &$module, &$log)
public static function uninstallBlockTemplate(&$block, &$module, &$log)
{
Legacy_ModuleInstallUtils::_uninstallBlockTemplate($block, $module, null, $log);
}
@@ -1235,12 +1235,12 @@ function uninstallBlockTemplate(&$block, &$module, &$log)
* @public
* Removes a template data from only default group of some render-system.
*/
function clearBlockTemplateForUpdate(&$block, &$module, &$log)
public static function clearBlockTemplateForUpdate(&$block, &$module, &$log)
{
Legacy_ModuleInstallUtils::_uninstallBlockTemplate($block, $module, 'default', $log);
}
function uninstallPreferenceByOrder($order, &$module, &$log)
public static function uninstallPreferenceByOrder($order, &$module, &$log)
{
$handler =& xoops_gethandler('config');
@@ -1264,7 +1264,7 @@ function uninstallPreferenceByOrder($order, &$module, &$log)
/**
* Executes SQL query as cube style.
*/
function DBquery($query, &$module, $log)
public static function DBquery($query, &$module, $log)
{
require_once XOOPS_MODULE_PATH . "/legacy/admin/class/Legacy_SQLScanner.class.php";
@@ -1293,14 +1293,14 @@ function DBquery($query, &$module, $log)
return $successFlag;
}
function deleteAllOfNotifications(&$module, &$log)
public static function deleteAllOfNotifications(&$module, &$log)
{
$handler =& xoops_gethandler('notification');
$criteria =new Criteria('not_modid', $module->get('mid'));
$handler->deleteAll($criteria);
}
function deleteAllOfComments(&$module, &$log)
public static function deleteAllOfComments(&$module, &$log)
{
$handler =& xoops_gethandler('comment');
$criteria =new Criteria('com_modid', $module->get('mid'));

0 comments on commit 528c80a

Please sign in to comment.