@@ -114,7 +114,7 @@ _**Description**_: Available Tarantool Constants
114
114
115
115
``` php
116
116
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 ] ] )
118
118
public bool Tarantool::connect ( void )
119
119
public bool Tarantool::disconnect ( void )
120
120
public bool Tarantool::flushSchema ( void )
@@ -133,17 +133,16 @@ Tarantool {
133
133
#### Tarantool::__ construct
134
134
135
135
```
136
+ public Tarantool::__construct ( [ string $uri = 'tcp://guest@localhost:3301' [, string $persistent_id = NULL ] ] )
137
+ /* Old API, eventually it'll be deleted */
136
138
public Tarantool::__construct ( [ string $host = 'localhost' [, int $port = 3301 [, string $user = "guest" [, string $password = NULL [, string $persistent_id = NULL ] ] ] ] ] )
137
139
```
138
140
139
- _ ** Description** _ : Creates a Tarantool client
141
+ _ ** Description** _ : Creates a Tarantool client (TCP/UNIX sockets are supported)
140
142
141
143
_ ** Parameters** _
142
144
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' `
147
146
* ` persistent_id ` : string (set it, and connection will be persistent, if
148
147
` persistent ` in config isn't set)
149
148
@@ -155,8 +154,10 @@ Tarantool class instance
155
154
156
155
``` php
157
156
$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 */
160
161
```
161
162
162
163
## Manipulation connection
0 commit comments