MemoryBackend::removeBin

public MemoryBackend::removeBin() Remove a cache bin. Overrides CacheBackendInterface::removeBin File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 195 Class MemoryBackend Defines a memory cache implementation. Namespace Drupal\Core\Cache Code public function removeBin() { $this->cache = []; }

MemoryBackend::register

public MemoryBackend::register($name, $window = 3600, $identifier = NULL) Registers an event for the current visitor to the flood control mechanism. Parameters string $name: The name of an event. To prevent unintended name clashes, it is recommended to use the module name first in the event name, optionally followed by a dot and the actual event name (e.g. "mymodule.my_event"). int $window: (optional) Number of seconds before this event expires. Defaults to 3600 (1 hour). Typically uses the sa

MemoryBackend::prepareItem

protected MemoryBackend::prepareItem($cache, $allow_invalid) Prepares a cached item. Checks that items are either permanent or did not expire, and returns data as appropriate. Parameters object $cache: An item loaded from cache_get() or cache_get_multiple(). bool $allow_invalid: (optional) If TRUE, cache items may be returned even if they have expired or been invalidated. Return value mixed The item with data as appropriate or FALSE if there is no valid item to load. File core/lib/Drupal/Core

MemoryBackend::isAllowed

public MemoryBackend::isAllowed($name, $threshold, $window = 3600, $identifier = NULL) Checks whether a user is allowed to proceed with the specified event. Events can have thresholds saying that each user can only do that event a certain number of times in a time window. This function verifies that the current user has not exceeded this threshold. Parameters string $name: The name of an event. int $threshold: The maximum number of times each user can do this event per time window. int $window

MemoryBackend::invalidateTags

public MemoryBackend::invalidateTags(array $tags) Marks cache items with any of the specified tags as invalid. Parameters string[] $tags: The list of tags for which to invalidate cache items. Overrides CacheTagsInvalidatorInterface::invalidateTags File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 169 Class MemoryBackend Defines a memory cache implementation. Namespace Drupal\Core\Cache Code public function invalidateTags(array $tags) { foreach ($this->cache as $cid => $i

MemoryBackend::invalidateMultiple

public MemoryBackend::invalidateMultiple(array $cids) Marks cache items as invalid. Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE. Parameters string[] $cids: An array of cache IDs to invalidate. Overrides CacheBackendInterface::invalidateMultiple See also \Drupal\Core\Cache\CacheBackendInterface::deleteMultiple() \Drupal\Core\Cache\CacheBackendInterface::invalidate() \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() File core/lib/Drupal/

MemoryBackend::invalidateAll

public MemoryBackend::invalidateAll() Marks all cache items as invalid. Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE. Overrides CacheBackendInterface::invalidateAll See also \Drupal\Core\Cache\CacheBackendInterface::deleteAll() \Drupal\Core\Cache\CacheBackendInterface::invalidate() \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 180 Class MemoryBackend Defines a memory c

MemoryBackend::invalidate

public MemoryBackend::invalidate($cid) Marks a cache item as invalid. Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE. Parameters string $cid: The cache ID to invalidate. Overrides CacheBackendInterface::invalidate See also \Drupal\Core\Cache\CacheBackendInterface::delete() \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() File core/lib/Drupal/Core/Cache/MemoryBackend.php, line

MemoryBackend::getRequestTime

protected MemoryBackend::getRequestTime() Wrapper method for REQUEST_TIME constant. Return value int File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 204 Class MemoryBackend Defines a memory cache implementation. Namespace Drupal\Core\Cache Code protected function getRequestTime() { return defined('REQUEST_TIME') ? REQUEST_TIME : (int) $_SERVER['REQUEST_TIME']; }

MemoryBackend::getMultiple

public MemoryBackend::getMultiple(&$cids, $allow_invalid = FALSE) Returns data from the persistent cache when given an array of cache IDs. Parameters array $cids: An array of cache IDs for the data to retrieve. This is passed by reference, and will have the IDs successfully returned from cache removed. bool $allow_invalid: (optional) If TRUE, cache items may be returned even if they have expired or been invalidated. Such items may sometimes be preferred, if the alternative is recalculating