Skip to content

Commit b675dbd

Browse files
committed
Fixed some inconsistencies, which were introduced during the upgrade to version 3.0.
Also fixed some other bugs. Specifically: - the document options like 'keepNull' were not sent to the server, so updates that were using these option were not getting the expected result. - the unset() function on the document was not implemented, so it was not in par with the examples in the readme. - introduced more tests to also check for the aforementioned issues.
1 parent 6bac100 commit b675dbd

39 files changed

+2170
-4471
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ language: php
22

33
matrix:
44
include:
5-
- php: '5.4'
6-
env: PHP_VERSION_USED="5.4"
75
- php: '5.5'
86
env: PHP_VERSION_USED="5.5"
97
- php: '5.6'
@@ -19,8 +17,7 @@ before_script:
1917
- chmod 777 ./tests/travis/setup_arangodb.sh
2018
- ./tests/travis/setup_arangodb.sh
2119

22-
script:
23-
- if [[ "${PHP_VERSION_USED}" == "5.4" ]]; then phpunit --configuration ./tests/phpunit.xml; fi
20+
script:
2421
- if [[ "${PHP_VERSION_USED}" == "5.5" ]]; then phpunit --configuration ./tests/phpunit.xml; fi
2522
- if [[ "${PHP_VERSION_USED}" == "5.6" ]]; then phpunit --configuration ./tests/phpunit.xml; fi
2623
- if [[ "${PHP_VERSION_USED}" == "7.0" ]]; then (cd tests && ../phpunit.phar . --colors=auto --verbose --bootstrap=bootstrap.php); fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212

13-
[Follow us on Twitter @arangodbphp to receive updates on the php driver](https://twitter.com/arangodbphp)
13+
[Follow us on Twitter @arangodbphp to receive updates on the PHP driver](https://twitter.com/arangodbphp)
1414
<br>
1515
<br>
1616
##### Table of Contents
@@ -63,7 +63,7 @@ The client library provides document and collection classes you can use to work
6363
<a name="requirements"></a>
6464
# Requirements
6565

66-
* ArangoDB database server version 2.5 or higher. Detailed info [here](https://github.com/arangodb/arangodb-php/wiki/Important-versioning-information-on-ArangoDB-PHP#arangodb-php-client-to-arangodb-server-interoperability-matrix)
66+
* ArangoDB database server version 3.0 or higher. Detailed info [here](https://github.com/arangodb/arangodb-php/wiki/Important-versioning-information-on-ArangoDB-PHP#arangodb-php-client-to-arangodb-server-interoperability-matrix)
6767

6868
* PHP version 5.4 or higher (Travis-tested with PHP 5.4, 5.5, 5.6, 7 and hhvm)
6969

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "arangodb/arangodb",
33
"type": "library",
44
"description": "ArangoDb PHP client",
5-
"keywords": ["database","ArangoDb","Arango","document store","NoSQL"],
5+
"keywords": ["database","ArangoDb","Arango","document store","NoSQL","multi-model","graph database"],
66
"homepage": "https://github.com/arangodb/arangodb-php",
77
"license": "Apache2",
88
"authors": [
@@ -22,7 +22,7 @@
2222
}
2323
],
2424
"require": {
25-
"php": ">=5.3.0"
25+
"php": ">=5.4.0"
2626
},
2727
"autoload": {
2828
"psr-0": {

lib/triagens/ArangoDb/Batch.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ public function append($method, $request)
319319
{
320320
preg_match('%/_api/simple/(?P<simple>\w*)|/_api/(?P<direct>\w*)%ix', $request, $regs);
321321

322+
if (!isset($regs['direct'])) {
323+
$regs['direct'] = '';
324+
}
322325
$type = $regs['direct'] != '' ? $regs['direct'] : $regs['simple'];
323326

324327
if ($type == $regs['direct'] && $method == 'GET') {

lib/triagens/ArangoDb/BatchPart.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function getProcessedResponse()
252252
break;
253253
case 'document':
254254
$json = $response->getJson();
255-
if ($json['error'] === false) {
255+
if (!isset($json['error']) or $json['error'] === false) {
256256
$id = $json[Document::ENTRY_ID];
257257
$response = $id;
258258
}
@@ -265,7 +265,7 @@ public function getProcessedResponse()
265265
break;
266266
case 'edge':
267267
$json = $response->getJson();
268-
if ($json['error'] === false) {
268+
if (!isset($json['error']) or $json['error'] === false) {
269269
$id = $json[Edge::ENTRY_ID];
270270
$response = $id;
271271
}
@@ -278,7 +278,7 @@ public function getProcessedResponse()
278278
break;
279279
case 'collection':
280280
$json = $response->getJson();
281-
if ($json['error'] === false) {
281+
if (!isset($json['error']) or $json['error'] === false) {
282282
$id = $json[Collection::ENTRY_ID];
283283
$response = $id;
284284
}

0 commit comments

Comments
 (0)