Use ClearCacheCommand in CacheClearAction
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 10 Aug 2022 10:17:16 +0000 (12:17 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 10 Aug 2022 10:17:39 +0000 (12:17 +0200)
wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php

index 038f9c3ac0315b052098c3f0022708724e6671d3..28a2200580b54c9ad71a61832f7221a76cc4de50 100644 (file)
@@ -6,17 +6,14 @@ use Laminas\Diactoros\Response\EmptyResponse;
 use Laminas\Diactoros\Response\RedirectResponse;
 use wcf\acp\page\CacheListPage;
 use wcf\action\AbstractAction;
-use wcf\data\package\update\server\PackageUpdateServer;
-use wcf\system\cache\CacheHandler;
-use wcf\system\language\LanguageFactory;
+use wcf\system\cache\command\ClearCache;
 use wcf\system\request\LinkHandler;
-use wcf\system\style\StyleHandler;
 
 /**
  * Clears the cache.
  *
  * @author  Tim Duesterhus
- * @copyright   2001-2019 WoltLab GmbH
+ * @copyright   2001-2022 WoltLab GmbH
  * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package WoltLabSuite\Core\Acp\Action
  */
@@ -34,17 +31,8 @@ class CacheClearAction extends AbstractAction
     {
         parent::execute();
 
-        // reset stylesheets
-        StyleHandler::resetStylesheets();
-
-        // delete language cache and compiled templates as well
-        LanguageFactory::getInstance()->deleteLanguageCache();
-
-        // get package dirs
-        CacheHandler::getInstance()->flushAll();
-
-        // reset package update servers and the package cache
-        PackageUpdateServer::resetAll();
+        $command = new ClearCache();
+        $command();
 
         $this->executed();