Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Redis Object Cache
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
WP Plugins
Redis Object Cache
Commits
452bcba0
Commit
452bcba0
authored
11 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup
parent
62501e39
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
object-cache.php
+10
-23
10 additions, 23 deletions
object-cache.php
with
10 additions
and
23 deletions
object-cache.php
+
10
−
23
View file @
452bcba0
...
...
@@ -10,11 +10,10 @@
* @param string $group The group value appended to the $key.
* @param int $expiration The expiration time, defaults to 0.
*
* @return bool
Returns TRUE on success or FALSE on failure.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function
wp_cache_add
(
$key
,
$value
,
$group
=
''
,
$expiration
=
0
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
add
(
$key
,
$value
,
$group
,
$expiration
);
}
...
...
@@ -26,8 +25,6 @@ function wp_cache_add( $key, $value, $group = '', $expiration = 0 ) {
* does not mean that plugins can't implement this function when they need to
* make sure that the cache is cleaned up after WordPress no longer needs it.
*
* @since 2.0.0
*
* @return bool Always returns True
*/
function
wp_cache_close
()
{
...
...
@@ -41,11 +38,10 @@ function wp_cache_close() {
* @param int $offset The amount by which to decrement the item's value.
* @param string $group The group value appended to the $key.
*
* @return int|bool
Returns item's new value on success or FALSE on failure.
* @return int|bool Returns item's new value on success or FALSE on failure.
*/
function
wp_cache_decr
(
$key
,
$offset
=
1
,
$group
=
''
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
decrement
(
$key
,
$offset
,
$group
);
}
...
...
@@ -56,11 +52,10 @@ function wp_cache_decr( $key, $offset = 1, $group = '' ) {
* @param string $group The group value appended to the $key.
* @param int $time The amount of time the server will wait to delete the item in seconds.
*
* @return bool
Returns TRUE on success or FALSE on failure.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function
wp_cache_delete
(
$key
,
$group
=
''
,
$time
=
0
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
delete
(
$key
,
$group
,
$time
);
}
...
...
@@ -73,7 +68,6 @@ function wp_cache_delete( $key, $group = '', $time = 0 ) {
*/
function
wp_cache_flush
(
$delay
=
0
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
flush
(
$delay
);
}
...
...
@@ -85,11 +79,10 @@ function wp_cache_flush( $delay = 0 ) {
* @param string $key The key under which to store the value.
* @param string $group The group value appended to the $key.
*
* @return bool|mixed
Cached object value.
* @return bool|mixed Cached object value.
*/
function
wp_cache_get
(
$key
,
$group
=
''
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
get
(
$key
,
$group
);
}
...
...
@@ -100,11 +93,10 @@ function wp_cache_get( $key, $group = '' ) {
* @param int $offset The amount by which to increment the item's value.
* @param string $group The group value appended to the $key.
*
* @return int|bool
Returns item's new value on success or FALSE on failure.
* @return int|bool Returns item's new value on success or FALSE on failure.
*/
function
wp_cache_incr
(
$key
,
$offset
=
1
,
$group
=
''
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
increment
(
$key
,
$offset
,
$group
);
}
...
...
@@ -130,11 +122,10 @@ function wp_cache_init() {
* @param string $group The group value appended to the $key.
* @param int $expiration The expiration time, defaults to 0.
*
* @return bool
Returns TRUE on success or FALSE on failure.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function
wp_cache_replace
(
$key
,
$value
,
$group
=
''
,
$expiration
=
0
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
replace
(
$key
,
$value
,
$group
,
$expiration
);
}
...
...
@@ -148,11 +139,10 @@ function wp_cache_replace( $key, $value, $group = '', $expiration = 0 ) {
* @param string $group The group value appended to the $key.
* @param int $expiration The expiration time, defaults to 0.
*
* @return bool
Returns TRUE on success or FALSE on failure.
* @return bool Returns TRUE on success or FALSE on failure.
*/
function
wp_cache_set
(
$key
,
$value
,
$group
=
''
,
$expiration
=
0
)
{
global
$wp_object_cache
;
return
$wp_object_cache
->
set
(
$key
,
$value
,
$group
,
$expiration
);
}
...
...
@@ -406,8 +396,7 @@ class WP_Object_Cache {
* Invalidate all items in the cache.
*
* @param int $delay Number of seconds to wait before invalidating the items.
*
* @return bool Returns TRUE on success or FALSE on failure.
* @return bool Returns TRUE on success or FALSE on failure.
*/
public
function
flush
(
$delay
=
0
)
{
$delay
=
absint
(
$delay
);
...
...
@@ -428,8 +417,7 @@ class WP_Object_Cache {
*
* @param string $key The key under which to store the value.
* @param string $group The group value appended to the $key.
*
* @return bool|mixed Cached object value.
* @return bool|mixed Cached object value.
*/
public
function
get
(
$key
,
$group
=
'default'
)
{
$derived_key
=
$this
->
build_key
(
$key
,
$group
);
...
...
@@ -466,8 +454,7 @@ class WP_Object_Cache {
* @param mixed $value The value to store.
* @param string $group The group value appended to the $key.
* @param int $expiration The expiration time, defaults to 0.
*
* @return bool Returns TRUE on success or FALSE on failure.
* @return bool Returns TRUE on success or FALSE on failure.
*/
public
function
set
(
$key
,
$value
,
$group
=
'default'
,
$expiration
=
0
)
{
$derived_key
=
$this
->
build_key
(
$key
,
$group
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment