MemoryCounterBackend

Defines a memory cache implementation that counts set and get calls. This can be used to mock a cache backend where one needs to know how many times a cache entry was set or requested. @todo On the longrun this backend should be replaced by phpunit mock objects. Hierarchy class \Drupal\Core\Cache\MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterfaceclass \Drupal\Core\Cache\MemoryCounterBackend File core/lib/Drupal/Core/Cache/MemoryCounterBackend.php, line 13 Names

MemoryBackendFactory::get

MemoryBackendFactory::get($bin) Gets a cache backend class for a given cache bin. Parameters string $bin: The cache bin for which a cache backend object should be returned. Return value \Drupal\Core\Cache\CacheBackendInterface The cache backend object associated with the specified bin. Overrides CacheFactoryInterface::get File core/lib/Drupal/Core/Cache/MemoryBackendFactory.php, line 17 Class MemoryBackendFactory Namespace Drupal\Core\Cache Code function get($bin) { if (!isset($th

MemoryBackendFactory::$bins

Instantiated memory cache bins. Type: \Drupal\Core\Cache\MemoryBackend[] File core/lib/Drupal/Core/Cache/MemoryBackendFactory.php, line 12 Class MemoryBackendFactory Namespace Drupal\Core\Cache Code protected $bins = array();

MemoryBackendFactory

Hierarchy class \Drupal\Core\Cache\MemoryBackendFactory implements CacheFactoryInterface File core/lib/Drupal/Core/Cache/MemoryBackendFactory.php, line 5 Namespace Drupal\Core\Cache Members Name Modifiers Type Description MemoryBackendFactory::$bins protected property Instantiated memory cache bins. MemoryBackendFactory::get function Gets a cache backend class for a given cache bin. Overrides CacheFactoryInterface::get

MemoryBackend::__sleep

public MemoryBackend::__sleep() Prevents data stored in memory backends from being serialized. File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 211 Class MemoryBackend Defines a memory cache implementation. Namespace Drupal\Core\Cache Code public function __sleep() { return []; }

MemoryBackend::__construct

public MemoryBackend::__construct(RequestStack $request_stack) Construct the MemoryBackend. Parameters \Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack used to retrieve the current request. File core/lib/Drupal/Core/Flood/MemoryBackend.php, line 30 Class MemoryBackend Defines the memory flood backend. This is used for testing. Namespace Drupal\Core\Flood Code public function __construct(RequestStack $request_stack) { $this->requestStack = $request_

MemoryBackend::__construct

public MemoryBackend::__construct($bin) Constructs a MemoryBackend object. Parameters string $bin: The cache bin for which the object is created. File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 28 Class MemoryBackend Defines a memory cache implementation. Namespace Drupal\Core\Cache Code public function __construct($bin) { }

MemoryBackend::setMultiple

public MemoryBackend::setMultiple(array $items = array()) Store multiple items in the persistent cache. Parameters array $items: An array of cache items, keyed by cid. In the form: $items = array( $cid => array( // Required, will be automatically serialized if not a string. 'data' => $data, // Optional, defaults to CacheBackendInterface::CACHE_PERMANENT. 'expire' => CacheBackendInterface::CACHE_PERMANENT, // (optional) The cache tags for this item,

MemoryBackend::set

public MemoryBackend::set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) Stores data in the persistent cache. Core cache implementations set the created time on cache item with microtime(TRUE) rather than REQUEST_TIME_FLOAT, because the created time of cache items should match when they are created, not when the request started. Apart from being more accurate, this increases the chance an item will legitimately be considered valid. Parameters string $cid: The cache ID of the d

MemoryBackend::reset

public MemoryBackend::reset() Reset statically cached variables. This is only used by tests. File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 220 Class MemoryBackend Defines a memory cache implementation. Namespace Drupal\Core\Cache Code public function reset() { $this->cache = []; }