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
08499267
Commit
08499267
authored
11 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Coding standards
parent
cc5b79a1
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
+8
-8
8 additions, 8 deletions
object-cache.php
with
8 additions
and
8 deletions
object-cache.php
+
8
−
8
View file @
08499267
...
@@ -378,8 +378,8 @@ class WP_Object_Cache {
...
@@ -378,8 +378,8 @@ class WP_Object_Cache {
// Check if conditions are right to continue
// Check if conditions are right to continue
if
(
if
(
(
$add
&&
isset
(
$this
->
cache
[
$derived_key
]
)
)
||
(
$add
&&
isset
(
$this
->
cache
[
$derived_key
]
)
)
||
(
!
$add
&&
!
isset
(
$this
->
cache
[
$derived_key
]
)
)
(
!
$add
&&
!
isset
(
$this
->
cache
[
$derived_key
]
)
)
)
{
)
{
return
false
;
return
false
;
}
}
...
@@ -420,8 +420,8 @@ class WP_Object_Cache {
...
@@ -420,8 +420,8 @@ class WP_Object_Cache {
// Remove from no_redis_groups array
// Remove from no_redis_groups array
if
(
in_array
(
$group
,
$this
->
no_redis_groups
)
||
!
$this
->
can_redis
()
)
{
if
(
in_array
(
$group
,
$this
->
no_redis_groups
)
||
!
$this
->
can_redis
()
)
{
if
(
isset
(
$this
->
cache
[
$derived_key
]
)
)
{
if
(
isset
(
$this
->
cache
[
$derived_key
]
)
)
{
unset
(
$this
->
cache
[
$derived_key
]
);
unset
(
$this
->
cache
[
$derived_key
]
);
return
true
;
return
true
;
}
else
{
}
else
{
...
@@ -431,7 +431,7 @@ class WP_Object_Cache {
...
@@ -431,7 +431,7 @@ class WP_Object_Cache {
$result
=
$this
->
parse_predis_response
(
$this
->
redis
->
del
(
$derived_key
)
);
$result
=
$this
->
parse_predis_response
(
$this
->
redis
->
del
(
$derived_key
)
);
unset
(
$this
->
cache
[
$derived_key
]
);
unset
(
$this
->
cache
[
$derived_key
]
);
return
$result
;
return
$result
;
}
}
...
@@ -470,9 +470,9 @@ class WP_Object_Cache {
...
@@ -470,9 +470,9 @@ class WP_Object_Cache {
$derived_key
=
$this
->
build_key
(
$key
,
$group
);
$derived_key
=
$this
->
build_key
(
$key
,
$group
);
if
(
in_array
(
$group
,
$this
->
no_redis_groups
)
||
!
$this
->
can_redis
()
)
{
if
(
in_array
(
$group
,
$this
->
no_redis_groups
)
||
!
$this
->
can_redis
()
)
{
if
(
isset
(
$this
->
cache
[
$derived_key
]
)
)
{
if
(
isset
(
$this
->
cache
[
$derived_key
]
)
)
{
$this
->
cache_hits
++
;
$this
->
cache_hits
++
;
return
is_object
(
$this
->
cache
[
$derived_key
]
)
?
clone
$this
->
cache
[
$derived_key
]
:
$this
->
cache
[
$derived_key
];
return
is_object
(
$this
->
cache
[
$derived_key
]
)
?
clone
$this
->
cache
[
$derived_key
]
:
$this
->
cache
[
$derived_key
];
}
else
{
}
else
{
$this
->
cache_misses
++
;
$this
->
cache_misses
++
;
return
false
;
return
false
;
...
@@ -680,7 +680,7 @@ class WP_Object_Cache {
...
@@ -680,7 +680,7 @@ class WP_Object_Cache {
* @param mixed $value Object value.
* @param mixed $value Object value.
*/
*/
public
function
add_to_internal_cache
(
$derived_key
,
$value
)
{
public
function
add_to_internal_cache
(
$derived_key
,
$value
)
{
$this
->
cache
[
$derived_key
]
=
$value
;
$this
->
cache
[
$derived_key
]
=
$value
;
}
}
/**
/**
...
...
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