From 123a907382baf34e2cc1eb12d4c851b4794b55a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 18 Aug 2011 15:20:48 +0200 Subject: [PATCH] Renaming getFilesObj to getFileObjects. There were no uses outside that class --- .../files/lib/util/DirectoryUtil.class.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/wcfsetup/install/files/lib/util/DirectoryUtil.class.php b/wcfsetup/install/files/lib/util/DirectoryUtil.class.php index 5bad7831b4..734cb37c3b 100644 --- a/wcfsetup/install/files/lib/util/DirectoryUtil.class.php +++ b/wcfsetup/install/files/lib/util/DirectoryUtil.class.php @@ -30,7 +30,7 @@ class DirectoryUtil { * * @var array<\DirectoryIterator> */ - protected $filesObj = array(); + protected $fileObjects = array(); /** * directory size in bytes @@ -163,10 +163,10 @@ class DirectoryUtil { * @param boolean $negativeMatch should the pattern be inversed * @return array<\DirectoryIterator> */ - public function getFilesObj($order = SORT_ASC, $pattern = '', $negativeMatch = false) { + public function getFileObjects($order = SORT_ASC, $pattern = '', $negativeMatch = false) { // scan the folder - $this->scanFilesObj(); - $objects = $this->filesObj; + $this->scanFileObjects(); + $objects = $this->fileObjects; // sort out non matching files if (!empty($pattern)) { @@ -218,15 +218,15 @@ class DirectoryUtil { } // add the directory itself - $this->filesObj[$this->directory] = $this->directory; + $this->files[$this->directory] = $this->directory; } /** * Fills the list of available files, with DirectoryIterator object as value */ - protected function scanFilesObj() { + protected function scanFileObjects() { // value is cached - if (!empty($this->filesObj)) return; + if (!empty($this->fileObjects)) return; if ($this->recursive) { $it = new \RecursiveIteratorIterator($this->obj, \RecursiveIteratorIterator::CHILD_FIRST); @@ -235,7 +235,7 @@ class DirectoryUtil { // ignore . and .. if ($it->isDot()) continue; - $this->filesObj[FileUtil::unifyDirSeperator($filename)] = $obj; + $this->fileObjects[FileUtil::unifyDirSeperator($filename)] = $obj; } } else { @@ -243,12 +243,12 @@ class DirectoryUtil { // ignore . and .. if ($this->obj->isDot()) continue; - $this->filesObj[FileUtil::unifyDirSeperator($obj->getFilename())] = $obj; + $this->fileObjects[FileUtil::unifyDirSeperator($obj->getFilename())] = $obj; } } // add the directory itself - $this->filesObj[$this->directory] = new \SPLFileInfo($this->directory); + $this->fileObjects[$this->directory] = new \SPLFileInfo($this->directory); } /** @@ -261,7 +261,7 @@ class DirectoryUtil { public function executeCallback($callback, $pattern = '') { if (!is_callable($callback)) return false; - $files = $this->getFilesObj(self::SORT_NONE, $pattern); + $files = $this->getFileObjects(self::SORT_NONE, $pattern); foreach ($files as $filename => $obj) { call_user_func($callback, $filename, $obj); } @@ -287,7 +287,7 @@ class DirectoryUtil { public function removePattern($pattern) { if (!$this->recursive) throw new SystemException('Removing of files only works in recursive mode'); - $files = $this->getFilesObj(self::SORT_NONE, $pattern); + $files = $this->getFileObjects(self::SORT_NONE, $pattern); foreach ($files as $filename => $obj) { if (!is_writable($obj->getPath())) { @@ -316,7 +316,7 @@ class DirectoryUtil { // read cached value first if ($this->size) return $this->size; - $files = $this->getFilesObj(self::SORT_NONE); + $files = $this->getFileObjects(self::SORT_NONE); foreach ($files as $obj) { $this->size += $obj->getSize(); } @@ -330,7 +330,7 @@ class DirectoryUtil { public function clearCaches() { // clear cached list of files $this->files = array(); - $this->filesObj = array(); + $this->fileObjects = array(); // clear cached size $this->size = 0; -- 2.20.1