Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
980cb9c5
Commit
980cb9c5
authored
Mar 20, 2013
by
Nathaniel Catchpole
Browse files
Issue
#1944646
by c960657: Remove CacheBackendInterface::deleteExpired().
parent
5d6cd82c
Changes
7
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Cache/BackendChain.php
View file @
980cb9c5
...
...
@@ -165,15 +165,6 @@ public function deleteAll() {
}
}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::expire().
*/
public
function
deleteExpired
()
{
foreach
(
$this
->
backends
as
$backend
)
{
$backend
->
deleteExpired
();
}
}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
*/
...
...
core/lib/Drupal/Core/Cache/CacheBackendInterface.php
View file @
980cb9c5
...
...
@@ -43,8 +43,8 @@
* @endcode
*
* There are two ways to "remove" a cache item:
* - Deletion (using delete(), deleteMultiple(), deleteTags()
,
deleteAll()
or
*
deleteExpired()):
Permanently removes the item from the cache.
* - Deletion (using delete(), deleteMultiple(), deleteTags()
or
deleteAll()
):
* Permanently removes the item from the cache.
* - Invalidation (using invalidate(), invalidateMultiple(), invalidateTags()
* or invalidateAll()): a "soft" delete that only marks the items as
* "invalid", meaning "not fresh" or "not fresh enough". Invalid items are
...
...
@@ -163,7 +163,6 @@ public function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANEN
* @see Drupal\Core\Cache\CacheBackendInterface::deleteMultiple()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteTags()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteAll()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteExpired()
*/
public
function
delete
(
$cid
);
...
...
@@ -183,7 +182,6 @@ public function delete($cid);
* @see Drupal\Core\Cache\CacheBackendInterface::delete()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteTags()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteAll()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteExpired()
*/
public
function
deleteMultiple
(
array
$cids
);
...
...
@@ -205,7 +203,6 @@ public function deleteMultiple(array $cids);
* @see Drupal\Core\Cache\CacheBackendInterface::delete()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteMultiple()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteAll()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteExpired()
*/
public
function
deleteTags
(
array
$tags
);
...
...
@@ -216,21 +213,9 @@ public function deleteTags(array $tags);
* @see Drupal\Core\Cache\CacheBackendInterface::delete()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteMultiple()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteTags()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteExpired()
*/
public
function
deleteAll
();
/**
* Deletes expired items from the cache.
*
* @see Drupal\Core\Cache\CacheBackendInterface::delete()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteMultiple()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteTags()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteAll()
* @see Drupal\Core\Cache\CacheBackendInterface::deleteExpired()
*/
public
function
deleteExpired
();
/**
* Marks a cache item as invalid.
*
...
...
core/lib/Drupal/Core/Cache/DatabaseBackend.php
View file @
980cb9c5
...
...
@@ -192,16 +192,6 @@ public function deleteAll() {
Database
::
getConnection
()
->
truncate
(
$this
->
bin
)
->
execute
();
}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteExpired().
*/
public
function
deleteExpired
()
{
Database
::
getConnection
()
->
delete
(
$this
->
bin
)
->
condition
(
'expire'
,
CacheBackendInterface
::
CACHE_PERMANENT
,
'<>'
)
->
condition
(
'expire'
,
REQUEST_TIME
,
'<'
)
->
execute
();
}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
*/
...
...
@@ -251,7 +241,10 @@ public function invalidateAll() {
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection().
*/
public
function
garbageCollection
()
{
$this
->
deleteExpired
();
Database
::
getConnection
()
->
delete
(
$this
->
bin
)
->
condition
(
'expire'
,
CacheBackendInterface
::
CACHE_PERMANENT
,
'<>'
)
->
condition
(
'expire'
,
REQUEST_TIME
,
'<'
)
->
execute
();
}
/**
...
...
core/lib/Drupal/Core/Cache/MemoryBackend.php
View file @
980cb9c5
...
...
@@ -138,16 +138,6 @@ public function deleteAll() {
$this
->
cache
=
array
();
}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteExpired().
*
* Cache expiration is not implemented for MemoryBackend as this backend only
* persists during a single request and expiration are done using
* REQUEST_TIME.
*/
public
function
deleteExpired
()
{
}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
*/
...
...
core/lib/Drupal/Core/Cache/NullBackend.php
View file @
980cb9c5
...
...
@@ -62,11 +62,6 @@ public function deleteMultiple(array $cids) {}
*/
public
function
deleteAll
()
{}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteExpired().
*/
public
function
deleteExpired
()
{}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteTags().
*/
...
...
core/modules/system/lib/Drupal/system/Tests/Cache/CacheTestBase.php
View file @
980cb9c5
...
...
@@ -87,18 +87,4 @@ function assertCacheRemoved($message, $cid = NULL, $bin = NULL) {
$cached
=
cache
(
$bin
)
->
get
(
$cid
);
$this
->
assertFalse
(
$cached
,
$message
);
}
/**
* Performs a general wipe of the bin.
*
* @param $bin
* The bin to perform the wipe on.
*/
protected
function
generalWipe
(
$bin
=
NULL
)
{
if
(
$bin
==
NULL
)
{
$bin
=
$this
->
default_bin
;
}
cache
(
$bin
)
->
deleteExpired
();
}
}
core/modules/system/system.module
View file @
980cb9c5
...
...
@@ -3550,7 +3550,7 @@ function system_cron() {
$cache_bins = array_merge(module_invoke_all('cache_flush'), array('form', 'menu'));
foreach ($cache_bins as $bin) {
cache
(
$bin
)
->
deleteExpired
();
cache($bin)->
garbageCollection
();
}
// Cleanup the batch table and the queue for failed batches.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment