Skip to content

Commit 6578e4f

Browse files
authored
Merge pull request #7 from sandrokeil/feature/http-factor
Use HTTP factory and introduce stream handler
2 parents 299ff6a + 11ae124 commit 6578e4f

File tree

101 files changed

+2304
-6228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2304
-6228
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ composer.lock
44
clover.xml
55
coveralls-upload.json
66
phpunit.xml
7-
vendor/
7+
vendor/
8+
docker-compose.yml
9+
.phpunit.result.cache

.travis.yml

+9-46
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,25 @@ env:
77
matrix:
88
fast_finish: true
99
include:
10-
- php: 7.1
11-
env:
12-
- DEPENDENCIES=""
13-
- USE_VPACK=true
14-
- ARANGODB_VERSION=3.4.0
15-
- php: 7.1
16-
env:
17-
- DEPENDENCIES=""
18-
- USE_VPACK=false
19-
- ARANGODB_VERSION=3.4.0
2010
- php: 7.2
2111
env:
2212
- DEPENDENCIES=""
23-
- USE_VPACK=true
2413
- EXECUTE_CS_CHECK=true
25-
- ARANGODB_VERSION=3.4.0
26-
- php: 7.2
27-
env:
28-
- DEPENDENCIES=""
29-
- USE_VPACK=false
30-
- TEST_COVERAGE=true
31-
- ARANGODB_VERSION=3.4.0
32-
- php: 7.3
33-
env:
34-
- DEPENDENCIES=""
35-
- USE_VPACK=true
36-
- ARANGODB_VERSION=3.4.0
14+
- ARANGODB_VERSION=3.4.10
3715
- php: 7.3
3816
env:
3917
- DEPENDENCIES=""
40-
- USE_VPACK=false
41-
- ARANGODB_VERSION=3.4.0
42-
- php: 7.4
43-
env:
44-
- DEPENDENCIES=""
45-
- USE_VPACK=true
46-
- ARANGODB_VERSION=3.4.0
18+
- EXECUTE_PHPSTAN=true
19+
- ARANGODB_VERSION=3.5.5
4720
- php: 7.4
4821
env:
4922
- DEPENDENCIES=""
50-
- USE_VPACK=false
51-
- ARANGODB_VERSION=3.4.0
52-
- php: nightly
53-
env:
54-
- DEPENDENCIES=""
55-
- USE_VPACK=true
56-
- ARANGODB_VERSION=3.4.0
23+
- TEST_COVERAGE=true
24+
- ARANGODB_VERSION=3.6.4
5725
- php: nightly
5826
env:
5927
- DEPENDENCIES=""
60-
- USE_VPACK=false
61-
- ARANGODB_VERSION=3.4.0
28+
- ARANGODB_VERSION=latest
6229

6330
allow_failures:
6431
- php: nightly
@@ -77,18 +44,14 @@ before_script:
7744
- mkdir -p "$HOME/.php-cs-fixer"
7845
- composer self-update
7946
- composer update --prefer-dist $DEPENDENCIES
80-
- if [[ $USE_VPACK == 'true' ]]; then sudo apt-get update; fi
81-
- if [[ $USE_VPACK == 'true' ]]; then sudo apt-get install -y git build-essential autoconf automake libtool bison re2c cmake; fi
82-
- if [[ $USE_VPACK == 'true' ]]; then ./test/travis/compile_vpack.sh; fi
83-
- ./test/travis/setup_arangodb.sh
47+
- ./test/.travis/setup_arangodb.sh
8448

8549
script:
86-
- if [[ $PHPSTAN_CHECK == 'true' ]]; then vendor/bin/phpstan analyze -l max -c ./phpstan.installer.neon ./src; fi
50+
- if [[ $EXECUTE_PHPSTAN == 'true' ]]; then ./vendor/bin/phpstan analyze -l max -c ./phpstan.installer.neon ./src; fi
8751
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs; fi
8852
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/docheader check src/ tests/; fi
8953
- if [[ $TEST_COVERAGE == 'true' ]]; then php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml; fi
90-
- if [[ $USE_VPACK == 'true' ]]; then php -dextension=velocypack.so ./vendor/bin/phpunit; fi
91-
- if [[ $USE_VPACK == 'false' ]]; then php ./vendor/bin/phpunit; fi
54+
- if [[ $TEST_COVERAGE != 'true' ]]; then php ./vendor/bin/phpunit; fi
9255

9356
after_script:
9457
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi

