PHP Class Resque_Redis, php-resque

Author: Chris Boulton ([email protected])
Datei anzeigen Open project: chrisboulton/php-resque Class Usage Examples

Public Methods

Method Description
__call ( string $name, array $args ) : mixed Magic method to handle all function requests and prefix key based operations with the {self::$defaultNamespace} key prefix.
__construct ( string | array $server, integer $database = null, object $client = null )
getPrefix ( )
parseDsn ( string $dsn ) : array Parse a DSN string, which can have one of the following formats:
prefix ( string $namespace ) Set Redis namespace (prefix) default: resque
removePrefix ( $string )

Method Details

__call() public method

Magic method to handle all function requests and prefix key based operations with the {self::$defaultNamespace} key prefix.
public __call ( string $name, array $args ) : mixed
$name string The name of the method called.
$args array Array of supplied arguments to the method.
return mixed Return value from Resident::call() based on the command.

__construct() public method

public __construct ( string | array $server, integer $database = null, object $client = null )
$server string | array A DSN or array
$database integer A database number to select. However, if we find a valid database number in the DSN the DSN-supplied value will be used instead and this parameter is ignored.
$client object Optional Credis_Cluster or Credis_Client instance instantiated by you

getPrefix() public static method

public static getPrefix ( )

parseDsn() public static method

- host:port - redis://user:pass@host:port/db?option1=val1&option2=val2 - tcp://user:pass@host:port/db?option1=val1&option2=val2 - unix:///path/to/redis.sock Note: the 'user' part of the DSN is not used.
public static parseDsn ( string $dsn ) : array
$dsn string A DSN string
return array An array of DSN compotnents, with 'false' values for any unknown components. e.g. [host, port, db, user, pass, options]

prefix() public static method

Set Redis namespace (prefix) default: resque
public static prefix ( string $namespace )
$namespace string

removePrefix() public static method

public static removePrefix ( $string )