You are here

class SuperStaticCache in Tome 8

Decorates the Tome Static cache service to prevent deletions.

Hierarchy

Expanded class hierarchy of SuperStaticCache

3 files declare their use of SuperStaticCache
SuperStaticCacheTest.php in modules/tome_static/modules/tome_static_super_cache/tests/src/Kernel/SuperStaticCacheTest.php
TomeSuperCacheRebuildCommand.php in modules/tome_static/modules/tome_static_super_cache/src/Commands/TomeSuperCacheRebuildCommand.php
tome_static_super_cache.module in modules/tome_static/modules/tome_static_super_cache/tome_static_super_cache.module
Contains functions for the Tome Static Super Cache module.
1 string reference to 'SuperStaticCache'
tome_static_super_cache.services.yml in modules/tome_static/modules/tome_static_super_cache/tome_static_super_cache.services.yml
modules/tome_static/modules/tome_static_super_cache/tome_static_super_cache.services.yml
1 service uses SuperStaticCache
tome_static_super_cache.cache.tome_static in modules/tome_static/modules/tome_static_super_cache/tome_static_super_cache.services.yml
Drupal\tome_static_super_cache\SuperStaticCache

File

modules/tome_static/modules/tome_static_super_cache/src/SuperStaticCache.php, line 10

Namespace

Drupal\tome_static_super_cache
View source
class SuperStaticCache extends StaticCache {

  /**
   * The global key to flag a full rebuild.
   *
   * @var string
   */
  const FULL_REBUILD_KEY = 'tome_static_super_cache_full_rebuild';

  /**
   * The global key to flag a normal rebuild.
   *
   * @var string
   */
  const REBUILD_KEY = 'tome_static_super_cache_rebuild';

  /**
   * {@inheritdoc}
   */
  public function deleteAll() {
    if (isset($GLOBALS[self::FULL_REBUILD_KEY])) {
      parent::deleteAll();
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheBackendInterface::CACHE_PERMANENT constant Indicates that the item should never be removed unless explicitly deleted.
DatabaseBackend::$bin protected property
DatabaseBackend::$checksumProvider protected property The cache tags checksum provider.
DatabaseBackend::$connection protected property The database connection.
DatabaseBackend::$maxRows protected property The maximum number of rows that this cache bin table is allowed to store.
DatabaseBackend::catchException protected function Act on an exception when cache might be stale.
DatabaseBackend::DEFAULT_MAX_ROWS constant The default maximum number of rows that this cache bin table can store.
DatabaseBackend::delete public function Deletes an item from the cache. Overrides CacheBackendInterface::delete
DatabaseBackend::deleteMultiple public function Deletes multiple items from the cache. Overrides CacheBackendInterface::deleteMultiple
DatabaseBackend::doSetMultiple protected function Stores multiple items in the persistent cache.
DatabaseBackend::ensureBinExists protected function Check if the cache bin exists and create it if not.
DatabaseBackend::get public function Returns data from the persistent cache. Overrides CacheBackendInterface::get
DatabaseBackend::getMaxRows public function The maximum number of rows that this cache bin table is allowed to store.
DatabaseBackend::getMultiple public function Returns data from the persistent cache when given an array of cache IDs. Overrides CacheBackendInterface::getMultiple
DatabaseBackend::invalidate public function Marks a cache item as invalid. Overrides CacheBackendInterface::invalidate
DatabaseBackend::invalidateAll public function Marks all cache items as invalid. Overrides CacheBackendInterface::invalidateAll
DatabaseBackend::invalidateMultiple public function Marks cache items as invalid. Overrides CacheBackendInterface::invalidateMultiple
DatabaseBackend::MAXIMUM_NONE constant -1 means infinite allows numbers of rows for the cache backend.
DatabaseBackend::normalizeCid protected function Normalizes a cache ID in order to comply with database limitations.
DatabaseBackend::prepareItem protected function Prepares a cached item.
DatabaseBackend::removeBin public function Remove a cache bin. Overrides CacheBackendInterface::removeBin
DatabaseBackend::schemaDefinition public function Defines the schema for the {cache_*} bin tables.
DatabaseBackend::set public function Stores data in the persistent cache. Overrides CacheBackendInterface::set
DatabaseBackend::setMultiple public function Store multiple items in the persistent cache. Overrides CacheBackendInterface::setMultiple
StaticCache::filterUncachedPaths public function Filters paths that are uncached from a given array. Overrides StaticCacheInterface::filterUncachedPaths
StaticCache::garbageCollection public function Performs garbage collection on a cache bin. Overrides DatabaseBackend::garbageCollection
StaticCache::getCacheId protected function Gets the Tome cache ID for this request.
StaticCache::getExpiredFiles public function Gets files that are in cache but invalid, and can be deleted. Overrides StaticCacheInterface::getExpiredFiles
StaticCache::isCacheEmpty public function Checks if the cache is empty. Overrides StaticCacheInterface::isCacheEmpty
StaticCache::setCache public function Adds to the Tome cache. Overrides StaticCacheInterface::setCache
StaticCache::__construct public function Constructs a StaticCache object. Overrides DatabaseBackend::__construct
SuperStaticCache::deleteAll public function Deletes all cache items in a bin. Overrides DatabaseBackend::deleteAll
SuperStaticCache::FULL_REBUILD_KEY constant The global key to flag a full rebuild.
SuperStaticCache::REBUILD_KEY constant The global key to flag a normal rebuild.