Documentation

KeyPrefixProcessor
in package
implements ProcessorInterface

Command processor capable of prefixing keys stored in the arguments of Redis commands supported.

Tags
author

Daniele Alessandri suppakilla@gmail.com

Interfaces, Classes and Traits

ProcessorInterface
A command processor processes Redis commands before they are sent to Redis.

Table of Contents

$commands  : mixed
$prefix  : mixed
__construct()  : mixed
__toString()  : mixed
{@inheritdoc}
all()  : mixed
Applies the specified prefix to all the arguments.
evalKeys()  : mixed
Applies the specified prefix to the keys of an EVAL-based command.
first()  : mixed
Applies the specified prefix only the first argument.
georadius()  : mixed
Applies the specified prefix to the key of a GEORADIUS command.
getPrefix()  : string
Gets the current prefix.
interleaved()  : mixed
Applies the specified prefix only to even arguments in the list.
migrate()  : mixed
Applies the specified prefix to the key of a MIGRATE command.
process()  : mixed
Processes the given Redis command.
setCommandHandler()  : mixed
Sets an handler for the specified command ID.
setPrefix()  : mixed
Sets a prefix that is applied to all the keys.
skipFirst()  : mixed
Applies the specified prefix to all the arguments but the first one.
skipLast()  : mixed
Applies the specified prefix to all the arguments but the last one.
sort()  : mixed
Applies the specified prefix to the keys of a SORT command.
zsetStore()  : mixed
Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE.

Properties

Methods

__construct()

public __construct(string $prefix) : mixed
Parameters
$prefix : string

Prefix for the keys.

Return values
mixed

all()

Applies the specified prefix to all the arguments.

public static all(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

evalKeys()

Applies the specified prefix to the keys of an EVAL-based command.

public static evalKeys(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

first()

Applies the specified prefix only the first argument.

public static first(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

georadius()

Applies the specified prefix to the key of a GEORADIUS command.

public static georadius(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

getPrefix()

Gets the current prefix.

public getPrefix() : string
Return values
string

interleaved()

Applies the specified prefix only to even arguments in the list.

public static interleaved(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

migrate()

Applies the specified prefix to the key of a MIGRATE command.

public static migrate(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

setCommandHandler()

Sets an handler for the specified command ID.

public setCommandHandler(string $commandID[, mixed $callback = null ]) : mixed

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.

Parameters
$commandID : string

The ID of the command to be handled.

$callback : mixed = null

A valid callable object or NULL.

Tags
throws
InvalidArgumentException
Return values
mixed

setPrefix()

Sets a prefix that is applied to all the keys.

public setPrefix(string $prefix) : mixed
Parameters
$prefix : string

Prefix for the keys.

Return values
mixed

skipFirst()

Applies the specified prefix to all the arguments but the first one.

public static skipFirst(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

skipLast()

Applies the specified prefix to all the arguments but the last one.

public static skipLast(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

sort()

Applies the specified prefix to the keys of a SORT command.

public static sort(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

zsetStore()

Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE.

public static zsetStore(CommandInterface $command, string $prefix) : mixed
Parameters
$command : CommandInterface

Command instance.

$prefix : string

Prefix string.

Return values
mixed

Search results