@@ -76,30 +76,70 @@ Place it into project library path in your IDE.
7676
7777## Usage
7878
79- 1 . [ Class Tarantool] ( #class-tarantool )
80- 2 . [ Predefined Constants] ( #predefined-constants )
79+ 1 . [ Predefined Constants] ( #predefined-constants )
80+ 2 . [ Class Tarantool] ( #class-tarantool )
81+ * [ Tarantool::_ construct] ( #tarantool__construct )
81823 . [ Manipulation connection] ( #manipulation-connection )
82- * [ connect] ( #connect )
83- * [ disconnect, close ] ( #disconnect-close )
84- * [ authenticate] ( #authenticate )
85- * [ flushSchema, flush_schema ] ( #flushschema-flush_schema )
86- * [ ping] ( #ping )
83+ * [ Tarantool:: connect] ( #tarantoolconnect )
84+ * [ Tarantool:: disconnect] ( #tarantooldisconnect )
85+ * [ Tarantool:: authenticate] ( #tarantoolauthenticate )
86+ * [ Tarantool:: flushSchema] ( #tarantoolflushschema )
87+ * [ Tarantool:: ping] ( #tarantoolping )
87884 . [ Database queries] ( #database-queries )
88- * [ select] ( #select )
89- * [ insert, replace] ( #insert-replace )
90- * [ call] ( #call )
91- * [ eval, evaluate] ( #eval-evaluate )
92- * [ delete] ( #delete )
93- * [ update] ( #update )
94- * [ upsert] ( #upsert )
89+ * [ Tarantool:: select] ( tarantool #select)
90+ * [ Tarantool:: insert, replace] ( #tarantoolinsert-tarantoolreplace )
91+ * [ Tarantool:: call] ( #tarantoolcall )
92+ * [ Tarantool:: evaluate] ( #tarantoolevaluate )
93+ * [ Tarantool:: delete] ( #tarantooldelete )
94+ * [ Tarantool:: update] ( #tarantoolupdate )
95+ * [ Tarantool:: upsert] ( #tarantoolupsert )
9596
96- ### Class Tarantool
97+ ### Predefined Constants
9798
98- _ ** Description** _ : Creates a Tarantool client
99+ _ ** Description** _ : Available Tarantool Constants
100+
101+ * ` TARANTOOL_ITER_EQ ` - Equality iterator (ALL)
102+ * ` TARANTOOL_ITER_REQ ` - Reverse equality iterator
103+ * ` TARANTOOL_ITER_ALL ` - Get all rows
104+ * ` TARANTOOL_ITER_LT ` - Less then iterator
105+ * ` TARANTOOL_ITER_LE ` - Less and equal iterator
106+ * ` TARANTOOL_ITER_GE ` - Greater and equal iterator
107+ * ` TARANTOOL_ITER_GT ` - Gtreater then iterator
108+ * ` TARANTOOL_ITER_BITSET_ALL_SET ` - check if all given bits are set (BITSET only)
109+ * ` TARANTOOL_ITER_BITSET_ANY_SET ` - check if any given bits are set (BITSET only)
110+ * ` TARANTOOL_ITER_BITSET_ALL_NOT_SET ` - check if all given bits are not set
111+ (BITSET only)
112+ * ` TARANTOOL_ITER_OVERLAPS ` - find dots in the n-dimension cube (RTREE only)
113+ * ` TARANTOOL_ITER_NEIGHBOR ` - find nearest dots (RTREE only)
114+
115+ ### Class Tarantool
99116
100117``` php
101- tarantool_object = new Tarantool([host = 'localhost'[, port = 3301]])
118+ Tarantool {
119+ public Tarantool::__construct ( [ string $host = 'localhost' [, int $port = 3301 ] ] )
120+ public bool Tarantool::connect ( void )
121+ public bool Tarantool::disconnect ( void )
122+ public Tarantool::authenticate(string $login [, string $password = NULL ] )
123+ public bool Tarantool::flushSchema ( void )
124+ public bool Tarantool::ping ( void )
125+ public array Tarantool::select(mixed $space [, mixed $key = array() [, mixed $index = 0 [, int $limit = PHP_INT_MAX [, int offset = 0 [, iterator = TARANTOOL_ITER_EQ ] ] ] ] ] )
126+ public array Tarantool::insert(mixed $space, array $tuple)
127+ public array Tarantool::replace(mixed $space, array $tuple)
128+ public array Tarantool::call(string $procedure [, mixed args])
129+ public array Tarantool::evaluate(string $expression [, mixed args])
130+ public array Tarantool::delete(mixed $space, mixed $key [, mixed $index])
131+ public array Tarantool::update(mixed $space, mixed $key, array $ops [, number $index] )
132+ public array Tarantool::upsert(mixed $space, mixed $key, array $ops [, number $index] )
133+ }
134+ ```
135+
136+ #### Taratnool::__ construct
137+
102138```
139+ public Tarantool::__construct ( [ string $host = 'localhost' [, int $port = 3301 ] ] )
140+ ```
141+
142+ _ ** Description** _ : Creates a Tarantool client
103143
104144_ ** Parameters** _
105145
@@ -110,38 +150,20 @@ _**Return Value**_
110150
111151Tarantool class instance
112152
113- #### * Example*
153+ ##### * Example*
114154
115155``` php
116156$tnt = new Tarantool(); // -> new Tarantool('localhost', 3301);
117157$tnt = new Tarantool('tarantool.org'); // -> new Tarantool('tarantool.org', 3301);
118158$tnt = new Tarantool('localhost', 16847);
119159```
120160
121- ### Predefined Constants
122-
123- _ ** Description** _ : Available Tarantool Constants
124-
125- * ` TARANTOOL_ITER_EQ ` - Equality iterator (ALL)
126- * ` TARANTOOL_ITER_REQ ` - Reverse equality iterator
127- * ` TARANTOOL_ITER_ALL ` - Get all rows
128- * ` TARANTOOL_ITER_LT ` - Less then iterator
129- * ` TARANTOOL_ITER_LE ` - Less and equal iterator
130- * ` TARANTOOL_ITER_GE ` - Greater and equal iterator
131- * ` TARANTOOL_ITER_GT ` - Gtreater then iterator
132- * ` TARANTOOL_ITER_BITSET_ALL_SET ` - check if all given bits are set (BITSET only)
133- * ` TARANTOOL_ITER_BITSET_ANY_SET ` - check if any given bits are set (BITSET only)
134- * ` TARANTOOL_ITER_BITSET_ALL_NOT_SET ` - check if all given bits are not set
135- (BITSET only)
136- * ` TARANTOOL_ITER_OVERLAPS ` - find dots in the n-dimension cube (RTREE only)
137- * ` TARANTOOL_ITER_NEIGHBOR ` - find nearest dots (RTREE only)
138-
139161## Manipulation connection
140162
141- ### connect
163+ ### Tarantool:: connect
142164
143165``` php
144- $tnt-> connect();
166+ public bool Tarantool:: connect ( void )
145167```
146168
147169_ ** Description** _ : Explicit connect to Tarantool Server. If not used, then connection
@@ -152,11 +174,10 @@ _**Return Value**_
152174** BOOL** : True on success
153175Raises ` Exception ` if can't connect to Tarantool.
154176
155- ### disconnect, close
177+ ### Tarantool:: disconnect
156178
157179``` php
158- $tnt->disconnect();
159- $tnt->close();
180+ public bool Tarantool::disconnect ( void )
160181```
161182
162183_ ** Description** _ : Explicitly close connection to Tarantool Server. If you're
@@ -166,10 +187,10 @@ _**Return Value**_
166187
167188** BOOL** : True
168189
169- ### authenticate
190+ ### Tarantool:: authenticate
170191
171192``` php
172- $tnt->connect( login, password);
193+ public Tarantool::authenticate(string $ login [, string $ password = NULL ] )
173194```
174195
175196_ ** Description** _ : Authenticate to Tarantool using given login/password
@@ -179,7 +200,7 @@ _**Parameters**_
179200* ` login ` : string - user login (mandatory)
180201* ` password ` : string - user password (mandatory, but ignored, if user is guest)
181202
182- _ ** Return Value** _
203+ _ ** Return Value** _ NULL
183204
184205#### * Example*
185206
@@ -193,14 +214,13 @@ $tnt->connect('valdis', 'pelsh')
193214 * - user is 'guest'
194215 * - password is empty and ignored, anyway
195216 */
196- $tnt->connect('guest', '' )
217+ $tnt->connect('guest')
197218```
198219
199- ### flushSchema, flush_schema
220+ ### Tarantool:: flushSchema
200221
201222``` php
202- $tnt->flushSchema();
203- $tnt->flush_schema()
223+ public bool Tarantool::flushSchema ( void )
204224```
205225
206226_ ** Description** _ : Remove space/index schema from client.
@@ -209,10 +229,10 @@ _**Return Value**_
209229
210230** BOOL** : True
211231
212- ### ping
232+ ### Tarantool:: ping
213233
214234``` php
215- $tnt-> ping();
235+ public bool Tarantool:: ping ( void )
216236```
217237
218238_ ** Description** _ : Ping Tarantool server.
@@ -225,10 +245,10 @@ Throws `Exception` on error.
225245
226246## Database queries
227247
228- ### select
248+ ### Tarantool:: select
229249
230250``` php
231- rv = $tnt-> select(space[, key[, index[, limit[, offset[, iterator]]]]]);
251+ public array Tarantool:: select(mixed $ space [, mixed $ key = array() [, mixed $ index = 0 [, int $ limit = PHP_INT_MAX [, int offset = 0 [, iterator = TARANTOOL_ITER_EQ ] ] ] ] ] )
232252```
233253
234254_ ** Description** _ : Execute select query from Tarantool server.
@@ -269,11 +289,11 @@ $tnt->select("test", null, null, 100, 100);
269289$tnt->select("test", null, null, 100, 100, TARANTOOL_ITER_REQ);
270290```
271291
272- ### insert, replace
292+ ### Tarantool:: insert, Tarantool:: replace
273293
274294``` php
275- rv = $tnt-> insert(space, tuple);
276- rv = $tnt-> replace(space, tuple);
295+ public array Tarantool:: insert(mixed $ space, array $ tuple)
296+ public array Tarantool:: replace(mixed $ space, array $ tuple)
277297```
278298
279299_ ** Description** _ : Insert (if not exists query with same PK) or Replace tuple.
@@ -301,10 +321,10 @@ $tnt->insert("test", array(1, 3, "smth completely different"));
301321$tnt->replace("test", array(1, 3, "smth completely different"));
302322```
303323
304- ### call
324+ ### Tarantool:: call
305325
306326``` php
307- rv = $tnt-> call(procedure[, args]);
327+ public array Tarantool:: call(string $ procedure [, mixed args])
308328```
309329
310330_ ** Description** _ : Call stored procedure
@@ -327,17 +347,17 @@ $tnt->call("test_2");
327347$tnt->call("test_3", array(3, 4));
328348```
329349
330- ### eval, evaluate
350+ ### Tarantool:: evaluate
331351
332352``` php
333- rv = $tnt->eval(lua_code [, args]);
353+ public array Tarantool::evaluate(string $expression [, mixed args])
334354```
335355
336356_ ** Description** _ : Evaluate given lua code (demands current user to have
337357` 'execute' ` rights for ` 'universe' ` in Tarantool)
338358
339359_ ** Parameters** _
340- * ` procedure ` : String, Lua code to evaluate (mandatory)
360+ * ` expression ` : String, Lua code to evaluate (mandatory)
341361* ` args ` : Any value to pass to procdure as arguments (empty by default)
342362
343363_ ** Return Value** _
@@ -354,10 +374,10 @@ $tnt->eval("return test_3(...)", array(3, 4));
354374$tnt->evaluate("return test_3(...)", array(3, 4));
355375```
356376
357- ### delete
377+ ### Tarantool:: delete
358378
359379``` php
360- rv = $tnt-> delete(space, key[, index]);
380+ public array Tarantool:: delete(mixed $ space, mixed $ key [, mixed $ index])
361381```
362382
363383_ ** Description** _ : Delete record with given key.
@@ -378,14 +398,15 @@ _**Return Value**_
378398``` php
379399/* Following code will delete all tuples from space `test` */
380400$tuples = $tnt->select("test");
381- foreach($tuples as $value)$
401+ foreach($tuples as $value) {
382402 $tnt->delete("test", Array($value[0]));
403+ }
383404```
384405
385- ### update
406+ ### Tarantool:: update
386407
387408``` php
388- rv = $tnt-> update(space, key, ops[, index]);
409+ public array Tarantool:: update(mixed $ space, mixed $ key, array $ ops [, number $ index] )
389410```
390411
391412_ ** Description** _ : Update record with given key (update in Tarantool is
@@ -535,10 +556,10 @@ $tnt->update("test", 1, array(
535556));
536557```
537558
538- ### upsert
559+ ### Tarantool:: upsert
539560
540561``` php
541- rv = $tnt->update( space, tuple, ops[, index]);
562+ public array Tarantool::upsert(mixed $ space, mixed $key, array $ ops [, number $ index] )
542563```
543564
544565_ ** Description** _ : Update or Insert command (If tuple with PK == PK('tuple') exists,
0 commit comments