Commit 33ba80936c9be8a8a104a69ee77df976e10fc27a

Authored by Kevin Fourie
1 parent 523c31d3

KTC-673

"'Zend Optimizer not installed' message when attempting to open KnowledgeTree after upgrade from 337Com - 346Com to 354Com on RHEL5"
Fixed. Files are now removed during upgrade.

Committed By: Kevin Fourie
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@9591 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/upgrades/UpgradeFunctions.inc.php
@@ -62,7 +62,7 @@ class UpgradeFunctions { @@ -62,7 +62,7 @@ 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') 65 + '3.5.4' => array('createIndexes','removeOldFilesAndFolders354')
66 ); 66 );
67 67
68 var $descriptions = array( 68 var $descriptions = array(
@@ -1363,6 +1363,20 @@ class UpgradeFunctions { @@ -1363,6 +1363,20 @@ class UpgradeFunctions {
1363 return true; 1363 return true;
1364 } 1364 }
1365 1365
  1366 + // {{{ removeOldFilesAndFolders354
  1367 + function removeOldFilesAndFolders354() {
  1368 + global $default;
  1369 + $oldFile = KT_DIR . "/lib/sanitize.inc";
  1370 + if(file_exists($oldFile)) unlink($oldFile);
  1371 +
  1372 + // Files MUST be removed before folders and folders MUST be empty
  1373 + $oldPath1 = KT_DIR . "/plugins/toolsdashlet/";
  1374 + UpgradeFunctions::rm_recursive($oldPath1);
  1375 +
  1376 + // FIXME: We should check that they all worked
  1377 + return true;
  1378 + }
  1379 +
1366 function rm_recursive($filepath) 1380 function rm_recursive($filepath)
1367 { 1381 {
1368 if (is_dir($filepath) && !is_link($filepath)) 1382 if (is_dir($filepath) && !is_link($filepath))