From: Tim Düsterhus Date: Thu, 9 Feb 2012 17:05:11 +0000 (+0100) Subject: Ignore .meta.php X-Git-Tag: 2.0.0_Beta_1~1358^2~17^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=611cdc014f2da0e5c83c8ab0f21b5f0a3e4ec8ed;p=GitHub%2FWoltLab%2FWCF.git Ignore .meta.php --- diff --git a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php index e046a95ef2..89180ae405 100755 --- a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php @@ -1,13 +1,16 @@ caches[$cacheDir] = array(); // get files in cache directory - $files = glob($cacheDir.'/*.php'); + try { + $directoryUtil = DirectoryUtil::getInstance($cacheDir); + } + catch(SystemException $e) { + return; + } + $files = $directoryUtil->getFileObjects(SORT_ASC, new Regex('\.php$')); // get additional file information if (is_array($files)) { foreach ($files as $file) { - $filesize = filesize($file); + if ($ignore !== null) if ($ignore->match($file)) continue; $_this->caches[$cacheDir][] = array( - 'filename' => basename($file), - 'filesize' => $filesize, - 'mtime' => filemtime($file), - 'perm' => substr(sprintf('%o', fileperms($file)), -3), - 'writable' => is_writable($file) + 'filename' => $file->getBasename(), + 'filesize' => $file->getSize(), + 'mtime' => $file->getMtime(), + 'perm' => substr(sprintf('%o', $file->getPerms()), -3), + 'writable' => $file->isWritable() ); $_this->cacheData['files']++; - $_this->cacheData['size'] += $filesize; + $_this->cacheData['size'] += $file->getSize(); } } }; @@ -176,8 +185,8 @@ class CacheListPage extends AbstractPage { } $readFileCache(WCF_DIR.'language'); - $readFileCache(WCF_DIR.'templates/compiled'); - $readFileCache(WCF_DIR.'acp/templates/compiled'); + $readFileCache(WCF_DIR.'templates/compiled', new Regex('\.meta\.php$')); + $readFileCache(WCF_DIR.'acp/templates/compiled', new Regex('\.meta\.php$')); } /**