protected static function _upgradeDatabase($sqlFolderPath, $previousVersion, $latestVersion) { $files = RM_Filesystem::getFiles($sqlFolderPath, array('sql')); $upgradeVersions = array(); foreach ($files as $file) { if (strpos($file, '.upgrade.sql') !== false) { $upgradeVersions[] = str_replace('.upgrade.sql', '', $file); } } usort($upgradeVersions, 'version_compare'); $result = true; foreach ($upgradeVersions as $version) { if (version_compare($version, $previousVersion, '>') && version_compare($version, $latestVersion, '<=')) { $result &= RM_SQL_Manager::executeSQLFile($sqlFolderPath . DIRECTORY_SEPARATOR . $version . '.upgrade.sql'); } } return $result; }
/** * Uninstall database information for the plugin * * @param string $pluginFolderPath path to plugin folder * @return bool */ public static function uninstallDatabase($pluginFolderPath) { $filename = $pluginFolderPath . DIRECTORY_SEPARATOR . RM_Plugin_Config::SQL . DIRECTORY_SEPARATOR . RM_Plugin_Config::UNINSTALL_SQL; return RM_SQL_Manager::executeSQLFile($filename); }
/** * Uninstall database information for the module * * @param string $moduleFolderPath path to module folder * @return bool */ public static function uninstallDatabase($moduleFolderPath) { return RM_SQL_Manager::executeSQLFile($moduleFolderPath . DIRECTORY_SEPARATOR . RM_Module_Config::SQL . DIRECTORY_SEPARATOR . RM_Module_Config::UNINSTALL_SQL); }
/** * this will clear the form states */ public function clearForms() { $sqlPathArray = array("modules", "FormDesigner", "sql", "clearpanels.sql"); $sqlPath = RM_Environment::getConnector()->getCorePath() . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $sqlPathArray); return RM_SQL_Manager::executeSQLFile($sqlPath); }