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|null $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|null $name = null)
Constructor.
at line 92
__destruct()
Destructor.
at line 110
protected resource
createConnection(string $host, int $port, bool $persistent, int $timeout)
Creates a socket connection to the server.
at line 134
bool
isPersistent()
Is the connection persistent?
at line 144
int
getTimeout()
Returns the timeout value of the connection.
at line 154
string|null
getName()
Returns the connection name.
at line 165
protected string
appendReadErrorReason(string $message)
Appends the read error reason to the error message if possible.
at line 181
string
readLine()
Gets line from the server.
at line 200
string
read(int $bytes)
Reads n bytes from the server.
at line 231
int
write(string $data)
Writes data to the server.