Skip to content

Added missing arguments for connect, pconnect and popen #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions src/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ public function __construct( ) {}
/**
* Connects to a Redis instance.
*
* @param string $host can be a host, or the path to a unix domain socket
* @param int $port optional
* @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited)
* @param null $reserved should be null if $retry_interval is specified
* @param int $retry_interval retry interval in milliseconds.
* @return bool TRUE on success, FALSE on error.
* @param string $host can be a host, or the path to a unix domain socket
* @param int $port optional
* @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited)
* @param null $reserved should be null if $retry_interval is specified
* @param int $retry_interval retry interval in milliseconds.
* @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited)
* @return bool TRUE on success, FALSE on error.
* @example
* <pre>
* $redis->connect('127.0.0.1', 6379);
Expand All @@ -103,7 +104,7 @@ public function __construct( ) {}
* $redis->connect('/tmp/redis.sock'); // unix domain socket.
* </pre>
*/
public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {}
public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0 ) {}

/**
* A method to determine if a phpredis object thinks it's connected to a server
Expand All @@ -118,8 +119,10 @@ public function isConnected() {}
* @param float $timeout
* @param null $reserved
* @param int $retry_interval
* @param float $read_timeout
* @return bool
*/
public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {}
public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0 ) {}

/**
* Connects to a Redis instance or reuse a connection already established with pconnect/popen.
Expand All @@ -129,26 +132,27 @@ public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $re
* many servers connecting to one redis server.
*
* Also more than one persistent connection can be made identified by either host + port + timeout
* or unix socket + timeout.
* or host + persistent_id or unix socket + timeout.
*
* This feature is not available in threaded versions. pconnect and popen then working like their non persistent
* equivalents.
*
* @param string $host can be a host, or the path to a unix domain socket
* @param int $port optional
* @param float $timeout value in seconds (optional, default is 0 meaning unlimited)
* @param string $persistent_id unique identifier string for the connection
* @param int $retry_interval retry time in milliseconds
* @return bool TRUE on success, FALSE on error.
* @example
* @param string $host can be a host, or the path to a unix domain socket
* @param int $port optional
* @param float $timeout value in seconds (optional, default is 0 meaning unlimited)
* @param string $persistent_id identity for the requested persistent connection
* @param int $retry_interval retry interval in milliseconds.
* @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited)
* @return bool TRUE on success, FALSE on ertcnror.
* <pre>
* $redis->connect('127.0.0.1', 6379);
* $redis->connect('127.0.0.1'); // port 6379 by default
* $redis->connect('127.0.0.1', 6379, 2.5); // 2.5 sec timeout.
* $redis->connect('/tmp/redis.sock'); // unix domain socket.
* $redis->pconnect('127.0.0.1', 6379);
* $redis->pconnect('127.0.0.1'); // port 6379 by default - same connection like before.
* $redis->pconnect('127.0.0.1', 6379, 2.5); // 2.5 sec timeout and would be another connection than the two before.
* $redis->pconnect('127.0.0.1', 6379, 2.5, 'x'); // x is sent as persistent_id and would be another connection than the three before.
* $redis->pconnect('/tmp/redis.sock'); // unix domain socket - would be another connection than the four before.
* </pre>
*/
public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0 ) {}
public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0 ) {}

/**
* @see pconnect()
Expand All @@ -157,8 +161,10 @@ public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id =
* @param float $timeout
* @param string $persistent_id
* @param int $retry_interval
* @param float $read_timeout
* @return bool
*/
public function popen( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0 ) {}
public function popen( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0 ) {}

/**
* Disconnects from the Redis instance, except when pconnect is used.
Expand Down