Skip to content
NullBackend.php 1.71 KiB
Newer Older

/**
 * Defines a stub cache implementation.
 *
 * The stub implementation is needed when database access is not yet available.
 * Because Drupal's caching system never requires that cached data be present,
 * these stub functions can short-circuit the process and sidestep the need for
 * any persistent storage. Using this cache implementation during normal
 * operations would have a negative impact on performance.
 *
 * This also can be used for testing purposes.
 */
class NullBackend implements CacheBackendInterface {

  /**
   * Constructs a NullBackend object.
   *
   * @param string $bin
   *   The cache bin for which the object is created.
  public function __construct($bin) {}
  public function get($cid, $allow_invalid = FALSE) {
  public function getMultiple(&$cids, $allow_invalid = FALSE) {
  public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) {}
  public function setMultiple(array $items = []) {}
  public function delete($cid) {}
  public function deleteMultiple(array $cids) {}
   */
  public function invalidate($cid) {}

  /**
   */
  public function invalidateMultiple(array $cids) {}
   */
  public function garbageCollection() {}

  /**
   * {@inheritdoc}
   */
  public function removeBin() {}