diff --git a/.drone.yml b/.drone.yml index 904ebd6..3c8673e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,7 +15,7 @@ pipeline: volumes: - /cache:/cache commands: - - composer install + - composer update ${COMPOSER_BOUNDARY} grumphp: group: test @@ -39,3 +39,6 @@ matrix: IMAGE_PHP: - fpfis/httpd-php-dev:5.6 - fpfis/httpd-php-dev:7.1 + COMPOSER_BOUNDARY: + - '--prefer-lowest' + - '' diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aa9a047 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# PHP PSR-2 Coding Standards +# http://www.php-fig.org/psr/psr-2/ + +root = true + +[*.php] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 diff --git a/.gitignore b/.gitignore index b6cddba..086b917 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ phpunit.xml composer.lock .idea log.txt +docker-compose.yml diff --git a/README.md b/README.md index 799198b..3a33028 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,33 @@ # Poetry Client Library [![Build Status](https://drone.fpfis.eu/api/badges/ec-europa/oe-poetry-client/status.svg)](https://drone.fpfis.eu/ec-europa/oe-poetry-client/) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ec-europa/oe-poetry-client/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ec-europa/oe-poetry-client/?branch=master) +[![Packagist](https://img.shields.io/packagist/v/ec-europa/oe-poetry-client.svg)](https://packagist.org/packages/ec-europa/oe-poetry-client) The Poetry Client Library aims to hide Poetry service complexity behind and easy-to-use client library so that users don't have to worry about building their own request messages nor implementing SOAP interactions. +## Installation using Docker Compose + +The setup procedure can be simplified by using Docker Compose. + +Requirements: + +- [Docker](https://www.docker.com/get-docker) +- [Docker-compose](https://docs.docker.com/compose/) + +Copy docker-compose.yml.dist into docker-compose.yml. + +You can make any alterations you need for your local Docker setup. However, the defaults should be enough to set the project up. + +Run: + +``` +$ docker-compose up -d +``` + +Then: + +``` +$ docker-compose exec web composer install +``` + For more information check the documentation [here](docs/00-overview.md). diff --git a/composer.json b/composer.json index 140606b..3a54971 100644 --- a/composer.json +++ b/composer.json @@ -2,27 +2,30 @@ "name": "ec-europa/oe-poetry-client", "description": "Client library for the European Commission Poetry Service", "type": "library", - "minimum-stability": "alpha", + "minimum-stability": "stable", "prefer-stable": true, "license": "EUPL-1.2", "require": { - "php": ">=5.6", "ext-soap": "*", - "symfony/validator": "^2.8 || ^3.0", - "symfony/event-dispatcher": "^2.8 || ^3.0", - "symfony/expression-language": "^2.8 || ^3.0", - "symfony/dom-crawler": "^2.8 || ^3.0", - "league/plates": "^3.3", - "pimple/pimple": "^3.1", - "psr/log": "^1.0" + "jeremeamia/superclosure": "~2.2", + "league/plates": "^3.3.0", + "php": ">=5.6", + "pimple/pimple": "~3.2.3", + "psr/log": "~1.0.2", + "symfony/dom-crawler": "^2.8|^3.0", + "symfony/event-dispatcher": "^2.8|^3.0", + "symfony/expression-language": "^2.8|^3.0", + "symfony/validator": "^2.8|^3.0", + "symfony/yaml": "~3.3|~4.0" }, "require-dev": { - "openeuropa/code-review": "~0.2", - "phpunit/phpunit": "^5||^6", - "peridot-php/leo": "^1.6", + "guzzle/guzzle": "~2.7|~3.0", + "internations/http-mock": "~0.8", "mockery/mockery": "^0.9.9", - "phpspec/phpspec": "^4.0", - "internations/http-mock": "^0.8" + "openeuropa/code-review": "~1.0@alpha", + "peridot-php/leo": "~1.6", + "phpspec/phpspec": "~4.0@alpha", + "phpunit/phpunit": "~5.5|~6" }, "suggest": { "monolog/monolog": "Log Poetry requests and responses via Monolog", @@ -30,13 +33,13 @@ }, "autoload": { "psr-4": { - "EC\\Poetry\\": "./src" + "EC\\Poetry\\": "./src/" } }, "autoload-dev": { "psr-4": { - "EC\\Poetry\\Tests\\": "./tests/src", - "spec\\EC\\Poetry\\": "./spec" + "EC\\Poetry\\Tests\\": "./tests/src/", + "spec\\EC\\Poetry\\": "./spec/" } } } diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 23b16bc..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '2' -services: - php56: - image: fpfis/httpd-php-dev:5.6 - volumes: - - .:/var/www/html - environment: - XDEBUG_CONFIG: "remote_enable=1 remote_host=${DOCKER_HOST_IP} remote_port=9000 idekey=PHPSTORM remote_autostart=1" - PHP_IDE_CONFIG: "serverName=Test" - - php71: - image: fpfis/httpd-php-dev:7.1 - volumes: - - .:/var/www/html - environment: - XDEBUG_CONFIG: "remote_enable=1 remote_host=${DOCKER_HOST_IP} remote_port=9000 idekey=PHPSTORM remote_autostart=1" - PHP_IDE_CONFIG: "serverName=Test" diff --git a/docker-compose.yml.dist b/docker-compose.yml.dist new file mode 100644 index 0000000..d8de5f0 --- /dev/null +++ b/docker-compose.yml.dist @@ -0,0 +1,28 @@ +version: '2' +services: + web: + image: fpfis/httpd-php-dev:7.1 + working_dir: /var/www/html + ports: + - 8080:8080 + volumes: + - .:/var/www/html # Non Mac users. + # - nfsmount:/var/www/html # Mac Users with the nfsmount volume. + environment: + XDEBUG_CONFIG: "remote_enable=1 remote_host=10.254.254.254 remote_port=9000 idekey=PHPSTORM remote_autostart=1" + PHP_IDE_CONFIG: "serverName=Docker" + # For Xdebug setup, run this command in the terminal: + # For Mac users: sudo ifconfig en0 alias 10.254.254.254 255.255.255.0 + # For Linux users: sudo ip addr add 10.254.254.254/32 dev lo label lo:1 + +#### Mac users: uncomment the "volumes" key to enable the NFS file sharing. You can find more information about Docker for Mac here: https://github.com/openeuropa/openeuropa/blob/master/docs/starting/tooling.md#using-docker-on-macos + +#volumes: +# nfsmount: +# driver: local +# driver_opts: +# type: nfs +# o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3 +# device: ":${PWD}/" + +#### End Mac users.