/** * smartUpdateAllOfConfigs * * @param XoopsModule &$module * @param Legacy_ModuleInstallLog &$log * * @return void **/ public static function smartUpdateAllOfConfigs(&$module, &$log) { $dirname = $module->get('dirname'); $fileReader = new Legacy_ModinfoX2FileReader($dirname); $dbReader = new Legacy_ModinfoX2DBReader($dirname); $configs =& $dbReader->loadPreferenceInformations(); $configs->update($fileReader->loadPreferenceInformations()); foreach ($configs->mPreferences as $config) { switch ($config->mStatus) { case LEGACY_INSTALLINFO_STATUS_UPDATED: Legroup_InstallUtils::updateConfigByInfo($config, $module, $log); break; case LEGACY_INSTALLINFO_STATUS_ORDER_UPDATED: Legroup_InstallUtils::updateConfigOrderByInfo($config, $module, $log); break; case LEGACY_INSTALLINFO_STATUS_NEW: Legroup_InstallUtils::installConfigByInfo($config, $module, $log); break; case LEGACY_INSTALLINFO_STATUS_DELETED: Legroup_InstallUtils::uninstallConfigByOrder($config->mOrder, $module, $log); break; default: break; } } }
/** * _updatePreferences * * @param void * * @return void **/ private function _updatePreferences() { Legroup_InstallUtils::smartUpdateAllOfConfigs($this->_mTargetXoopsModule, $this->mLog); }
/** * _uninstallPreferences * * @param void * * @return void **/ private function _uninstallPreferences() { Legroup_InstallUtils::uninstallAllOfConfigs($this->_mXoopsModule, $this->mLog); }