Skip to content

Commit 0050cdd

Browse files
Merge pull request #915 from redis/DOC-4587-add-php-conn-info
DOC-4587 added PHP connection info to basic examples
2 parents c06c3ad + 31ccf40 commit 0050cdd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

content/develop/clients/php/_index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ require 'vendor/autoload.php';
5050

5151
use Predis\Client as PredisClient;
5252

53-
$r = new PredisClient();
53+
$r = new PredisClient([
54+
'scheme' => 'tcp',
55+
'host' => '127.0.0.1',
56+
'port' => 6379,
57+
'password' => '',
58+
'database' => 0,
59+
]);
5460
```
5561

5662
Store and retrieve a simple string to test the connection:

content/develop/clients/php/connect.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ require 'vendor/autoload.php';
2727

2828
use Predis\Client as PredisClient;
2929

30-
$r = new PredisClient();
30+
$r = new PredisClient([
31+
'scheme' => 'tcp',
32+
'host' => '127.0.0.1',
33+
'port' => 6379,
34+
'password' => '',
35+
'database' => 0,
36+
]);
3137
```
3238

3339
Store and retrieve a simple string to test the connection:

0 commit comments

Comments
 (0)