Documentation

Parameters
in package
implements ParametersInterface

Container for connection parameters used to initialize connections to Redis.

Tags
author

Daniele Alessandri suppakilla@gmail.com

Interfaces, Classes and Traits

ParametersInterface
Interface defining a container for connection parameters.

Table of Contents

$defaults  : mixed
$parameters  : mixed
__construct()  : mixed
__get()  : mixed|null
Returns the value of the specified parameter.
__isset()  : bool
Checks if the specified parameters is set.
__sleep()  : mixed
{@inheritdoc}
create()  : Parameters
Creates a new instance by supplying the initial parameters either in the form of an URI string or a named array.
parse()  : array<string|int, mixed>
Parses an URI string returning an array of connection parameters.
toArray()  : array<string|int, mixed>
Returns an array representation of the connection parameters.
filter()  : array<string|int, mixed>
Validates and converts each value of the connection parameters array.
getDefaults()  : array<string|int, mixed>
Returns some default parameters with their values.

Properties

$defaults

private static mixed $defaults = array('scheme' => 'tcp', 'host' => '127.0.0.1', 'port' => 6379)

Methods

__construct()

public __construct([array<string|int, mixed> $parameters = array() ]) : mixed
Parameters
$parameters : array<string|int, mixed> = array()

Named array of connection parameters.

Return values
mixed

__get()

Returns the value of the specified parameter.

public __get(mixed $parameter) : mixed|null
Parameters
$parameter : mixed

Name of the parameter.

Return values
mixed|null

__isset()

Checks if the specified parameters is set.

public __isset(mixed $parameter) : bool
Parameters
$parameter : mixed

Name of the parameter.

Return values
bool

__sleep()

{@inheritdoc}

public __sleep() : mixed
Return values
mixed

create()

Creates a new instance by supplying the initial parameters either in the form of an URI string or a named array.

public static create(array<string|int, mixed>|string $parameters) : Parameters
Parameters
$parameters : array<string|int, mixed>|string

Set of connection parameters.

Return values
Parameters

parse()

Parses an URI string returning an array of connection parameters.

public static parse(string $uri) : array<string|int, mixed>

When using the "redis" and "rediss" schemes the URI is parsed according to the rules defined by the provisional registration documents approved by IANA. If the URI has a password in its "user-information" part or a database number in the "path" part these values override the values of "password" and "database" if they are present in the "query" part.

Parameters
$uri : string

URI string.

Tags
link
http://www.iana.org/assignments/uri-schemes/prov/redis
link
http://www.iana.org/assignments/uri-schemes/prov/rediss
throws
InvalidArgumentException
Return values
array<string|int, mixed>

toArray()

Returns an array representation of the connection parameters.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

filter()

Validates and converts each value of the connection parameters array.

protected filter(array<string|int, mixed> $parameters) : array<string|int, mixed>
Parameters
$parameters : array<string|int, mixed>

Connection parameters.

Return values
array<string|int, mixed>

getDefaults()

Returns some default parameters with their values.

protected getDefaults() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results