You are here

abstract class Redis_Cache_Base in Redis 7.3

Same name and namespace in other branches
  1. 7.2 lib/Redis/Cache/Base.php \Redis_Cache_Base

@todo

  • Improve lua scripts by using SCAN family commands
  • Deambiguate why we need the namespace only for flush*() operations
  • Implement the isEmpty() method by using SCAN or KEYS

Hierarchy

Expanded class hierarchy of Redis_Cache_Base

File

lib/Redis/Cache/Base.php, line 9

View source
abstract class Redis_Cache_Base extends Redis_AbstractBackend {

  /**
   * Lastest cache flush KEY name
   */
  const LAST_FLUSH_KEY = '_last_flush';

  /**
   * Delete by prefix lua script
   */
  const EVAL_DELETE_PREFIX = <<<EOT
local keys = redis.call("KEYS", ARGV[1])
for i, k in ipairs(keys) do
    redis.call("DEL", k)
end
return 1
EOT;

  /**
   * Delete volatile by prefix lua script
   */
  const EVAL_DELETE_VOLATILE = <<<EOT
local keys = redis.call('KEYS', ARGV[1])
for i, k in ipairs(keys) do
    if "1" == redis.call("HGET", k, "volatile") then
        redis.call("DEL", k)
    end
end
return 1
EOT;

}

Members

Namesort descending Modifiers Type Description Overrides
Redis_AbstractBackend::$client private property
Redis_AbstractBackend::$namespace private property
Redis_AbstractBackend::$prefix private property
Redis_AbstractBackend::getClient final public function Get client Overrides Redis_BackendInterface::getClient
Redis_AbstractBackend::getKey public function Get prefixed key Overrides Redis_BackendInterface::getKey 1
Redis_AbstractBackend::getNamespace final public function Get namespace Overrides Redis_BackendInterface::getNamespace
Redis_AbstractBackend::getPrefix final public function Get prefix Overrides Redis_BackendInterface::getPrefix
Redis_AbstractBackend::KEY_SEPARATOR constant Key components name separator
Redis_AbstractBackend::setClient final public function Set client Overrides Redis_BackendInterface::setClient
Redis_AbstractBackend::setNamespace final public function Set namespace Overrides Redis_BackendInterface::setNamespace
Redis_AbstractBackend::setPrefix final public function Set prefix Overrides Redis_BackendInterface::setPrefix
Redis_AbstractBackend::__construct public function Default constructor 1
Redis_Cache_Base::EVAL_DELETE_PREFIX constant Delete by prefix lua script
Redis_Cache_Base::EVAL_DELETE_VOLATILE constant Delete volatile by prefix lua script
Redis_Cache_Base::LAST_FLUSH_KEY constant Lastest cache flush KEY name