Merge branch '1400748-namespaces' into dbtngtng
commit
86c93f3b74
|
@ -8,10 +8,10 @@
|
|||
/**
|
||||
* Instantiates and statically caches the correct class for a cache bin.
|
||||
*
|
||||
* By default, this returns an instance of the Drupal\Cache\DatabaseBackend
|
||||
* By default, this returns an instance of the Drupal\Core\Cache\DatabaseBackend
|
||||
* class.
|
||||
*
|
||||
* Classes implementing Drupal\Cache\CacheBackendInterface can register themselves
|
||||
* Classes implementing Drupal\Core\Cache\CacheBackendInterface can register themselves
|
||||
* both as a default implementation and for specific bins.
|
||||
*
|
||||
* @param $bin
|
||||
|
|
|
@ -285,7 +285,7 @@ function install_begin_request(&$install_state) {
|
|||
// because any data put in the cache during the installer is inherently
|
||||
// suspect, due to the fact that Drupal is not fully set up yet.
|
||||
require_once DRUPAL_ROOT . '/core/includes/cache.inc';
|
||||
$conf['cache_default_class'] = 'Drupal\\Cache\\InstallBackend';
|
||||
$conf['cache_default_class'] = 'Drupal\Core\Cache\InstallBackend';
|
||||
|
||||
// Prepare for themed output. We need to run this at the beginning of the
|
||||
// page request to avoid a different theme accidentally getting set. (We also
|
||||
|
|
|
@ -23,7 +23,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
protected $bin;
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::__construct().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::__construct().
|
||||
*/
|
||||
function __construct($bin) {
|
||||
// All cache tables should be prefixed with 'cache_', except for the
|
||||
|
@ -35,7 +35,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::get().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
*/
|
||||
function get($cid) {
|
||||
$cids = array($cid);
|
||||
|
@ -44,7 +44,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::getMultiple().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
*/
|
||||
function getMultiple(&$cids) {
|
||||
try {
|
||||
|
@ -114,7 +114,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::set().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
*/
|
||||
function set($cid, $data, $expire = CACHE_PERMANENT) {
|
||||
$fields = array(
|
||||
|
@ -143,7 +143,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::delete().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
*/
|
||||
function delete($cid) {
|
||||
db_delete($this->bin)
|
||||
|
@ -152,7 +152,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::deleteMultiple().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
*/
|
||||
function deleteMultiple(Array $cids) {
|
||||
// Delete in chunks when a large array is passed.
|
||||
|
@ -165,7 +165,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::deletePrefix().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deletePrefix().
|
||||
*/
|
||||
function deletePrefix($prefix) {
|
||||
db_delete($this->bin)
|
||||
|
@ -174,14 +174,14 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::flush().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::flush().
|
||||
*/
|
||||
function flush() {
|
||||
db_truncate($this->bin)->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::expire().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::expire().
|
||||
*/
|
||||
function expire() {
|
||||
if (variable_get('cache_lifetime', 0)) {
|
||||
|
@ -216,7 +216,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::garbageCollection().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection().
|
||||
*/
|
||||
function garbageCollection() {
|
||||
global $user;
|
||||
|
@ -236,7 +236,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::isEmpty().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
|
||||
*/
|
||||
function isEmpty() {
|
||||
$this->garbageCollection();
|
||||
|
|
|
@ -34,26 +34,26 @@ use Exception;
|
|||
class InstallBackend extends DatabaseBackend {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Cache\DatabaseBackend::get().
|
||||
* Overrides Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
*/
|
||||
function get($cid) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Cache\DatabaseBackend::getMultiple().
|
||||
* Overrides Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
*/
|
||||
function getMultiple(&$cids) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Cache\DatabaseBackend::set().
|
||||
* Overrides Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
*/
|
||||
function set($cid, $data, $expire = CACHE_PERMANENT) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\DatabaseBackend::delete().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
*/
|
||||
function delete($cid) {
|
||||
try {
|
||||
|
@ -65,7 +65,7 @@ class InstallBackend extends DatabaseBackend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\DatabaseBackend::deleteMultiple().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
*/
|
||||
function deleteMultiple(array $cids) {
|
||||
try {
|
||||
|
@ -77,7 +77,7 @@ class InstallBackend extends DatabaseBackend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\DatabaseBackend::deletePrefix().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deletePrefix().
|
||||
*/
|
||||
function deletePrefix($prefix) {
|
||||
try {
|
||||
|
@ -89,7 +89,7 @@ class InstallBackend extends DatabaseBackend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\DatabaseBackend::flush().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::flush().
|
||||
*/
|
||||
function flush() {
|
||||
try {
|
||||
|
@ -101,7 +101,7 @@ class InstallBackend extends DatabaseBackend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Cache\DatabaseBackend::isEmpty().
|
||||
* Overrides Drupal\Core\Cache\CacheBackendInterface::isEmpty().
|
||||
*/
|
||||
function isEmpty() {
|
||||
return TRUE;
|
||||
|
|
|
@ -21,61 +21,61 @@ namespace Drupal\Core\Cache;
|
|||
class NullBackend implements CacheBackendInterface {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::__construct().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::__construct().
|
||||
*/
|
||||
function __construct($bin) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::get().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
*/
|
||||
function get($cid) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::getMultiple().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
*/
|
||||
function getMultiple(&$cids) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::set().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
*/
|
||||
function set($cid, $data, $expire = CACHE_PERMANENT) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::delete().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
*/
|
||||
function delete($cid) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::deleteMultiple().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
*/
|
||||
function deleteMultiple(array $cids) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::deletePrefix().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deletePrefix().
|
||||
*/
|
||||
function deletePrefix($prefix) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::flush().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::flush().
|
||||
*/
|
||||
function flush() {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::expire().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::expire().
|
||||
*/
|
||||
function expire() {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::garbageCollection().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection().
|
||||
*/
|
||||
function garbageCollection() {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Cache\CacheBackendInterface::isEmpty().
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
|
||||
*/
|
||||
function isEmpty() {
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue