Skip to content

Commit

Permalink
Delete cache from all hosts on a WP standard installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Jun 24, 2016
1 parent 641ef0b commit 411d88d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/includes/traits/Shared/CacheDirUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ public function deleteFilesFromHostCacheDir(
if (!is_dir($cache_dir = $this->cacheDir())) {
return $counter; // Nothing to do.
}
// On a standard installation delete from all hosts.
// See: <https://github.com/websharks/comet-cache/issues/608>
if (!is_multisite() && !$___considering_domain_mapping) {
$regex = ltrim($regex, '^\\/');

if (mb_strpos($regex, '(?:\/') === 0 || mb_strpos($regex, '(\/') === 0) {
$regex = '/^https?\/[^\/]+'.$regex;
} else {
$regex = '/^https?\/[^\/]+\/'.$regex;
}
return $this->deleteFilesFromCacheDir($regex, $check_max_age);
}
$cache_dir = $this->nDirSeps($cache_dir); // Normalize.
$host_token = $current_host_token = $this->hostToken();
$host_base_dir_tokens = $current_host_base_dir_tokens = $this->hostBaseDirTokens();
Expand Down

0 comments on commit 411d88d

Please sign in to comment.