Connection
class Connection
Redis connection.
Properties
protected resource | $connection | Socket connection. | |
protected bool | $isPersistent | Is the socket persistent? | |
protected int | $timeout | Timeout. | |
protected string|null | $name | Connection name. |
Methods
__construct(string $host, int $port = 6379, bool $persistent = false, int $timeout = 60, string $name = null)
Constructor.
__destruct()
Destructor.
resource
createConnection(string $host, int $port, bool $persistent, int $timeout)
Creates a socket connection to the server.
bool
isPersistent()
Is the connection persistent?
int
getTimeout()
Returns the timeout value of the connection.
string|null
getName()
Returns the connection name.
string
appendReadErrorReason(string $message)
Appends the read error reason to the error message if possible.
string
readLine()
Gets line from the server.
string
read(int $bytes)
Reads n bytes from the server.
int
write(string $data)
Writes data to the server.
Details
at line 71
__construct(string $host, int $port = 6379, bool $persistent = false, int $timeout = 60, string $name = null)
Constructor.
at line 92
__destruct()
Destructor.
at line 109
protected resource
createConnection(string $host, int $port, bool $persistent, int $timeout)
Creates a socket connection to the server.
at line 133
bool
isPersistent()
Is the connection persistent?
at line 143
int
getTimeout()
Returns the timeout value of the connection.
at line 153
string|null
getName()
Returns the connection name.
at line 164
protected string
appendReadErrorReason(string $message)
Appends the read error reason to the error message if possible.
at line 179
string
readLine()
Gets line from the server.
at line 197
string
read(int $bytes)
Reads n bytes from the server.
at line 227
int
write(string $data)
Writes data to the server.