PHP Class Predis\Command\Processor\KeyPrefixProcessor

Author: Daniele Alessandri ([email protected])
Inheritance: implements Predis\Command\Processor\ProcessorInterface
Show file Open project: tillkruss/redis-object-cache Class Usage Examples

Public Methods

Method Description
__construct ( string $prefix )
__toString ( )
all ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to all the arguments.
evalKeys ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to the keys of an EVAL-based command.
first ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix only the first argument.
georadius ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to the key of a GEORADIUS command.
getPrefix ( ) : string Gets the current prefix.
interleaved ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix only to even arguments in the list.
migrate ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to the key of a MIGRATE command.
process ( Predis\Command\CommandInterface $command )
setCommandHandler ( string $commandID, mixed $callback = null ) Sets an handler for the specified command ID.
setPrefix ( string $prefix ) Sets a prefix that is applied to all the keys.
skipFirst ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to all the arguments but the first one.
skipLast ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to all the arguments but the last one.
sort ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to the keys of a SORT command.
zsetStore ( Predis\Command\CommandInterface $command, string $prefix ) Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE.

Method Details

__construct() public method

public __construct ( string $prefix )
$prefix string Prefix for the keys.

__toString() public method

public __toString ( )

all() public static method

Applies the specified prefix to all the arguments.
public static all ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

evalKeys() public static method

Applies the specified prefix to the keys of an EVAL-based command.
public static evalKeys ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

first() public static method

Applies the specified prefix only the first argument.
public static first ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

georadius() public static method

Applies the specified prefix to the key of a GEORADIUS command.
public static georadius ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

getPrefix() public method

Gets the current prefix.
public getPrefix ( ) : string
return string

interleaved() public static method

Applies the specified prefix only to even arguments in the list.
public static interleaved ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

migrate() public static method

Applies the specified prefix to the key of a MIGRATE command.
public static migrate ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

process() public method

public process ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface

setCommandHandler() public method

The callback signature must have 2 parameters of the following types: - Predis\Command\CommandInterface (command instance) - String (prefix) When the callback argument is omitted or NULL, the previously associated handler for the specified command ID is removed.
public setCommandHandler ( string $commandID, mixed $callback = null )
$commandID string The ID of the command to be handled.
$callback mixed A valid callable object or NULL.

setPrefix() public method

Sets a prefix that is applied to all the keys.
public setPrefix ( string $prefix )
$prefix string Prefix for the keys.

skipFirst() public static method

Applies the specified prefix to all the arguments but the first one.
public static skipFirst ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

skipLast() public static method

Applies the specified prefix to all the arguments but the last one.
public static skipLast ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

sort() public static method

Applies the specified prefix to the keys of a SORT command.
public static sort ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.

zsetStore() public static method

Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE.
public static zsetStore ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.