Don't remove top level cache dir when flushing.
git-svn-id: https://develop.svn.wordpress.org/trunk@3402 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d702816be5
commit
04cd1038db
|
@ -217,6 +217,7 @@ class WP_Object_Cache {
|
||||||
function rm_cache_dir() {
|
function rm_cache_dir() {
|
||||||
$dir = $this->cache_dir;
|
$dir = $this->cache_dir;
|
||||||
$dir = rtrim($dir, DIRECTORY_SEPARATOR);
|
$dir = rtrim($dir, DIRECTORY_SEPARATOR);
|
||||||
|
$top_dir = $dir;
|
||||||
$stack = array($dir);
|
$stack = array($dir);
|
||||||
|
|
||||||
while (count($stack)) {
|
while (count($stack)) {
|
||||||
|
@ -238,7 +239,8 @@ class WP_Object_Cache {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (end($stack) == $dir) {
|
if (end($stack) == $dir) {
|
||||||
@ rmdir($dir);
|
if ( $dir != $top_dir)
|
||||||
|
@ rmdir($dir);
|
||||||
array_pop($stack);
|
array_pop($stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue