From 6b7e5c6ea52a34dd9a838171adcc0decbe03c6b9 Mon Sep 17 00:00:00 2001 From: donald_jackson Date: Wed, 26 Nov 2008 13:33:42 +0000 Subject: [PATCH] "knowledge tree explorer not logging in after 3.5.4 upgrade(SUP-1214)" KTS-3945 Merged clean-up code from trunk. --- lib/upgrades/UpgradeFunctions.inc.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/upgrades/UpgradeFunctions.inc.php b/lib/upgrades/UpgradeFunctions.inc.php index 2134d36..16f6e81 100644 --- a/lib/upgrades/UpgradeFunctions.inc.php +++ b/lib/upgrades/UpgradeFunctions.inc.php @@ -62,9 +62,10 @@ class UpgradeFunctions { '3.5.0' => array('cleanupOldKTAdminVersionNotifier', 'updateConfigFile35', 'registerIndexingTasks'), '3.5.2' => array('setStorageEngine','dropForeignKeys','dropPrimaryKeys','dropIndexes','createPrimaryKeys','createForeignKeys','createIndexes', 'removeSlashesFromObjects'), '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','removeOldSearchPlugins','addAutoIncrementToTables', 'addAutoIncrementToTables2'), - '3.5.4' => array('createIndexes', 'updateServerConfigSettings') + '3.5.4' => array('createIndexes'), + '3.5.4' => array('createIndexes', 'updateServerConfigSettings','removeOldFilesAndFolders354') ); - + var $descriptions = array( "rebuildSearchPermissions" => "Rebuild search permissions with updated algorithm", "setPermissionFolder" => "Set permission folder for each folder for simplified permissions management", @@ -97,6 +98,7 @@ class UpgradeFunctions { 'removeAdminVersionNotifier' => 'Remove the old Admin Version Notifier Plugin.', 'removeOldSearchPlugins' => 'Remove the old Search Plugins.', 'addAutoIncrementToTables' => 'Update all current db tables to use auto_increment.', + 'removeOldFilesAndFolders354' => 'Remove old files and folders that are no longer needed.', 'addAutoIncrementToTables2' => 'Update all new db tables to use auto_increment.', 'updateServerConfigSettings' => 'Update the configuration settings for the server with the correct port' ); @@ -1364,6 +1366,20 @@ class UpgradeFunctions { return true; } + // {{{ removeOldFilesAndFolders354 + function removeOldFilesAndFolders354() { + global $default; + $oldFile = KT_DIR . "/lib/sanitize.inc"; + if(file_exists($oldFile)) unlink($oldFile); + + // Files MUST be removed before folders and folders MUST be empty + $oldPath1 = KT_DIR . "/plugins/toolsdashlet/"; + UpgradeFunctions::rm_recursive($oldPath1); + + // FIXME: We should check that they all worked + return true; + } + function updateServerConfigSettings() { global $default; $port = $_SERVER['SERVER_PORT']+0; @@ -1375,6 +1391,7 @@ class UpgradeFunctions { } } + function rm_recursive($filepath) { if (is_dir($filepath) && !is_link($filepath)) -- libgit2 0.21.4