From 298d10c1640a90ee108f6a6e6d5e94d6abf59054 Mon Sep 17 00:00:00 2001 From: megan_w Date: Mon, 1 Dec 2008 14:11:22 +0000 Subject: [PATCH] Added registerPlugins() at the end of the upgrade and after enabling/disabling plugins. --- plugins/ktcore/admin/plugins.php | 2 ++ setup/upgrade.php | 26 ++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/plugins/ktcore/admin/plugins.php b/plugins/ktcore/admin/plugins.php index f192ebc..e31fc69 100755 --- a/plugins/ktcore/admin/plugins.php +++ b/plugins/ktcore/admin/plugins.php @@ -148,6 +148,8 @@ class KTPluginDispatcher extends KTAdminDispatcher { } } + // we reregister the plugins to ensure they are in the correct order + KTPluginUtil::registerPlugins(); $this->successRedirectToMain(_kt('Plugins updated')); } diff --git a/setup/upgrade.php b/setup/upgrade.php index d2eefd4..781c739 100644 --- a/setup/upgrade.php +++ b/setup/upgrade.php @@ -145,15 +145,11 @@ function performPostUpgradeActions() { global $default; - // Unlock the scheduler - $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock'; - if(file_exists($lockFile)){ - unlink($lockFile); - } + // Ensure all plugins are registered. + $sql = "DELETE FROM plugin_helper"; + $res = DBUtil::runQuery($sql); - // Clear the configuration cache, it'll regenerate on next load - $oKTConfig = new KTConfig(); - $oKTConfig->clearCache(); + KTPluginUtil::registerPlugins(); // Clear out all caches and proxies - they need to be regenerated with the new code $proxyDir = $default->proxyCacheDirectory; @@ -162,11 +158,17 @@ function performPostUpgradeActions() { $oKTCache = new KTCache(); $oKTCache->deleteAllCaches(); - // Clean out the plugin_helper table - $sql = "DELETE FROM plugin_helper"; - $res = DBUtil::runQuery($sql); + // Clear the configuration cache, it'll regenerate on next load + $oKTConfig = new KTConfig(); + $oKTConfig->clearCache(); - return $res; + // Unlock the scheduler + $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock'; + if(file_exists($lockFile)){ + @unlink($lockFile); + } + + return true; } -- libgit2 0.21.4