Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
added missing arguments for connect, pconnect and popen
  • Loading branch information
alexander-schranz authored Nov 20, 2018
commit fd1572ded20a531c45141e7472ea45535f9ae3eb
46 changes: 25 additions & 21 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 @@ -129,26 +130,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 +159,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