function _cache_get_object
_cache_get_object($bin)
Gets the cache object for a cache bin.
By default, this returns an instance of the DrupalDatabaseCache class. Classes implementing DrupalCacheInterface can register themselves both as a default implementation and for specific bins.
Parameters
$bin: The cache bin for which the cache object should be returned.
Return value
DrupalCacheInterface The cache object associated with the specified bin.
See also
File
- includes/cache.inc, line 23
- Functions and interfaces for cache handling.
Code
function _cache_get_object($bin) { // We do not use drupal_static() here because we do not want to change the // storage of a cache bin mid-request. static $cache_objects; if (!isset($cache_objects[$bin])) { $class = variable_get('cache_class_' . $bin); if (!isset($class)) { $class = variable_get('cache_default_class', 'DrupalDatabaseCache'); } $cache_objects[$bin] = new $class($bin); } return $cache_objects[$bin]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!cache.inc/function/_cache_get_object/7.x