From f9e2db906968bbf856af37be3c2ed75e51647e8f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 15 Oct 2012 04:13:24 +0200 Subject: [PATCH] Removes all cache files after package uninstallation Fixes #661 --- .../system/application/IApplication.class.php | 5 +++++ .../PackageUninstallationDispatcher.class.php | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/wcfsetup/install/files/lib/system/application/IApplication.class.php b/wcfsetup/install/files/lib/system/application/IApplication.class.php index 74f4d3537c..bdd37a5d01 100644 --- a/wcfsetup/install/files/lib/system/application/IApplication.class.php +++ b/wcfsetup/install/files/lib/system/application/IApplication.class.php @@ -20,4 +20,9 @@ interface IApplication { * @return mixed */ public static function __callStatic($method, array $arguments); + + /** + * Forces a reset of all application's cache files. + */ + public function resetCache(); } diff --git a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php index a082f38474..4f26a678a5 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php @@ -1,5 +1,7 @@ clear(WCF_DIR.'cache/', 'cache.*.php'); + + // remove application's cache + if (PACKAGE_ID != 1) { + ApplicationHandler::getInstance()->getPrimaryApplication()->resetCache(); + + foreach (ApplicationHandler::getInstance()->getDependentApplications() as $application) { + $application->resetCache(); + } + } + } } // return next node -- 2.20.1