Skip to content

Commit bf6ef57

Browse files
committed
README.md update re UNIX socket support
closes tarantoolgh-85
1 parent 35daa0a commit bf6ef57

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ _**Description**_: Available Tarantool Constants
114114

115115
``` php
116116
Tarantool {
117-
public Tarantool::__construct ( [ string $host = 'localhost' [, int $port = 3301 [, string $user = "guest" [, string $password = NULL [, string $persistent_id = NULL ] ] ] ] ] )
117+
public Tarantool::__construct ( [ string $uri = 'tcp://guest@localhost:3301' [, string $persistent_id = NULL ] ] )
118118
public bool Tarantool::connect ( void )
119119
public bool Tarantool::disconnect ( void )
120120
public bool Tarantool::flushSchema ( void )
@@ -133,17 +133,16 @@ Tarantool {
133133
#### Tarantool::__construct
134134

135135
```
136+
public Tarantool::__construct ( [ string $uri = 'tcp://guest@localhost:3301' [, string $persistent_id = NULL ] ] )
137+
/* Old API, eventually it'll be deleted */
136138
public Tarantool::__construct ( [ string $host = 'localhost' [, int $port = 3301 [, string $user = "guest" [, string $password = NULL [, string $persistent_id = NULL ] ] ] ] ] )
137139
```
138140

139-
_**Description**_: Creates a Tarantool client
141+
_**Description**_: Creates a Tarantool client (TCP/UNIX sockets are supported)
140142

141143
_**Parameters**_
142144

143-
* `host`: string, default is `'localhost'`
144-
* `port`: number, default is `3301`
145-
* `user`: string, default is `'guest'`
146-
* `password`: string
145+
* `uri`: string, default is `'tcp://guest@localhost:3301'`
147146
* `persistent_id`: string (set it, and connection will be persistent, if
148147
`persistent` in config isn't set)
149148

@@ -155,8 +154,10 @@ Tarantool class instance
155154

156155
``` php
157156
$tnt = new Tarantool(); // -> new Tarantool('localhost', 3301);
158-
$tnt = new Tarantool('tarantool.org'); // -> new Tarantool('tarantool.org', 3301);
159-
$tnt = new Tarantool('localhost', 16847);
157+
$tnt = new Tarantool('tcp://test:test@localhost');
158+
$tnt = new Tarantool('tcp://test:test@localhost:3301');
159+
$tnt = new Tarantool('test:test@unix/:/var/tmp/tarantool.sock);
160+
$tnt = new Tarantool('unix:///var/tmp/tarantool.sock); /* if no login is needed */
160161
```
161162

162163
## Manipulation connection

0 commit comments

Comments
 (0)