/** * 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: Letag_InstallUtils::updateConfigByInfo($config, $module, $log); break; case LEGACY_INSTALLINFO_STATUS_ORDER_UPDATED: Letag_InstallUtils::updateConfigOrderByInfo($config, $module, $log); break; case LEGACY_INSTALLINFO_STATUS_NEW: Letag_InstallUtils::installConfigByInfo($config, $module, $log); break; case LEGACY_INSTALLINFO_STATUS_DELETED: Letag_InstallUtils::uninstallConfigByOrder($config->mOrder, $module, $log); break; default: break; } } }
/** * _installPreferences * * @param void * * @return void **/ private function _installPreferences() { Letag_InstallUtils::installAllOfConfigs($this->_mXoopsModule, $this->mLog); }
/** * _updatePreferences * * @param void * * @return void **/ private function _updatePreferences() { Letag_InstallUtils::smartUpdateAllOfConfigs($this->_mTargetXoopsModule, $this->mLog); }