Commit f54dd266 by Qiang Xue

reverted incorrect renaming.

parent 94fb8672
...@@ -225,10 +225,10 @@ class FileCache extends Cache ...@@ -225,10 +225,10 @@ class FileCache extends Cache
* Recursively removing expired cache files under a directory. * Recursively removing expired cache files under a directory.
* This method is mainly used by [[gc()]]. * This method is mainly used by [[gc()]].
* @param string $path the directory under which expired cache files are removed. * @param string $path the directory under which expired cache files are removed.
* @param boolean $durationdOnly whether to only remove expired cache files. If false, all files * @param boolean $expiredOnly whether to only remove expired cache files. If false, all files
* under `$path` will be removed. * under `$path` will be removed.
*/ */
protected function gcRecursive($path, $durationdOnly) protected function gcRecursive($path, $expiredOnly)
{ {
if (($handle = opendir($path)) !== false) { if (($handle = opendir($path)) !== false) {
while (($file = readdir($handle)) !== false) { while (($file = readdir($handle)) !== false) {
...@@ -237,11 +237,11 @@ class FileCache extends Cache ...@@ -237,11 +237,11 @@ class FileCache extends Cache
} }
$fullPath = $path . DIRECTORY_SEPARATOR . $file; $fullPath = $path . DIRECTORY_SEPARATOR . $file;
if (is_dir($fullPath)) { if (is_dir($fullPath)) {
$this->gcRecursive($fullPath, $durationdOnly); $this->gcRecursive($fullPath, $expiredOnly);
if (!$durationdOnly) { if (!$expiredOnly) {
@rmdir($fullPath); @rmdir($fullPath);
} }
} elseif (!$durationdOnly || $durationdOnly && @filemtime($fullPath) < time()) { } elseif (!$expiredOnly || $expiredOnly && @filemtime($fullPath) < time()) {
@unlink($fullPath); @unlink($fullPath);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment