Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ebfd886f
Commit
ebfd886f
authored
Aug 26, 2011
by
Dries
Browse files
- Patch
#1259096
by Akaoni: cache Bin cache_path() is never cleaned up.
parent
aa078127
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
ebfd886f
...
...
@@ -7138,7 +7138,7 @@ function drupal_flush_all_caches() {
// Don't clear cache_form - in-progress form submissions may break.
// Ordered so clearing the page cache will always be the last action.
$core
=
array
(
'cache'
,
'cache_filter'
,
'cache_bootstrap'
,
'cache_page'
);
$core
=
array
(
'cache'
,
'cache_path'
,
'cache_filter'
,
'cache_bootstrap'
,
'cache_page'
);
$cache_tables
=
array_merge
(
module_invoke_all
(
'flush_caches'
),
$core
);
foreach
(
$cache_tables
as
$table
)
{
cache_clear_all
(
'*'
,
$table
,
TRUE
);
...
...
modules/simpletest/tests/cache.test
View file @
ebfd886f
...
...
@@ -310,6 +310,27 @@ class CacheClearCase extends CacheTestCase {
||
$this
->
checkCacheExists
(
'test_cid_clear3'
,
$this
->
default_value
),
t
(
'All cache entries removed when the array exceeded the cache clear threshold.'
));
}
/**
* Test drupal_flush_all_caches().
*/
function
testFlushAllCaches
()
{
// Create cache entries for each flushed cache bin.
$bins
=
array
(
'cache'
,
'cache_filter'
,
'cache_page'
,
'cache_boostrap'
,
'cache_path'
);
$bins
=
array_merge
(
module_invoke_all
(
'flush_caches'
),
$bins
);
foreach
(
$bins
as
$id
=>
$bin
)
{
$id
=
'test_cid_clear'
.
$id
;
cache_set
(
$id
,
$this
->
default_value
,
$bin
);
}
// Remove all caches then make sure that they are cleared.
drupal_flush_all_caches
();
foreach
(
$bins
as
$id
=>
$bin
)
{
$id
=
'test_cid_clear'
.
$id
;
$this
->
assertFalse
(
$this
->
checkCacheExists
(
$id
,
$this
->
default_value
,
$bin
),
t
(
'All cache entries removed from @bin.'
,
array
(
'@bin'
=>
$bin
)));
}
}
}
/**
...
...
modules/system/system.module
View file @
ebfd886f
...
...
@@ -3004,7 +3004,7 @@ function system_cron() {
}
}
$core
=
array
(
'cache'
,
'cache_filter'
,
'cache_page'
,
'cache_form'
,
'cache_menu'
);
$core
=
array
(
'cache'
,
'cache_path'
,
'cache_filter'
,
'cache_page'
,
'cache_form'
,
'cache_menu'
);
$cache_tables
=
array_merge
(
module_invoke_all
(
'flush_caches'
),
$core
);
foreach
(
$cache_tables
as
$table
)
{
cache_clear_all
(
NULL
,
$table
);
...
...
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