Skip to content

Commit

Permalink
[legacy] add public static keyword to all functions of ModuleInstal…
Browse files Browse the repository at this point in the history
…lUtils
  • Loading branch information
nao-pon committed Apr 20, 2015
1 parent 4e52532 commit 528c80a
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions html/modules/legacy/admin/class/ModuleInstallUtils.class.php
Expand Up @@ -72,7 +72,7 @@ class Legacy_ModuleInstallUtils
* This is factory for the installer. The factory reads xoops_version * This is factory for the installer. The factory reads xoops_version
* without modulehandler, to prevent cache in modulehandler. * without modulehandler, to prevent cache in modulehandler.
*/ */
function &createInstaller($dirname) public static function &createInstaller($dirname)
{ {
$installer =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'installer', 'Legacy_ModuleInstaller'); $installer =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'installer', 'Legacy_ModuleInstaller');
return $installer; return $installer;
Expand All @@ -82,7 +82,7 @@ function &createInstaller($dirname)
* This is factory for the updater. The factory reads xoops_version * This is factory for the updater. The factory reads xoops_version
* without modulehandler, to prevent cache in modulehandler. * without modulehandler, to prevent cache in modulehandler.
*/ */
function &createUpdater($dirname) public static function &createUpdater($dirname)
{ {
$updater =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'updater', 'Legacy_ModulePhasedUpgrader'); $updater =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'updater', 'Legacy_ModulePhasedUpgrader');
return $updater; return $updater;
Expand All @@ -92,7 +92,7 @@ function &createUpdater($dirname)
* This is factory for the uninstaller. The factory reads xoops_version * This is factory for the uninstaller. The factory reads xoops_version
* without modulehandler, to prevent cache in modulehandler. * without modulehandler, to prevent cache in modulehandler.
*/ */
function &createUninstaller($dirname) public static function &createUninstaller($dirname)
{ {
$uninstaller =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'uninstaller', 'Legacy_ModuleUninstaller'); $uninstaller =& Legacy_ModuleInstallUtils::_createInstaller($dirname, 'uninstaller', 'Legacy_ModuleUninstaller');
return $uninstaller; return $uninstaller;
Expand All @@ -105,7 +105,7 @@ function &createUninstaller($dirname)
* @param string $mode 'installer' 'updater' or 'uninstaller' * @param string $mode 'installer' 'updater' or 'uninstaller'
* @param string $defaultClassName * @param string $defaultClassName
*/ */
function &_createInstaller($dirname, $mode, $defaultClassName) public static function &_createInstaller($dirname, $mode, $defaultClassName)
{ {
$info = array(); $info = array();


Expand Down Expand Up @@ -151,7 +151,7 @@ function &_createInstaller($dirname, $mode, $defaultClassName)
* @param Legacy_ModuleInstallLog $log * @param Legacy_ModuleInstallLog $log
* @note FOR THE CUSTOM-INSTALLER * @note FOR THE CUSTOM-INSTALLER
*/ */
function installSQLAutomatically(&$module, &$log) public static function installSQLAutomatically(&$module, &$log)
{ {
$dbTypeAliases = array( $dbTypeAliases = array(
'mysqli' => 'mysql' 'mysqli' => 'mysql'
Expand Down Expand Up @@ -261,7 +261,7 @@ function installSQLAutomatically(&$module, &$log)
* @note FOR THE CUSTOM-INSTALLER * @note FOR THE CUSTOM-INSTALLER
* @see Legacy_ModuleInstallUtils::uninstallAllOfModuleTemplates() * @see Legacy_ModuleInstallUtils::uninstallAllOfModuleTemplates()
*/ */
function installAllOfModuleTemplates(&$module, &$log) public static function installAllOfModuleTemplates(&$module, &$log)
{ {
$templates = $module->getInfo('templates'); $templates = $module->getInfo('templates');
if ($templates != false) { if ($templates != false) {
Expand All @@ -288,7 +288,7 @@ function installAllOfModuleTemplates(&$module, &$log)
* @note This is not usefull a litte for custom-installers. * @note This is not usefull a litte for custom-installers.
* @todo We'll need the way to specify the template by identity or others. * @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'); $tplHandler =& xoops_gethandler('tplfile');


Expand Down Expand Up @@ -350,7 +350,7 @@ function installModuleTemplate($module, $template, &$log)
* @note FOR THE CUSTOM-INSTALLER * @note FOR THE CUSTOM-INSTALLER
* @see Legacy_ModuleInstallUtils::installAllOfModuleTemplates() * @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. // The following processing depends on the structure of Legacy_RenderSystem.
Expand All @@ -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); Legacy_ModuleInstallUtils::_uninstallAllOfModuleTemplates($module, null, $log);
} }


function clearAllOfModuleTemplatesForUpdate(&$module, &$log) public static function clearAllOfModuleTemplatesForUpdate(&$module, &$log)
{ {
Legacy_ModuleInstallUtils::_uninstallAllOfModuleTemplates($module, 'default', $log); Legacy_ModuleInstallUtils::_uninstallAllOfModuleTemplates($module, 'default', $log);
} }
Expand All @@ -396,7 +396,7 @@ function clearAllOfModuleTemplatesForUpdate(&$module, &$log)
* @note FOR THE CUSTOM-INSTALLER * @note FOR THE CUSTOM-INSTALLER
* @see Legacy_ModuleInstallUtils::uninstallAllOfBlocks() * @see Legacy_ModuleInstallUtils::uninstallAllOfBlocks()
*/ */
function installAllOfBlocks(&$module, &$log) public static function installAllOfBlocks(&$module, &$log)
{ {
$definedBlocks = $module->getInfo('blocks'); $definedBlocks = $module->getInfo('blocks');
if($definedBlocks == false) { if($definedBlocks == false) {
Expand Down Expand Up @@ -466,7 +466,7 @@ function installAllOfBlocks(&$module, &$log)
* @see Legacy_ModuleInstallUtils::installAllOfBlocks() * @see Legacy_ModuleInstallUtils::installAllOfBlocks()
* @see Legacy_ModuleInstallUtils::uninstallBlock() * @see Legacy_ModuleInstallUtils::uninstallBlock()
*/ */
function uninstallAllOfBlocks(&$module, &$log) public static function uninstallAllOfBlocks(&$module, &$log)
{ {
$handler =& xoops_gethandler('block'); $handler =& xoops_gethandler('block');
$criteria = new Criteria('mid', $module->get('mid')); $criteria = new Criteria('mid', $module->get('mid'));
Expand All @@ -488,7 +488,7 @@ function uninstallAllOfBlocks(&$module, &$log)
* @param $block array * @param $block array
* @return XoopsBlock * @return XoopsBlock
*/ */
function &createBlockByInfo(&$module, $block, $func_num) public static function &createBlockByInfo(&$module, $block, $func_num)
{ {
$options = isset($block['options']) ? $block['options'] : null; $options = isset($block['options']) ? $block['options'] : null;
$edit_func = isset($block['edit_func']) ? $block['edit_func'] : null; $edit_func = isset($block['edit_func']) ? $block['edit_func'] : null;
Expand Down Expand Up @@ -537,7 +537,7 @@ function &createBlockByInfo(&$module, $block, $func_num)
* @param $block array * @param $block array
* @return bool * @return bool
*/ */
function installBlock(&$module, &$blockObj, &$block, &$log) public static function installBlock(&$module, &$blockObj, &$block, &$log)
{ {
$isNew = $blockObj->isNew(); $isNew = $blockObj->isNew();
$blockHandler =& xoops_gethandler('block'); $blockHandler =& xoops_gethandler('block');
Expand Down Expand Up @@ -612,7 +612,7 @@ function installBlock(&$module, &$blockObj, &$block, &$log)
* *
* @todo error handling & delete the block's template. * @todo error handling & delete the block's template.
*/ */
function uninstallBlock(&$block, &$log) public static function uninstallBlock(&$block, &$log)
{ {
$blockHandler =& xoops_gethandler('block'); $blockHandler =& xoops_gethandler('block');
$blockHandler->delete($block); $blockHandler->delete($block);
Expand All @@ -634,7 +634,7 @@ function uninstallBlock(&$block, &$log)
* to database. * to database.
* @return bool * @return bool
*/ */
function installBlockTemplate(&$block, &$module, &$log) public static function installBlockTemplate(&$block, &$module, &$log)
{ {
if ($block->get('template') == null) { if ($block->get('template') == null) {
return true; return true;
Expand Down Expand Up @@ -682,7 +682,7 @@ function installBlockTemplate(&$block, &$module, &$log)
* *
* @note This is must, but it depends on ... * @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 // Load template data
Expand Down Expand Up @@ -714,7 +714,7 @@ function readTemplateFile($dirname, $fileName, $isblock = false)
return $tpldata; return $tpldata;
} }


function installAllOfConfigs(&$module, &$log) public static function installAllOfConfigs(&$module, &$log)
{ {
$dirname = $module->get('dirname'); $dirname = $module->get('dirname');


Expand Down Expand Up @@ -743,7 +743,7 @@ function installAllOfConfigs(&$module, &$log)
} }
} }


function installPreferenceByInfo(&$info, &$module, &$log) public static function installPreferenceByInfo(&$info, &$module, &$log)
{ {
$handler =& xoops_gethandler('config'); $handler =& xoops_gethandler('config');
$config =& $handler->createConfig(); $config =& $handler->createConfig();
Expand Down Expand Up @@ -778,7 +778,7 @@ function installPreferenceByInfo(&$info, &$module, &$log)
/** /**
* Get & build config items from Manifesto by specific module object. * Get & build config items from Manifesto by specific module object.
*/ */
function &getConfigInfosFromManifesto(&$module) public static function &getConfigInfosFromManifesto(&$module)
{ {
$configInfos = $module->getInfo('config'); $configInfos = $module->getInfo('config');


Expand Down Expand Up @@ -868,7 +868,7 @@ function &getConfigInfosFromManifesto(&$module)
* *
* @param $module XoopsModule * @param $module XoopsModule
*/ */
function uninstallAllOfConfigs(&$module, &$log) public static function uninstallAllOfConfigs(&$module, &$log)
{ {
if ($module->get('hasconfig') == 0) { if ($module->get('hasconfig') == 0) {
return; return;
Expand All @@ -886,7 +886,7 @@ function uninstallAllOfConfigs(&$module, &$log)
} }
} }


function smartUpdateAllOfBlocks(&$module, &$log) public static function smartUpdateAllOfBlocks(&$module, &$log)
{ {
$dirname = $module->get('dirname'); $dirname = $module->get('dirname');


Expand Down Expand Up @@ -919,7 +919,7 @@ function smartUpdateAllOfBlocks(&$module, &$log)
} }
} }


function smartUpdateAllOfPreferences(&$module, &$log) public static function smartUpdateAllOfPreferences(&$module, &$log)
{ {
$dirname = $module->get('dirname'); $dirname = $module->get('dirname');


Expand Down Expand Up @@ -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'); $handler =& xoops_getmodulehandler('newblocks', 'legacy');


Expand All @@ -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'); $handler =& xoops_getmodulehandler('newblocks', 'legacy');


Expand Down Expand Up @@ -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'); $handler =& xoops_gethandler('config');


Expand Down Expand Up @@ -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'); $handler =& xoops_gethandler('config');


Expand All @@ -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'); $handler =& xoops_gethandler('block');
$block =& $handler->create(); $block =& $handler->create();
Expand Down Expand Up @@ -1176,7 +1176,7 @@ function installBlockByInfo(&$info, &$module, &$log)
/** /**
* @todo Need a message in the fail case. * @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'); $handler =& xoops_getmodulehandler('newblocks', 'legacy');


Expand Down Expand Up @@ -1209,7 +1209,7 @@ function uninstallBlockByFuncNum($func_num, &$module, &$log)
* This method users template handlers of the kernel. But, if they are hooked, * This method users template handlers of the kernel. But, if they are hooked,
* they may not do something. So, abstraction mechanism is possible enough. * 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'); $handler =& xoops_gethandler('tplfile');
$criteria =new CriteriaCompo(); $criteria =new CriteriaCompo();
Expand All @@ -1226,7 +1226,7 @@ function _uninstallBlockTemplate(&$block, &$module, $tplset, &$log)
$handler->deleteAll($criteria); $handler->deleteAll($criteria);
} }


function uninstallBlockTemplate(&$block, &$module, &$log) public static function uninstallBlockTemplate(&$block, &$module, &$log)
{ {
Legacy_ModuleInstallUtils::_uninstallBlockTemplate($block, $module, null, $log); Legacy_ModuleInstallUtils::_uninstallBlockTemplate($block, $module, null, $log);
} }
Expand All @@ -1235,12 +1235,12 @@ function uninstallBlockTemplate(&$block, &$module, &$log)
* @public * @public
* Removes a template data from only default group of some render-system. * 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); Legacy_ModuleInstallUtils::_uninstallBlockTemplate($block, $module, 'default', $log);
} }


function uninstallPreferenceByOrder($order, &$module, &$log) public static function uninstallPreferenceByOrder($order, &$module, &$log)
{ {
$handler =& xoops_gethandler('config'); $handler =& xoops_gethandler('config');


Expand All @@ -1264,7 +1264,7 @@ function uninstallPreferenceByOrder($order, &$module, &$log)
/** /**
* Executes SQL query as cube style. * 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"; require_once XOOPS_MODULE_PATH . "/legacy/admin/class/Legacy_SQLScanner.class.php";


Expand Down Expand Up @@ -1293,14 +1293,14 @@ function DBquery($query, &$module, $log)
return $successFlag; return $successFlag;
} }


function deleteAllOfNotifications(&$module, &$log) public static function deleteAllOfNotifications(&$module, &$log)
{ {
$handler =& xoops_gethandler('notification'); $handler =& xoops_gethandler('notification');
$criteria =new Criteria('not_modid', $module->get('mid')); $criteria =new Criteria('not_modid', $module->get('mid'));
$handler->deleteAll($criteria); $handler->deleteAll($criteria);
} }


function deleteAllOfComments(&$module, &$log) public static function deleteAllOfComments(&$module, &$log)
{ {
$handler =& xoops_gethandler('comment'); $handler =& xoops_gethandler('comment');
$criteria =new Criteria('com_modid', $module->get('mid')); $criteria =new Criteria('com_modid', $module->get('mid'));
Expand Down

0 comments on commit 528c80a

Please sign in to comment.