From: Tim Düsterhus Date: Fri, 1 Feb 2013 13:44:12 +0000 (+0100) Subject: Clean up compiled css when cache is cleared X-Git-Tag: 2.0.0_Beta_1~516^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1741b9047f59462b431c236c4fac6d670525e355;p=GitHub%2FWoltLab%2FWCF.git Clean up compiled css when cache is cleared --- diff --git a/wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php b/wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php index 24e5e6cc17..273d756c3f 100644 --- a/wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php @@ -5,6 +5,7 @@ use wcf\system\cache\CacheHandler; use wcf\system\exception\SystemException; use wcf\system\language\LanguageFactory; use wcf\system\request\LinkHandler; +use wcf\system\style\StyleHandler; use wcf\system\WCF; use wcf\util\FileUtil; use wcf\util\HeaderUtil; @@ -31,6 +32,9 @@ class CacheClearAction extends AbstractAction { public function execute() { parent::execute(); + // reset stylesheets + StyleHandler::resetStylesheets(); + // delete language cache and compiled templates as well LanguageFactory::getInstance()->deleteLanguageCache(); diff --git a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php index f3750ed014..0232e63205 100755 --- a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php @@ -157,6 +157,8 @@ class CacheListPage extends AbstractPage { $this->readCacheFiles('language', FileUtil::unifyDirSeperator(WCF_DIR.'language')); $this->readCacheFiles('template', FileUtil::unifyDirSeperator(WCF_DIR.'templates/compiled'), new Regex('\.meta\.php$')); $this->readCacheFiles('template', FileUtil::unifyDirSeperator(WCF_DIR.'acp/templates/compiled'), new Regex('\.meta\.php$')); + $this->readCacheFiles('style', FileUtil::unifyDirSeperator(WCF_DIR.'style'), null, 'css'); + $this->readCacheFiles('style', FileUtil::unifyDirSeperator(WCF_DIR.'acp/style'), new Regex('^WCFSetup.css$'), 'css'); } /** @@ -166,7 +168,7 @@ class CacheListPage extends AbstractPage { * @param strign $cacheDir * @param wcf\system\Regex $ignore */ - protected function readCacheFiles($cacheType, $cacheDir, Regex $ignore = null) { + protected function readCacheFiles($cacheType, $cacheDir, Regex $ignore = null, $extension = 'php') { if (!isset($this->cacheData[$cacheType])) { $this->cacheData[$cacheType] = array(); } @@ -179,7 +181,7 @@ class CacheListPage extends AbstractPage { return; } - $files = $directoryUtil->getFileObjects(SORT_ASC, new Regex('\.php$')); + $files = $directoryUtil->getFileObjects(SORT_ASC, new Regex('\.'.$extension.'$')); // get additional file information $data = array(); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 2f872ab94c..67d2600e1e 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -56,6 +56,7 @@ +