Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
apc
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
apc
Commits
418e3ee5
Commit
418e3ee5
authored
7 months ago
by
Alberto Paderno
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3462880
: Remove the code that handles $_SESSION['cache_expiration']
parent
6f8166be
No related branches found
No related tags found
1 merge request
!18
Issue #3462880: Remove the code that handles $_SESSION['cache_expiration']
Pipeline
#230337
passed
7 months ago
Stage: build
Stage: validate
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drupal_apc_cache.inc
+4
-21
4 additions, 21 deletions
drupal_apc_cache.inc
with
4 additions
and
21 deletions
drupal_apc_cache.inc
+
4
−
21
View file @
418e3ee5
...
...
@@ -5,6 +5,8 @@
* Contains DrupalApcCache.
*/
// phpcs:disable SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.NullCoalesceOperatorNotUsed
/**
* Statistics about the APCu cache.
*/
...
...
@@ -152,10 +154,7 @@ public function get($cid) {
// Add a get to our statistics.
$GLOBALS
[
'_apc_statistics'
][]
=
array
(
'get'
,
$this
->
bin
,
array
(
$cid
));
// Fetch the data.
$cache
=
apcu_fetch
(
$this
->
key
(
$cid
));
return
$this
->
prepareItem
(
$cache
);
return
$this
->
prepareItem
(
apcu_fetch
(
$this
->
key
(
$cid
)));
}
/**
...
...
@@ -171,23 +170,7 @@ public function get($cid) {
* load.
*/
protected
function
prepareItem
(
$cache
)
{
if
(
!
isset
(
$cache
->
data
))
{
return
FALSE
;
}
$cache_lifetime
=
variable_get
(
'cache_lifetime'
,
0
);
$expired
=
isset
(
$_SESSION
[
'cache_expiration'
][
$this
->
bin
])
&&
$_SESSION
[
'cache_expiration'
][
$this
->
bin
]
>
$cache
->
created
;
$expires
=
$cache
->
expire
!=
CACHE_PERMANENT
;
// If the cached data is temporary and subject to a per-user minimum
// lifetime, compare the cache entry timestamp with the user session
// cache_expiration timestamp. If the cache entry is too old, ignore it.
if
(
$expires
&&
$cache_lifetime
&&
$expired
)
{
// Ignore cache data that is too old and thus not valid for this user.
return
FALSE
;
}
return
$cache
;
return
isset
(
$cache
->
data
)
?
$cache
->
data
:
FALSE
;
}
/**
...
...
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