diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-29 17:58:05 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-29 17:58:05 +0000 |
| commit | eeae9d5c09399fa7cb89fe52d5676bf18fa61457 (patch) | |
| tree | 99a145f9d76192981486f57b24e74d53d8b2bb6d /wp-includes/cache.php | |
| parent | 5c7dc4bbad2e866713faf2b4cf73c1f9148c7001 (diff) | |
| download | wordpress-mu-eeae9d5c09399fa7cb89fe52d5676bf18fa61457.tar.gz wordpress-mu-eeae9d5c09399fa7cb89fe52d5676bf18fa61457.tar.xz wordpress-mu-eeae9d5c09399fa7cb89fe52d5676bf18fa61457.zip | |
Caching fixes, see http://mu.wordpress.org/forums/topic.php?id=3143&replies=23
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@872 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/cache.php')
| -rw-r--r-- | wp-includes/cache.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/wp-includes/cache.php b/wp-includes/cache.php index b4c5b89..6b02ba3 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -84,9 +84,12 @@ class WP_Object_Cache { if (false !== array_search($group, $this->global_groups))
$prefix = '';
else
- $prefix = $blog_id . ':';
+ $prefix = $blog_id . '-';
- return "$prefix$group:$key";
+ if( '' != $key )
+ $key = '-' . $key;
+
+ return "$prefix$group$key";
}
@@ -349,22 +352,21 @@ class WP_Object_Cache { // Loop over dirty objects and save them.
$errors = 0;
foreach ($this->dirty_objects as $group => $ids) {
- $group_key = $this->key( '', $group );
- $group_dir = $this->make_group_dir($group_key, $dir_perms);
+ $group_dir = $this->make_group_dir($group, $dir_perms);
$ids = array_unique($ids);
foreach ($ids as $id) {
- $cache_file = $group_dir.$this->hash($id).'.php';
+ $cache_file = $group_dir.$this->hash($group.'-'.$id).'.php';
// Remove the cache file if the key is not set.
- if (!isset ($this->cache[$group][$id])) {
+ if (!isset ($this->cache[$group.'-'.$id])) {
if (file_exists($cache_file))
@ unlink($cache_file);
continue;
}
$temp_file = tempnam($group_dir, 'tmp');
- $serial = CACHE_SERIAL_HEADER.base64_encode(serialize($this->cache[$group][$id])).CACHE_SERIAL_FOOTER;
+ $serial = CACHE_SERIAL_HEADER.base64_encode(serialize($this->cache[$group.'-'.$id])).CACHE_SERIAL_FOOTER;
$fd = @fopen($temp_file, 'w');
if ( false === $fd ) {
$errors++;
|
