mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 3k
Delete Cache by Group #2368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
pbearne
wants to merge
50
commits into
WordPress:trunk
from
xwp:INITS-115-Support_flushing_cache_groups
Closed
Delete Cache by Group #2368
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
8a7dbb4
Added clearing of cache groups
pbearne bdca39b
Update src/wp-includes/cache.php
pbearne f87e341
removed full cache if group cache fails
pbearne a9b1db9
whitespace
pbearne 576d82c
comments
pbearne 21e6eac
refactor function and new test for new functions
pbearne f92ef14
dumped the function down
pbearne 7abf5d6
removed not needed tests
pbearne ee6f101
removed not needed function
pbearne 3d89efd
Merge branch 'trunk' into INITS-115-Support_flushing_cache_groups
pbearne baa5f32
Update src/wp-includes/cache.php
pbearne 9305962
Update src/wp-includes/class-wp-object-cache.php
pbearne 63730d5
Update src/wp-includes/class-wp-object-cache.php
pbearne a9a9e4d
Added fallback to cache-compat.php
pbearne ea41652
Merge remote-tracking branch 'origin/INITS-115-Support_flushing_cache…
pbearne 095ab96
Added wp_cache_flush_group to get_pluggable_function_signatures test
pbearne 8dcc405
Added array return if array is passed
pbearne a7bc773
removed not needed test wp_cache_get_linked_meta
pbearne 670e754
removed whitespace changes
pbearne fb650ec
Update src/wp-includes/cache.php
pbearne 2bcc284
Update src/wp-includes/cache.php
pbearne c65c89c
Update src/wp-includes/cache-compat.php
pbearne c03b962
Merge branch 'WordPress:trunk' into INITS-115-Support_flushing_cache_…
pbearne fcf0c8f
Update tests/phpunit/tests/cache.php
pbearne a65bc31
Update tests/phpunit/tests/cache.php
pbearne 26fcbd8
Update tests/phpunit/tests/cache.php
pbearne 7d715b7
Update src/wp-includes/cache-compat.php
pbearne 3f26680
moved helper class to includes
pbearne b8c19b0
Merge branch 'WordPress:trunk' into INITS-115-Support_flushing_cache_…
pbearne e890990
removed method exists check
pbearne a0f699d
removed method exists check
pbearne 47a5b5c
Merge branch 'WordPress:trunk' into INITS-115-Support_flushing_cache_…
pbearne d3ceb58
whitespaces
pbearne 593dc79
added flush_group to memcache test code
pbearne 4ecb1de
added flush_group to memcache test code
pbearne a26df6d
added check for method before calling
pbearne adac259
added check for method before calling
pbearne 1829e23
Update src/wp-includes/cache.php
pbearne e76618b
Update src/wp-includes/cache.php
pbearne d5e7ed8
Update src/wp-includes/cache-compat.php
pbearne 5e4433d
Update src/wp-includes/cache-compat.php
pbearne 63228eb
Update src/wp-includes/cache.php
pbearne 7f69e33
Update src/wp-includes/class-wp-object-cache.php
pbearne 73fbd0b
added constant WP_OBJECT_CACHE_SUPPORTS_GROUP_FLUSH
pbearne 156af11
Update src/wp-includes/cache.php
pbearne 85d09da
Update src/wp-includes/cache-compat.php
pbearne f3f143a
Added WP_OBJECT_CACHE_SUPPORTS_GROUP_FLUSH to the memcache test cache…
pbearne 3020e38
fixed whitespace
pbearne cd279c0
Update src/wp-includes/cache-compat.php
pbearne 91a50b8
Update tests/phpunit/tests/cache.php
pbearne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -415,4 +415,58 @@ public function test_wp_cache_delete_multiple() { | |||||||||||||||||||||||
|
||||||||||||||||||||||||
$this->assertSame( $expected, $found ); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
/** | ||||||||||||||||||||||||
* @ticket 4476 | ||||||||||||||||||||||||
* @ticket 9773 | ||||||||||||||||||||||||
* | ||||||||||||||||||||||||
* test wp_cache_flush_group | ||||||||||||||||||||||||
* | ||||||||||||||||||||||||
* @covers ::wp_cache_flush_group | ||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||
public function test_wp_cache_flush_group() { | ||||||||||||||||||||||||
$key = 'my-key'; | ||||||||||||||||||||||||
pbearne marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||
$val = 'my-val'; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
wp_cache_set( $key, $val, 'group-test' ); | ||||||||||||||||||||||||
wp_cache_set( $key, $val, 'group-kept' ); | ||||||||||||||||||||||||
$this->assertSame( $val, wp_cache_get( $key, 'group-test' ), 'test_wp_cache_flush_group: group-test should contain my-val' ); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
$results = wp_cache_flush_group( 'group-test' ); | ||||||||||||||||||||||||
$this->assertTrue( $results ); | ||||||||||||||||||||||||
$this->assertFalse( wp_cache_get( $key, 'group-test' ), 'test_wp_cache_flush_group: group-test should return false' ); | ||||||||||||||||||||||||
$this->assertSame( $val, wp_cache_get( $key, 'group-kept' ), 'test_wp_cache_flush_group: group-kept should still contain my-val' ); | ||||||||||||||||||||||||
Comment on lines
+436
to
+438
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
/** | ||||||||||||||||||||||||
* @ticket 4476 | ||||||||||||||||||||||||
* @ticket 9773 | ||||||||||||||||||||||||
* | ||||||||||||||||||||||||
* test wp_cache_flush_group with an array of groups | ||||||||||||||||||||||||
* | ||||||||||||||||||||||||
* @covers ::wp_cache_flush_groups | ||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||
public function test_wp_cache_flush_groups() { | ||||||||||||||||||||||||
$key = 'my-key'; | ||||||||||||||||||||||||
pbearne marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||
$val = 'my-val'; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
wp_cache_set( $key, $val, 'group-test' ); | ||||||||||||||||||||||||
wp_cache_set( $key, $val, 'group-test2' ); | ||||||||||||||||||||||||
wp_cache_set( $key, $val, 'group-kept' ); | ||||||||||||||||||||||||
$this->assertSame( $val, wp_cache_get( $key, 'group-test' ), 'test_wp_cache_flush_groups: group-test should contain my-val' ); | ||||||||||||||||||||||||
$this->assertSame( $val, wp_cache_get( $key, 'group-test2' ), 'test_wp_cache_flush_groups: group-test2 should contain my-val' ); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
$results = wp_cache_flush_group( array( 'group-test', 'group-test2' ) ); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
if ( wp_using_ext_object_cache() ) { | ||||||||||||||||||||||||
$this->assertWPError( $results ); | ||||||||||||||||||||||||
$this->assertSame( 'unsupported', $results->get_error_code() ); | ||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||
$this->assertIsArray( $results ); | ||||||||||||||||||||||||
$this->assertCount( 2, $results ); | ||||||||||||||||||||||||
$this->assertFalse( wp_cache_get( $key, 'group-test' ), 'test_wp_cache_flush_groups: group-test should return false' ); | ||||||||||||||||||||||||
$this->assertFalse( wp_cache_get( $key, 'group-test2' ), 'test_wp_cache_flush_groups: group-test2 should return false' ); | ||||||||||||||||||||||||
$this->assertSame( $val, wp_cache_get( $key, 'group-kept' ), 'test_wp_cache_flush_groups: group-kept should still contain my-val' ); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.