Commit 6b7e5c6ea52a34dd9a838171adcc0decbe03c6b9
1 parent
19508f02
"knowledge tree explorer not logging in after 3.5.4 upgrade(SUP-1214)"
KTS-3945 Merged clean-up code from trunk. Committed by: Donald Jackson Reviewed by: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/branches/RB_3.5.4a@9624 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
19 additions
and
2 deletions
lib/upgrades/UpgradeFunctions.inc.php
| @@ -62,9 +62,10 @@ class UpgradeFunctions { | @@ -62,9 +62,10 @@ class UpgradeFunctions { | ||
| 62 | '3.5.0' => array('cleanupOldKTAdminVersionNotifier', 'updateConfigFile35', 'registerIndexingTasks'), | 62 | '3.5.0' => array('cleanupOldKTAdminVersionNotifier', 'updateConfigFile35', 'registerIndexingTasks'), |
| 63 | '3.5.2' => array('setStorageEngine','dropForeignKeys','dropPrimaryKeys','dropIndexes','createPrimaryKeys','createForeignKeys','createIndexes', 'removeSlashesFromObjects'), | 63 | '3.5.2' => array('setStorageEngine','dropForeignKeys','dropPrimaryKeys','dropIndexes','createPrimaryKeys','createForeignKeys','createIndexes', 'removeSlashesFromObjects'), |
| 64 | '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','removeOldSearchPlugins','addAutoIncrementToTables', 'addAutoIncrementToTables2'), | 64 | '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','removeOldSearchPlugins','addAutoIncrementToTables', 'addAutoIncrementToTables2'), |
| 65 | - '3.5.4' => array('createIndexes', 'updateServerConfigSettings') | 65 | + '3.5.4' => array('createIndexes'), |
| 66 | + '3.5.4' => array('createIndexes', 'updateServerConfigSettings','removeOldFilesAndFolders354') | ||
| 66 | ); | 67 | ); |
| 67 | - | 68 | + |
| 68 | var $descriptions = array( | 69 | var $descriptions = array( |
| 69 | "rebuildSearchPermissions" => "Rebuild search permissions with updated algorithm", | 70 | "rebuildSearchPermissions" => "Rebuild search permissions with updated algorithm", |
| 70 | "setPermissionFolder" => "Set permission folder for each folder for simplified permissions management", | 71 | "setPermissionFolder" => "Set permission folder for each folder for simplified permissions management", |
| @@ -97,6 +98,7 @@ class UpgradeFunctions { | @@ -97,6 +98,7 @@ class UpgradeFunctions { | ||
| 97 | 'removeAdminVersionNotifier' => 'Remove the old Admin Version Notifier Plugin.', | 98 | 'removeAdminVersionNotifier' => 'Remove the old Admin Version Notifier Plugin.', |
| 98 | 'removeOldSearchPlugins' => 'Remove the old Search Plugins.', | 99 | 'removeOldSearchPlugins' => 'Remove the old Search Plugins.', |
| 99 | 'addAutoIncrementToTables' => 'Update all current db tables to use auto_increment.', | 100 | 'addAutoIncrementToTables' => 'Update all current db tables to use auto_increment.', |
| 101 | + 'removeOldFilesAndFolders354' => 'Remove old files and folders that are no longer needed.', | ||
| 100 | 'addAutoIncrementToTables2' => 'Update all new db tables to use auto_increment.', | 102 | 'addAutoIncrementToTables2' => 'Update all new db tables to use auto_increment.', |
| 101 | 'updateServerConfigSettings' => 'Update the configuration settings for the server with the correct port' | 103 | 'updateServerConfigSettings' => 'Update the configuration settings for the server with the correct port' |
| 102 | ); | 104 | ); |
| @@ -1364,6 +1366,20 @@ class UpgradeFunctions { | @@ -1364,6 +1366,20 @@ class UpgradeFunctions { | ||
| 1364 | return true; | 1366 | return true; |
| 1365 | } | 1367 | } |
| 1366 | 1368 | ||
| 1369 | + // {{{ removeOldFilesAndFolders354 | ||
| 1370 | + function removeOldFilesAndFolders354() { | ||
| 1371 | + global $default; | ||
| 1372 | + $oldFile = KT_DIR . "/lib/sanitize.inc"; | ||
| 1373 | + if(file_exists($oldFile)) unlink($oldFile); | ||
| 1374 | + | ||
| 1375 | + // Files MUST be removed before folders and folders MUST be empty | ||
| 1376 | + $oldPath1 = KT_DIR . "/plugins/toolsdashlet/"; | ||
| 1377 | + UpgradeFunctions::rm_recursive($oldPath1); | ||
| 1378 | + | ||
| 1379 | + // FIXME: We should check that they all worked | ||
| 1380 | + return true; | ||
| 1381 | + } | ||
| 1382 | + | ||
| 1367 | function updateServerConfigSettings() { | 1383 | function updateServerConfigSettings() { |
| 1368 | global $default; | 1384 | global $default; |
| 1369 | $port = $_SERVER['SERVER_PORT']+0; | 1385 | $port = $_SERVER['SERVER_PORT']+0; |
| @@ -1375,6 +1391,7 @@ class UpgradeFunctions { | @@ -1375,6 +1391,7 @@ class UpgradeFunctions { | ||
| 1375 | } | 1391 | } |
| 1376 | } | 1392 | } |
| 1377 | 1393 | ||
| 1394 | + | ||
| 1378 | function rm_recursive($filepath) | 1395 | function rm_recursive($filepath) |
| 1379 | { | 1396 | { |
| 1380 | if (is_dir($filepath) && !is_link($filepath)) | 1397 | if (is_dir($filepath) && !is_link($filepath)) |