README.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
[![License](https://poser.pugx.org/sandrokeil/arangodb-php-client/license.png)](https://packagist.org/packages/sandrokeil/arangodb-php-client)
99

1010

11-
[ArangoDB](https://arangodb.com/ "native multi-model database") PHP PSR 7/18 client implementation with
12-
[Velcoypack](https://github.com/arangodb/velocypack "a fast and compact format for serialization and storage") support
13-
via [martin-schilling/php-velocypack](https://github.com/martin-schilling/php-velocypack/).
11+
[ArangoDB](https://arangodb.com/ "native multi-model database") PHP PSR 7/17/18 client implementation.
1412

1513
## Requirements
1614

17-
- PHP >= 7.1
18-
- ArangoDB server version >= 3.4 (3.3 has some issues with Velocypack)
15+
- PHP >= 7.2
16+
- ArangoDB server version >= 3.4
17+
18+
## Examples
19+
20+
Examples of how to create collections or documents and more are provided in the `examples` directory.
1921

2022
## Setup
2123

@@ -28,9 +30,11 @@ and [Docker Compose](https://docs.docker.com/compose/install/ "Install Docker Co
2830
Install dependencies with:
2931

3032
```
31-
$ docker run --rm -i -v $(pwd):/app prooph/composer:7.2 update -o
33+
$ docker run --rm -i -v $(pwd):/app prooph/composer:7.4 update -o
3234
```
3335

36+
Copy `docker-compose.yml.dist` to `docker-compose.yml` and modify to your needs.
37+
3438
Start containers with
3539
```
3640
$ docker-compose up -d --no-recreate
@@ -41,10 +45,3 @@ Execute tests with
4145
```
4246
$ docker-compose run --rm php vendor/bin/phpunit
4347
```
44-
45-
Execute Velocypack tests with
46-
47-
```
48-
$ docker-compose run --rm vpack72 vendor/bin/phpunit
49-
```
50-

composer.json

+18-11
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,38 @@
44
"type": "library",
55
"license": "BSD-3-Clause",
66
"keywords": [
7-
"arangodb"
7+
"arangodb",
8+
"http",
9+
"client",
10+
"vpack",
11+
"json",
12+
"php"
813
],
914
"config": {
1015
"sort-packages": true
1116
},
1217
"require": {
13-
"php": "^7.1",
18+
"php": "^7.2",
1419
"ext-json": "*",
1520
"fig/http-message-util": "^1.1.2",
16-
"psr/http-client": "^1.0"
21+
"psr/http-client": "^1.0",
22+
"psr/http-factory": "^1.0",
23+
"psr/http-message": "^1.0"
1724
},
1825
"require-dev": {
19-
"infection/infection": "^0.11.0",
20-
"malukenho/docheader": "^0.1.7",
26+
"infection/infection": "^0.16.3 || ^0.15.3",
27+
"malukenho/docheader": "^0.1.8",
2128
"php-coveralls/php-coveralls": "^2.1",
22-
"phpstan/phpstan": "^0.10.5",
23-
"phpstan/phpstan-strict-rules": "^0.10.1",
24-
"phpunit/phpunit": "^7.0.1",
29+
"phpstan/phpstan": "^0.12.29",
30+
"phpstan/phpstan-strict-rules": "^0.12.2",
31+
"phpunit/phpunit": "^9.2.3 || ^8.5",
2532
"roave/security-advisories": "dev-master",
26-
"squizlabs/php_codesniffer": "^2.9.1"
33+
"squizlabs/php_codesniffer": "^3.5.5",
34+
"laminas/laminas-diactoros": "^2.3.0"
2735
},
2836
"autoload": {
2937
"psr-4": {
30-
"ArangoDb\\": "src/",
31-
"Velocypack\\": "src/Polyfill/"
38+
"ArangoDb\\": "src/"
3239
}
3340
},
3441
"autoload-dev": {

docker-compose.yml

-70
This file was deleted.

docker-compose.yml.dist

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '2'
2+
services:
3+
# To run tests docker-compose run --rm php vendor/bin/phpunit
4+
php:
5+
image: prooph/php:7.4-cli-xdebug
6+
environment:
7+
PHP_IDE_CONFIG: "serverName=application"
8+
XDEBUG_CONFIG: "remote_host=172.17.0.1"
9+
arangodb_host: "tcp://arangodb:8529"
10+
arangodb_username: ""
11+
arangodb_password: ""
12+
arangodb_dbname: testing
13+
volumes:
14+
- "./:/app"
15+
16+
arangodb:
17+
image: arangodb/arangodb:3.6.4
18+
ports:
19+
- 8529:8529
20+
environment:
21+
- ARANGO_NO_AUTH=1

env/7.1

-46
This file was deleted.

env/7.2

-46
This file was deleted.

0 commit comments

Comments
 (0)