Skip to content

Commit

Permalink
Merge pull request #10 from l3rady/bug-fix/wp_cache_flush_site_global…
Browse files Browse the repository at this point in the history
…_groups

wp_cache_flush_site doesnt flush global groups
  • Loading branch information
Scott Cariss committed Aug 11, 2015
2 parents 9dcaa96 + 671b63d commit 85e60bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Contributors: l3rady<br/>
Donate link: [http://l3rady.com/donate][2]<br/>
Tags: APC, object cache, backend, cache, performance, speed<br/>
Requires at least: 3.3<br/>
Tested up to: 4.2.2<br/>
Stable tag: 1.1.2
Tested up to: 4.2.4<br/>
Stable tag: 1.1.3

WordPress APC Object Cache Backend provides a persistent memory-based backend for the WordPress object cache.

Expand Down Expand Up @@ -40,6 +40,9 @@ Define `WP_APC_KEY_SALT` to something that is unique for each install (like an m

## Changelog ##

### 1.1.3 ###
+ BUGFIX: Fix `wp_cache_flush_site()` to flush global groups [See][10]

### 1.1.2 ###
+ BUGFIX: Fix site cache key not saving in `_set_cache_version()` [See][9]

Expand Down Expand Up @@ -68,4 +71,5 @@ Define `WP_APC_KEY_SALT` to something that is unique for each install (like an m
[6]: https://github.com/l3rady/WordPress-APC-Object-Cache/pull/2
[7]: https://github.com/l3rady/WordPress-APC-Object-Cache/pull/1
[8]: https://github.com/l3rady/WordPress-APC-Object-Cache/pull/7
[9]: https://github.com/l3rady/WordPress-APC-Object-Cache/pull/9
[9]: https://github.com/l3rady/WordPress-APC-Object-Cache/pull/9
[10]: https://github.com/l3rady/WordPress-APC-Object-Cache/pull/10
7 changes: 6 additions & 1 deletion object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: WordPress APC Object Cache Backend
Plugin URI: https://github.com/l3rady/WordPress-APC-Object-Cache
Description: APC backend for WordPress' Object Cache
Version: 1.1.2
Version: 1.1.3
Author: Scott Cariss
Author URI: http://l3rady.com
*/
Expand Down Expand Up @@ -663,6 +663,11 @@ public function flush_sites( $sites ) {
$sites = array( $this->blog_prefix );
}

// Add global groups (site 0) to be flushed.
if ( !in_array( 0, $sites ) ) {
$sites[] = 0;
}

foreach ( $sites as $site ) {
$version = $this->_get_site_cache_version( $site );
$version++;
Expand Down

0 comments on commit 85e60bc

Please sign in to comment.