Skip to content

Commit 9ba9019

Browse files
committed
Deprecate omitting Redis server URI for createClient()
1 parent b02cf9e commit 9ba9019

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ $factory->createClient('localhost:6379')->then(
121121
);
122122
```
123123

124-
You can omit the complete URI if you want to connect to the default address `localhost:6379`:
125-
126-
```php
127-
$factory->createClient();
128-
```
129-
130124
You can omit the port if you're connecting to the default port 6379:
131125

132126
```php
@@ -145,6 +139,15 @@ You can optionally include a path that will be used to select (SELECT command) t
145139
$factory->createClient('localhost/2');
146140
```
147141

142+
[Deprecated] You can omit the complete URI if you want to connect to the default
143+
address `localhost:6379`. This legacy API will be removed in a future
144+
`v2.0.0` version, so it's highly recommended to upgrade to the above API.
145+
146+
```php
147+
// deprecated
148+
$factory->createClient();
149+
```
150+
148151
### Client
149152

150153
The `Client` is responsible for exchanging messages with Redis

src/Factory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public function __construct(LoopInterface $loop, $connector = null, ProtocolFact
4444
/**
4545
* create redis client connected to address of given redis instance
4646
*
47-
* @param string|null $target
47+
* @param string|null $target Redis server URI to connect to. Not passing
48+
* this parameter is deprecated and only supported for BC reasons and
49+
* will be removed in future versions.
4850
* @return \React\Promise\PromiseInterface resolves with Client or rejects with \Exception
4951
*/
5052
public function createClient($target = null)

0 commit comments

Comments
 (0)