Skip to content

Commit

Permalink
Merge pull request #7 from sandrokeil/feature/http-factor
Browse files Browse the repository at this point in the history
Use HTTP factory and introduce stream handler
  • Loading branch information
sandrokeil authored Jun 17, 2020
2 parents 299ff6a + 11ae124 commit 6578e4f
Show file tree
Hide file tree
Showing 101 changed files with 2,304 additions and 6,228 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ composer.lock
clover.xml
coveralls-upload.json
phpunit.xml
vendor/
vendor/
docker-compose.yml
.phpunit.result.cache
55 changes: 9 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,25 @@ env:
matrix:
fast_finish: true
include:
- php: 7.1
env:
- DEPENDENCIES=""
- USE_VPACK=true
- ARANGODB_VERSION=3.4.0
- php: 7.1
env:
- DEPENDENCIES=""
- USE_VPACK=false
- ARANGODB_VERSION=3.4.0
- php: 7.2
env:
- DEPENDENCIES=""
- USE_VPACK=true
- EXECUTE_CS_CHECK=true
- ARANGODB_VERSION=3.4.0
- php: 7.2
env:
- DEPENDENCIES=""
- USE_VPACK=false
- TEST_COVERAGE=true
- ARANGODB_VERSION=3.4.0
- php: 7.3
env:
- DEPENDENCIES=""
- USE_VPACK=true
- ARANGODB_VERSION=3.4.0
- ARANGODB_VERSION=3.4.10
- php: 7.3
env:
- DEPENDENCIES=""
- USE_VPACK=false
- ARANGODB_VERSION=3.4.0
- php: 7.4
env:
- DEPENDENCIES=""
- USE_VPACK=true
- ARANGODB_VERSION=3.4.0
- EXECUTE_PHPSTAN=true
- ARANGODB_VERSION=3.5.5
- php: 7.4
env:
- DEPENDENCIES=""
- USE_VPACK=false
- ARANGODB_VERSION=3.4.0
- php: nightly
env:
- DEPENDENCIES=""
- USE_VPACK=true
- ARANGODB_VERSION=3.4.0
- TEST_COVERAGE=true
- ARANGODB_VERSION=3.6.4
- php: nightly
env:
- DEPENDENCIES=""
- USE_VPACK=false
- ARANGODB_VERSION=3.4.0
- ARANGODB_VERSION=latest

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

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

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi
Expand Down
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
[![License](https://poser.pugx.org/sandrokeil/arangodb-php-client/license.png)](https://packagist.org/packages/sandrokeil/arangodb-php-client)


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

## Requirements

- PHP >= 7.1
- ArangoDB server version >= 3.4 (3.3 has some issues with Velocypack)
- PHP >= 7.2
- ArangoDB server version >= 3.4

## Examples

Examples of how to create collections or documents and more are provided in the `examples` directory.

## Setup

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

```
$ docker run --rm -i -v $(pwd):/app prooph/composer:7.2 update -o
$ docker run --rm -i -v $(pwd):/app prooph/composer:7.4 update -o
```

Copy `docker-compose.yml.dist` to `docker-compose.yml` and modify to your needs.

Start containers with
```
$ docker-compose up -d --no-recreate
Expand All @@ -41,10 +45,3 @@ Execute tests with
```
$ docker-compose run --rm php vendor/bin/phpunit
```

Execute Velocypack tests with

```
$ docker-compose run --rm vpack72 vendor/bin/phpunit
```

29 changes: 18 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,38 @@
"type": "library",
"license": "BSD-3-Clause",
"keywords": [
"arangodb"
"arangodb",
"http",
"client",
"vpack",
"json",
"php"
],
"config": {
"sort-packages": true
},
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-json": "*",
"fig/http-message-util": "^1.1.2",
"psr/http-client": "^1.0"
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"infection/infection": "^0.11.0",
"malukenho/docheader": "^0.1.7",
"infection/infection": "^0.16.3 || ^0.15.3",
"malukenho/docheader": "^0.1.8",
"php-coveralls/php-coveralls": "^2.1",
"phpstan/phpstan": "^0.10.5",
"phpstan/phpstan-strict-rules": "^0.10.1",
"phpunit/phpunit": "^7.0.1",
"phpstan/phpstan": "^0.12.29",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.2.3 || ^8.5",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^2.9.1"
"squizlabs/php_codesniffer": "^3.5.5",
"laminas/laminas-diactoros": "^2.3.0"
},
"autoload": {
"psr-4": {
"ArangoDb\\": "src/",
"Velocypack\\": "src/Polyfill/"
"ArangoDb\\": "src/"
}
},
"autoload-dev": {
Expand Down
70 changes: 0 additions & 70 deletions docker-compose.yml

This file was deleted.

21 changes: 21 additions & 0 deletions docker-compose.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '2'
services:
# To run tests docker-compose run --rm php vendor/bin/phpunit
php:
image: prooph/php:7.4-cli-xdebug
environment:
PHP_IDE_CONFIG: "serverName=application"
XDEBUG_CONFIG: "remote_host=172.17.0.1"
arangodb_host: "tcp://arangodb:8529"
arangodb_username: ""
arangodb_password: ""
arangodb_dbname: testing
volumes:
- "./:/app"

arangodb:
image: arangodb/arangodb:3.6.4
ports:
- 8529:8529
environment:
- ARANGO_NO_AUTH=1
46 changes: 0 additions & 46 deletions env/7.1

This file was deleted.

46 changes: 0 additions & 46 deletions env/7.2

This file was deleted.

Loading

0 comments on commit 6578e4f

Please sign in to comment.