Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
expire
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
drupal.org
expire
Commits
c5c6e964
Commit
c5c6e964
authored
Dec 21, 2010
by
Mike Carper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1002002 by fgm, mikeytown2: Allow other modules to modify the expire list.
parent
07ac0071
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
expire.module
expire.module
+8
-7
No files found.
expire.module
View file @
c5c6e964
...
...
@@ -101,7 +101,7 @@ function expire_user($op, &$edit, &$account, $category = NULL) {
// Expire the relevant user page from the static page cache to prevent serving stale content:
if
(
!
empty
(
$account
->
uid
))
{
$paths
[]
=
'user/'
.
$account
->
uid
;
$flushed
=
expire_cache_derivative
(
$account
,
$paths
,
TRUE
,
TRUE
);
$flushed
=
expire_cache_derivative
(
$account
,
$paths
);
watchdog
(
'expire'
,
'User !uid was deleted resulting in !flushed pages being expired from the cache'
,
array
(
'!uid'
=>
$account
->
uid
,
'!flushed'
=>
$flushed
,
...
...
@@ -208,7 +208,7 @@ function expire_node($node) {
// Flush array of paths
if
(
!
empty
(
$paths
))
{
$flushed
=
expire_cache_derivative
(
$node
,
$paths
,
TRUE
);
$flushed
=
expire_cache_derivative
(
$node
,
$paths
);
watchdog
(
'expire'
,
'Node !nid was flushed resulting in !flushed pages being expired from the cache'
,
array
(
'!nid'
=>
$node
->
nid
,
'!flushed'
=>
$flushed
,
...
...
@@ -316,14 +316,12 @@ function expire_taxonomy_node_get_tids($nid) {
/**
* Finds all possible paths/redirects/aliases given the root path.
*
* @param $node
* node object
* @param $paths
* Array of current URLs
* @param $both
* Expire database & file
* @param $force_flush
* Override the settings and kill the file
*/
function
expire_cache_derivative
(
&
$node
,
$paths
,
$both
=
FALSE
,
$force_flush
=
FALSE
)
{
function
expire_cache_derivative
(
&
$node
,
$paths
)
{
global
$base_path
;
$expire
=
array
();
...
...
@@ -361,6 +359,9 @@ function expire_cache_derivative(&$node, $paths, $both = FALSE, $force_flush = F
}
}
// Allow other modules to modify the list prior to expiring
drupal_alter
(
'expire_cache'
,
$expire
,
$node
,
$paths
);
// Expire cached files
if
(
empty
(
$expire
))
{
return
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment