Skip to content

Commit 9e44832

Browse files
committed
updated for 2.3
1 parent 39f4476 commit 9e44832

File tree

11 files changed

+55
-42
lines changed

11 files changed

+55
-42
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ This will help us reproducing and finding bugs.
3838

3939
## Additional Resources
4040

41-
* [ArangoDB website](https://www.arangodb.org/)
41+
* [ArangoDB website](https://www.arangodb.com/)
4242
* [ArangoDB on Twitter](https://twitter.com/arangodb)
4343
* [ArangoDB-PHP on Twitter](https://twitter.com/arangodbphp)
4444
* [General GitHub documentation](https://help.github.com/)
45-
* [GitHub pull request documentation](https://help.github.com/send-pull-requests)
45+
* [GitHub pull request documentation](https://help.github.com/send-pull-requests)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![ArangoDB-PHP Logo](http://www.arangodb.org/wp-content/uploads/2013/03/logo_arangodbphp_trans.png)
1+
![ArangoDB-PHP Logo](http://www.arangodb.com/wp-content/uploads/2013/03/logo_arangodbphp_trans.png)
22

33
# ArangoDB-PHP - A PHP client for ArangoDB
44

lib/triagens/ArangoDb/AdminHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function reloadServerRouting()
185185
* and the distribution list in counts.
186186
* For more information on the statistics returned, please lookup the statistics interface description at
187187
*
188-
* @link http://www.arangodb.org/manuals/1.3.devel/HttpSystem.html#HttpSystemAdminStatistics
188+
* @link http://www.arangodb.com/manuals/1.3.devel/HttpSystem.html#HttpSystemAdminStatistics
189189
*
190190
* This will throw if the statistics cannot be retrieved
191191
*
@@ -213,7 +213,7 @@ public function getServerStatistics()
213213
* and a list of statistics figures in the attribute figures.
214214
* For more information on the statistics returned, please lookup the statistics interface description at
215215
*
216-
* @link http://www.arangodb.org/manuals/1.3.devel/HttpSystem.html#HttpSystemAdminStatistics
216+
* @link http://www.arangodb.com/manuals/1.3.devel/HttpSystem.html#HttpSystemAdminStatistics
217217
*
218218
* This will throw if the statistics-description cannot be retrieved
219219
*

lib/triagens/ArangoDb/CollectionHandler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public function getRevision($collectionId)
542542
* @param string $collectionId - the collection id
543543
* @param int $size - the size of the cap constraint
544544
*
545-
* @link http://www.arangodb.org/manuals/current/IndexCapHttp.html
545+
* @link http://www.arangodb.com/manuals/current/IndexCapHttp.html
546546
*
547547
* @return array - server response of the created index
548548
*/
@@ -564,7 +564,7 @@ public function createCapConstraint($collectionId, $size)
564564
* @param boolean $constraint - whether this is a constraint or not
565565
* @param boolean $ignoreNull - whether to ignore null
566566
*
567-
* @link http://www.arangodb.org/manuals/current/IndexGeoHttp.html
567+
* @link http://www.arangodb.com/manuals/current/IndexGeoHttp.html
568568
*
569569
* @return array - server response of the created index
570570
*/
@@ -599,7 +599,7 @@ public function createGeoIndex(
599599
* @param array $fields - an array of fields
600600
* @param boolean $unique - whether the values in the index should be unique or not
601601
*
602-
* @link http://www.arangodb.org/manuals/current/IndexHashHttp.html
602+
* @link http://www.arangodb.com/manuals/current/IndexHashHttp.html
603603
*
604604
* @return array - server response of the created index
605605
*/
@@ -621,7 +621,7 @@ public function createHashIndex($collectionId, array $fields, $unique = null)
621621
* @param array $fields - an array of fields
622622
* @param int $minLength - the minimum length of words to index
623623
*
624-
* @link http://www.arangodb.org/manuals/current/IndexFulltextHttp.html
624+
* @link http://www.arangodb.com/manuals/current/IndexFulltextHttp.html
625625
*
626626
* @return array - server response of the created index
627627
*/
@@ -643,7 +643,7 @@ public function createFulltextIndex($collectionId, array $fields, $minLength = n
643643
* @param array $fields - an array of fields
644644
* @param bool $unique - whether the index is unique or not
645645
*
646-
* @link http://www.arangodb.org/manuals/current/IndexSkiplistHttp.html
646+
* @link http://www.arangodb.com/manuals/current/IndexSkiplistHttp.html
647647
*
648648
* @return array - server response of the created index
649649
*/

lib/triagens/ArangoDb/Cursor.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class Cursor implements
9696
* result entry for result documents
9797
*/
9898
const ENTRY_RESULT = 'result';
99+
100+
/**
101+
* result entry for stats
102+
*/
103+
const ENTRY_STATS = 'stats';
99104

100105
/**
101106
* result entry for the full count (ignoring the outermost LIMIT)
@@ -135,8 +140,16 @@ public function __construct(Connection $connection, array $data, array $options)
135140
$this->_id = $data[self::ENTRY_ID];
136141
}
137142

138-
if (isset($data['extra'][self::FULL_COUNT])) {
139-
$this->_fullCount = $data['extra'][self::FULL_COUNT];
143+
if (isset($data['extra'][self::ENTRY_STATS])) {
144+
// ArangoDB 2.3+ return value struct
145+
$stats = $data['extra'][self::ENTRY_STATS];
146+
if (isset($stats[self::FULL_COUNT])) {
147+
$this->_fullCount = $stats[self::FULL_COUNT];
148+
}
149+
}
150+
else if (isset($data['extra'][self::FULL_COUNT])) {
151+
// pre-ArangoDB 2.3 return value struct
152+
$this->_fullCount = $data['extra'][self::FULL_COUNT];
140153
}
141154

142155
// attribute must be there

lib/triagens/ArangoDb/Database.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* This class provides functions to manage Databases through ArangoDB's Database API<br>
1717
*
18-
* @link http://www.arangodb.org/manuals/1.4/HttpDatabase.html
18+
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
1919
*
2020
* @package triagens\ArangoDb
2121
* @since 1.4
@@ -35,7 +35,7 @@ class Database
3535
* @param Connection $connection - the connection to be used
3636
* @param string $name - the database specification, for example 'myDatabase'
3737
*
38-
* @link http://www.arangodb.org/manuals/1.4/HttpDatabase.html
38+
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
3939
*
4040
* @return array $responseArray - The response array.
4141
*/
@@ -59,7 +59,7 @@ public static function create(Connection $connection, $name)
5959
* @param Connection $connection - the connection to be used
6060
* @param string $name - the database specification, for example 'myDatabase'
6161
*
62-
* @link http://www.arangodb.org/manuals/1.4/HttpDatabase.html
62+
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
6363
*
6464
* @return array $responseArray - The response array.
6565
*/
@@ -82,7 +82,7 @@ public static function delete(Connection $connection, $name)
8282
*
8383
* @param Connection $connection - the connection to be used
8484
*
85-
* @link http://www.arangodb.org/manuals/1.4/HttpDatabase.html
85+
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
8686
*
8787
* @return array $responseArray - The response array.
8888
*/
@@ -103,7 +103,7 @@ public static function listDatabases(Connection $connection)
103103
*
104104
* @param Connection $connection - the connection to be used
105105
*
106-
* @link http://www.arangodb.org/manuals/1.4/HttpDatabase.html
106+
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
107107
*
108108
* @return array $responseArray - The response array.
109109
*/
@@ -127,7 +127,7 @@ public static function listUserDatabases(Connection $connection)
127127
*
128128
* @param Connection $connection - the connection to be used
129129
*
130-
* @link http://www.arangodb.org/manuals/1.4/HttpDatabase.html
130+
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
131131
*
132132
* @return array $responseArray - The response array.
133133
*/
@@ -141,4 +141,4 @@ public static function getInfo(Connection $connection)
141141

142142
return $responseArray;
143143
}
144-
}
144+
}

lib/triagens/ArangoDb/Endpoint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static function isValid($value)
182182
* @param array $databases - a list of database names the endpoint is responsible for.
183183
* *
184184
*
185-
* @link http://www.arangodb.org/manuals/1.4/HttpEndpoint.html
185+
* @link http://www.arangodb.com/manuals/1.4/HttpEndpoint.html
186186
* @return array $responseArray - The response array.
187187
*/
188188
public static function create(Connection $connection, $endpoint, array $databases)
@@ -200,7 +200,7 @@ public static function create(Connection $connection, $endpoint, array $database
200200
* @param string $endpoint - the endpoint specification, e.g. tcp://127.0.0.1:8530
201201
* @param array $databases - a list of database names the endpoint is responsible for.
202202
*
203-
* @link http://www.arangodb.org/manuals/1.4/HttpEndpoint.html
203+
* @link http://www.arangodb.com/manuals/1.4/HttpEndpoint.html
204204
* @return array $responseArray - The response array.
205205
*/
206206
public static function modify(Connection $connection, $endpoint, array $databases)
@@ -223,7 +223,7 @@ public static function modify(Connection $connection, $endpoint, array $database
223223
* @param Connection $connection - the connection to be used
224224
* @param string $endpoint - the endpoint specification, e.g. tcp://127.0.0.1:8530
225225
*
226-
* @link http://www.arangodb.org/manuals/1.4/HttpEndpoint.html
226+
* @link http://www.arangodb.com/manuals/1.4/HttpEndpoint.html
227227
* @return array $responseArray - The response array.
228228
*/
229229
public static function delete(Connection $connection, $endpoint)
@@ -245,7 +245,7 @@ public static function delete(Connection $connection, $endpoint)
245245
*
246246
* @param Connection $connection - the connection to be used
247247
*
248-
* @link http://www.arangodb.org/manuals/1.4/HttpEndpoint.html
248+
* @link http://www.arangodb.com/manuals/1.4/HttpEndpoint.html
249249
* @return array $responseArray - The response array.
250250
*/
251251
public static function listEndpoints(Connection $connection)

lib/triagens/ArangoDb/GraphHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ public function replaceEdgeDefinition($graph, $edgeDefinition)
518518

519519
$options['_isNew'] = false;
520520

521-
$result = Graph::createFromArray($data['graph'], $options);
521+
$result = Graph::createFromArray($data['graph'], $options);
522522
$result->set(Graph::ENTRY_KEY, $data['graph'][self::OPTION_NAME]);
523523
return $result;
524524
}

lib/triagens/ArangoDb/Traversal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* The object requires the connection object, the startVertex, the edgeCollection and the optional parameters.<br>
1919
* <br>
2020
*
21-
* @link http://www.arangodb.org/manuals/1.4/HttpTraversals.html
21+
* @link http://www.arangodb.com/manuals/1.4/HttpTraversals.html
2222
*
2323
* @package triagens\ArangoDb
2424
* @since 1.4

tests/TraversalTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Class TraversalTest
1414
* Tests for the Traversal API implementation
1515
*
16-
* These tests are modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
16+
* These tests are modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
1717
*
1818
* @property Connection $connection
1919
* @property Graph $graph
@@ -193,7 +193,7 @@ public function createGraph()
193193

194194
/**
195195
* Test for creation of a graph and a traversal
196-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
196+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
197197
*
198198
* Test:
199199
* Follow only outbound edges:
@@ -217,7 +217,7 @@ public function testTraversalUsingDirectionOutbound()
217217

218218
/**
219219
* Test for creation of a graph and a traversal
220-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
220+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
221221
*
222222
* Test:
223223
* Follow only inbound edges:
@@ -241,7 +241,7 @@ public function testTraversalUsingDirectionInbound()
241241

242242
/**
243243
* Test for creation of a graph and a traversal
244-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
244+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
245245
*
246246
* Test:
247247
* Follow any direction of edges:
@@ -268,7 +268,7 @@ public function testTraversalUsingDirectionAnyAndUniquenessWithVerticesNoneAndEd
268268

269269
/**
270270
* Test for creation of a graph and a traversal
271-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
271+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
272272
*
273273
* Test:
274274
* Excluding Charlie and Bob:
@@ -295,7 +295,7 @@ public function testTraversalUsingDirectionOutboundAndFilter1()
295295

296296
/**
297297
* Test for creation of a graph and a traversal
298-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
298+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
299299
*
300300
* Test:
301301
* Do not follow edges from Bob:
@@ -322,7 +322,7 @@ public function testTraversalUsingDirectionOutboundAndFilter2()
322322

323323
/**
324324
* Test for creation of a graph and a traversal
325-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
325+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
326326
*
327327
* Test:
328328
* Visit only nodes in a depth of at least 2:
@@ -349,7 +349,7 @@ public function testTraversalUsingDirectionOutboundAndMinDepthIs2()
349349

350350
/**
351351
* Test for creation of a graph and a traversal
352-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
352+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
353353
*
354354
* Test:
355355
* Visit only nodes in a depth of at most 1:
@@ -376,7 +376,7 @@ public function testTraversalUsingDirectionOutboundAndMaxDepthIs1()
376376

377377
/**
378378
* Test for creation of a graph and a traversal
379-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
379+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
380380
*
381381
* Test:
382382
* Count all visited nodes and return a list of nodes only:
@@ -405,7 +405,7 @@ public function testTraversalCountVisitedNodesAndReturnListOfNodesOnly()
405405

406406
/**
407407
* Test for creation of a graph and a traversal
408-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
408+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
409409
*
410410
* Test:
411411
* Expand only inbound edges of Alice and outbound edges of Eve:
@@ -432,7 +432,7 @@ public function testTraversalExpandOnlyInboundOfAliceAndOutboundOfEve()
432432

433433
/**
434434
* Test for creation of a graph and a traversal
435-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
435+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
436436
*
437437
* Test:
438438
* Follow the depthfirst strategy:
@@ -476,7 +476,7 @@ public function testTraversalFollowDepthFirstStrategy()
476476

477477
/**
478478
* Test for creation of a graph and a traversal
479-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
479+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
480480
*
481481
* Test:
482482
* Using postorder ordering:
@@ -520,7 +520,7 @@ public function testTraversalUsingPostOrderOrdering()
520520

521521
/**
522522
* Test for creation of a graph and a traversal
523-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
523+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
524524
*
525525
* Test:
526526
* Using backward item-ordering:
@@ -564,7 +564,7 @@ public function testTraversalUsingBackwardItemOrdering()
564564

565565
/**
566566
* Test for creation of a graph and a traversal
567-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
567+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
568568
*
569569
* Test:
570570
* Edges should only be included once globally, but nodes are included every time they are visited:
@@ -600,7 +600,7 @@ public function testTraversalIncludeEdgesOnlyOnceGloballyButNodesEveryTimeVisite
600600

601601
/**
602602
* Test for creation of a graph and a traversal
603-
* Modeled after: http://www.arangodb.org/manuals/1.4/HttpTraversals.html
603+
* Modeled after: http://www.arangodb.com/manuals/1.4/HttpTraversals.html
604604
*
605605
* Test:
606606
* If the underlying graph is cyclic, maxIterations should be set:

0 commit comments

Comments
 (0)