You are here

public function Redis_Cache::refreshCapabilities in Redis 7.3

Find from Drupal variables the clear mode.

1 call to Redis_Cache::refreshCapabilities()
Redis_Cache::__construct in lib/Redis/Cache.php

File

lib/Redis/Cache.php, line 188

Class

Redis_Cache
Because those objects will be spawned during boostrap all its configuration must be set in the settings.php file.

Code

public function refreshCapabilities() {
  if (0 < variable_get('cache_lifetime', 0)) {

    // Per Drupal default behavior, when the 'cache_lifetime' variable
    // is set we must not flush any temporary items since they have a
    // life time.
    $this->allowTemporaryFlush = false;
  }
  if (null !== ($mode = variable_get('redis_flush_mode', null))) {
    $mode = (int) $mode;
  }
  else {
    $mode = self::FLUSH_NORMAL;
  }
  $this->isSharded = self::FLUSH_SHARD === $mode || self::FLUSH_SHARD_WITH_PIPELINING === $mode;
  $this->allowPipeline = self::FLUSH_SHARD !== $mode;
}