diff --git a/README.md b/README.md index 0d05917..efdd92b 100644 --- a/README.md +++ b/README.md @@ -1 +1,138 @@ -# Skies proxy api +# Expressive Skeleton and Installer + +[![Build Status](https://secure.travis-ci.org/zendframework/zend-expressive-skeleton.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-expressive-skeleton) +[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-expressive-skeleton/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-expressive-skeleton?branch=master) + +*Begin developing PSR-7 middleware applications in seconds!* + +[zend-expressive](https://github.com/zendframework/zend-expressive) builds on +[zend-stratigility](https://github.com/zendframework/zend-stratigility) to +provide a minimalist PSR-7 middleware framework for PHP with routing, DI +container, optional templating, and optional error handling capabilities. + +This installer will setup a skeleton application based on zend-expressive by +choosing optional packages based on user input as demonstrated in the following +screenshot: + +![screenshot-installer](https://cloud.githubusercontent.com/assets/459648/10410494/16bdc674-6f6d-11e5-8190-3c1466e93361.png) + +The user selected packages are saved into `composer.json` so that everyone else +working on the project have the same packages installed. Configuration files and +templates are prepared for first use. The installer command is removed from +`composer.json` after setup succeeded, and all installer related files are +removed. + +## Getting Started + +Start your new Expressive project with composer: + +```bash +$ composer create-project zendframework/zend-expressive-skeleton +``` + +After choosing and installing the packages you want, go to the +`` and start PHP's built-in web server to verify installation: + +```bash +$ composer run --timeout=0 serve +``` + +You can then browse to http://localhost:8080. + +> ### Setting a timeout +> +> Composer commands time out after 300 seconds (5 minutes). On Linux-based +> systems, the `php -S` command that `composer serve` spawns continues running +> as a background process, but on other systems halts when the timeout occurs. +> +> As such, we recommend running the `serve` script using a timeout. This can +> be done by using `composer run` to execute the `serve` script, with a +> `--timeout` option. When set to `0`, as in the previous example, no timeout +> will be used, and it will run until you cancel the process (usually via +> `Ctrl-C`). Alternately, you can specify a finite timeout; as an example, +> the following will extend the timeout to a full day: +> +> ```bash +> $ composer run --timeout=86400 serve +> ``` + +## Troubleshooting + +If the installer fails during the ``composer create-project`` phase, please go +through the following list before opening a new issue. Most issues we have seen +so far can be solved by `self-update` and `clear-cache`. + +1. Be sure to work with the latest version of composer by running `composer self-update`. +2. Try clearing Composer's cache by running `composer clear-cache`. + +If neither of the above help, you might face more serious issues: + +- Info about the [zlib_decode error](https://github.com/composer/composer/issues/4121). +- Info and solutions for [composer degraded mode](https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode). + +## Application Development Mode Tool + +This skeleton comes with [zf-development-mode](https://github.com/zfcampus/zf-development-mode). +It provides a composer script to allow you to enable and disable development mode. + +### To enable development mode + +**Note:** Do NOT run development mode on your production server! + +```bash +$ composer development-enable +``` + +**Note:** Enabling development mode will also clear your configuration cache, to +allow safely updating dependencies and ensuring any new configuration is picked +up by your application. + +### To disable development mode + +```bash +$ composer development-disable +``` + +### Development mode status + +```bash +$ composer development-status +``` + +## Configuration caching + +By default, the skeleton will create a configuration cache in +`data/config-cache.php`. When in development mode, the configuration cache is +disabled, and switching in and out of development mode will remove the +configuration cache. + +You may need to clear the configuration cache in production when deploying if +you deploy to the same directory. You may do so using the following: + +```bash +$ composer clear-config-cache +``` + +You may also change the location of the configuration cache itself by editing +the `config/config.php` file and changing the `config_cache_path` entry of the +local `$cacheConfig` variable. + +## Skeleton Development + +This section applies only if you cloned this repo with `git clone`, not when you +installed expressive with `composer create-project ...`. + +If you want to run tests against the installer, you need to clone this repo and +setup all dependencies with composer. Make sure you **prevent composer running +scripts** with `--no-scripts`, otherwise it will remove the installer and all +tests. + +```bash +$ composer update --no-scripts +$ composer test +``` + +Please note that the installer tests remove installed config files and templates +before and after running the tests. + +Before contributing read [the contributing guide](CONTRIBUTING.md). diff --git a/bin/clear-config-cache.php b/bin/clear-config-cache.php new file mode 100644 index 0000000..50a14ce --- /dev/null +++ b/bin/clear-config-cache.php @@ -0,0 +1,46 @@ +2.2,<2.4" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^5.7", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2017-08-25T07:02:50+00:00" + }, + { + "name": "doctrine/collections", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2017-07-22T10:37:32+00:00" + }, + { + "name": "doctrine/common", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "a3e240fa07ec9748387c13534949d543c0e177fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/a3e240fa07ec9748387c13534949d543c0e177fa", + "reference": "a3e240fa07ec9748387c13534949d543c0e177fa", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^1.0", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2017-09-02T17:51:46+00:00" + }, + { + "name": "doctrine/inflector", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2017-07-22T12:18:28+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "fig/http-message-util", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message-util.git", + "reference": "20b2c280cb6914b7b83089720df44e490f4b42f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/20b2c280cb6914b7b83089720df44e490f4b42f0", + "reference": "20b2c280cb6914b7b83089720df44e490f4b42f0", "shasum": "" }, "require": { @@ -81,20 +494,201 @@ "request", "response" ], - "time": "2016-09-19T14:52:54+00:00" + "time": "2017-02-09T16:10:21+00:00" }, { - "name": "http-interop/http-middleware", - "version": "0.2.0", + "name": "guzzlehttp/guzzle", + "version": "6.3.0", "source": { "type": "git", - "url": "https://github.com/http-interop/http-middleware.git", - "reference": "ff545c87e97bf4d88f0cb7eb3e89f99aaa53d7a9" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-middleware/zipball/ff545c87e97bf4d88f0cb7eb3e89f99aaa53d7a9", - "reference": "ff545c87e97bf4d88f0cb7eb3e89f99aaa53d7a9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "http-interop/http-middleware", + "version": "0.4.1", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-middleware.git", + "reference": "9a801fe60e70d5d608b61d56b2dcde29516c81b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-middleware/zipball/9a801fe60e70d5d608b61d56b2dcde29516c81b9", + "reference": "9a801fe60e70d5d608b61d56b2dcde29516c81b9", "shasum": "" }, "require": { @@ -109,7 +703,7 @@ }, "autoload": { "psr-4": { - "Interop\\Http\\Middleware\\": "src/" + "Interop\\Http\\ServerMiddleware\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -122,7 +716,7 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for HTTP middleware", + "description": "Common interface for HTTP server-side middleware", "keywords": [ "factory", "http", @@ -133,20 +727,20 @@ "request", "response" ], - "time": "2016-09-25T13:30:27+00:00" + "time": "2017-01-14T15:23:42+00:00" }, { "name": "nikic/fast-route", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/nikic/FastRoute.git", - "reference": "f3dcf5130e634b6123d40727d612ec6aa4f61fb3" + "reference": "b5f95749071c82a8e0f58586987627054400cdf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/f3dcf5130e634b6123d40727d612ec6aa4f61fb3", - "reference": "f3dcf5130e634b6123d40727d612ec6aa4f61fb3", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/b5f95749071c82a8e0f58586987627054400cdf6", + "reference": "b5f95749071c82a8e0f58586987627054400cdf6", "shasum": "" }, "require": { @@ -176,7 +770,56 @@ "router", "routing" ], - "time": "2016-10-20T17:36:47+00:00" + "time": "2017-01-19T11:35:12+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/http-message", @@ -234,25 +877,27 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "3db4b0df21d1f527304650e717c66af48981f1c4" + "reference": "43f7f8243b81e3fd843b150a30a6d0a91167d4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3db4b0df21d1f527304650e717c66af48981f1c4", - "reference": "3db4b0df21d1f527304650e717c66af48981f1c4", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/43f7f8243b81e3fd843b150a30a6d0a91167d4f5", + "reference": "43f7f8243b81e3fd843b150a30a6d0a91167d4f5", "shasum": "" }, "conflict": { "adodb/adodb-php": "<5.20.6", - "amphp/artax": ">=2,<2.0.4|>0.7.1,<1.0.4", + "amphp/artax": ">=2,<2.0.6|<1.0.6", "aws/aws-sdk-php": ">=3,<3.2.1", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=3,<3.0.15|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=1.3,<1.3.18|>=2.7,<2.7.6|>=3.1,<3.1.4", + "cakephp/cakephp": ">=2,<2.4.99|>=1.3,<1.3.18|>=3,<3.0.15|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3.1,<3.1.4", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<2.1", "codeigniter/framework": "<=3.0.6", "composer/composer": "<=1.0.0-alpha11", "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2.11,<3.5.15", + "contao/core": ">=2,<3.5.28", + "contao/core-bundle": ">=4,<4.4.1", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", @@ -263,8 +908,9 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=8,<8.2.3", - "drupal/drupal": ">=8,<8.2.3", + "drupal/core": ">=8,<8.3.7", + "drupal/drupal": ">=8,<8.3.7", + "ezsystems/ezpublish-legacy": ">=2017.8,<2017.8.1.1|>=5.4,<5.4.10.1|>=5.3,<5.3.12.2", "firebase/php-jwt": "<2", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", @@ -275,23 +921,28 @@ "joomla/session": "<1.3.1", "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", + "magento/magento1ee": ">=1.9,<1.14.3.2", "magento/magento2ce": ">=2,<2.2", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", + "onelogin/php-saml": "<2.10.4", "oro/crm": ">=1.7,<1.7.4", "oro/platform": ">=1.7,<1.7.4", - "phpmailer/phpmailer": ">=5,<5.2.22", + "phpmailer/phpmailer": ">=5,<5.2.24", + "phpxmlrpc/extras": "<6.0.1", "pusher/pusher-php-server": "<2.2.1", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "shopware/shopware": "<4.4|>=5,<5.2.15", + "shopware/shopware": "<5.2.25", "silverstripe/cms": ">=3.1,<3.1.11|>=3,<=3.0.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", "silverstripe/framework": ">=3,<3.3", "silverstripe/userforms": "<3", "simplesamlphp/saml2": "<1.8.1|>=1.9,<1.9.1|>=1.10,<1.10.3|>=2,<2.3.3", - "simplesamlphp/simplesamlphp": "<1.14.11", + "simplesamlphp/simplesamlphp": "<1.14.16", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "socalnick/scn-social-auth": "<1.15.2", + "squizlabs/php_codesniffer": ">=1,<2.8.1", "swiftmailer/swiftmailer": ">=4,<5.4.5", "symfony/dependency-injection": ">=2,<2.0.17", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.7", @@ -299,11 +950,11 @@ "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9", - "symfony/security-core": ">=2.8,<2.8.6|>=3,<3.0.6|>=2.4,<2.6.13|>=2.7,<2.7.9", + "symfony/security": ">=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5|>=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9", + "symfony/security-core": ">=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5|>=2.8,<2.8.6|>=3,<3.0.6|>=2.4,<2.6.13|>=2.7,<2.7.9", "symfony/security-http": ">=2.4,<2.7.13|>=2.3,<2.3.41|>=2.8,<2.8.6|>=3,<3.0.6", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.13|>=2.8,<2.8.6|>=3,<3.0.6", + "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.13|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5|>=2.8,<2.8.6|>=3,<3.0.6", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", @@ -311,8 +962,8 @@ "thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=8,<8.4.1|>=7,<7.6.13", - "typo3/flow": ">=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5|>=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", + "typo3/flow": ">=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5|>=1.1,<1.1.1|>=2,<2.0.1|>=1,<1.0.4", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "willdurand/js-translation-bundle": "<2.1.1", "yiisoft/yii": ">=1.1.14,<1.1.15", @@ -357,91 +1008,230 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2017-01-24T18:32:04+00:00" + "time": "2017-10-31T23:55:04+00:00" }, { - "name": "symfony/css-selector", - "version": "v3.2.2", + "name": "webimpress/composer-extra-dependency", + "version": "0.2.2", "source": { "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "f0e628f04fc055c934b3211cfabdb1c59eefbfaa" + "url": "https://github.com/webimpress/composer-extra-dependency.git", + "reference": "31fa56391d30f03b1180c87610cbe22254780ad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f0e628f04fc055c934b3211cfabdb1c59eefbfaa", - "reference": "f0e628f04fc055c934b3211cfabdb1c59eefbfaa", + "url": "https://api.github.com/repos/webimpress/composer-extra-dependency/zipball/31fa56391d30f03b1180c87610cbe22254780ad9", + "reference": "31fa56391d30f03b1180c87610cbe22254780ad9", "shasum": "" }, "require": { - "php": ">=5.5.9" + "composer-plugin-api": "^1.1", + "php": "^5.6 || ^7.0" }, - "type": "library", + "require-dev": { + "composer/composer": "^1.5.2", + "mikey179/vfsstream": "^1.6.5", + "phpunit/phpunit": "^5.7.22 || ^6.4.1", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } + "class": "Webimpress\\ComposerExtraDependency\\Plugin" }, "autoload": { "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "Webimpress\\ComposerExtraDependency\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "Composer plugin to require extra dependencies", + "homepage": "https://github.com/webimpress/composer-extra-dependency", + "keywords": [ + "composer", + "dependency", + "webimpress" + ], + "time": "2017-10-17T17:15:14+00:00" + }, + { + "name": "webimpress/http-middleware-compatibility", + "version": "0.1.4", + "source": { + "type": "git", + "url": "https://github.com/webimpress/http-middleware-compatibility.git", + "reference": "8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webimpress/http-middleware-compatibility/zipball/8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717", + "reference": "8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717", + "shasum": "" + }, + "require": { + "http-interop/http-middleware": "^0.1.1 || ^0.2 || ^0.3 || ^0.4.1 || ^0.5", + "php": "^5.6 || ^7.0", + "webimpress/composer-extra-dependency": "^0.2.2" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3" + }, + "type": "library", + "extra": { + "dependency": [ + "http-interop/http-middleware" + ] + }, + "autoload": { + "files": [ + "autoload/http-middleware.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } + "description": "Compatibility library for Draft PSR-15 HTTP Middleware", + "homepage": "https://github.com/webimpress/http-middleware-compatibility", + "keywords": [ + "middleware", + "psr-15", + "webimpress" ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2017-01-02T20:32:22+00:00" + "time": "2017-10-17T17:31:10+00:00" }, { - "name": "zendframework/zend-diactoros", - "version": "1.3.10", + "name": "zendframework/zend-component-installer", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "83e8d98b9915de76c659ce27d683c02a0f99fa90" + "url": "https://github.com/zendframework/zend-component-installer.git", + "reference": "0ca44807dbcf356b75a869c61b533f917ccbc5ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/83e8d98b9915de76c659ce27d683c02a0f99fa90", - "reference": "83e8d98b9915de76c659ce27d683c02a0f99fa90", + "url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/0ca44807dbcf356b75a869c61b533f917ccbc5ae", + "reference": "0ca44807dbcf356b75a869c61b533f917ccbc5ae", "shasum": "" }, "require": { - "php": "^5.4 || ^7.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "~1.0.0" + "composer-plugin-api": "^1.0", + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.6 || ^5.5", + "composer/composer": "^1.3.2", + "malukenho/docheader": "^0.1.5", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^6.0.7 || ^5.7.14", "zendframework/zend-coding-standard": "~1.0.0" }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "class": "Zend\\ComponentInstaller\\ComponentInstaller" + }, + "autoload": { + "psr-4": { + "Zend\\ComponentInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Composer plugin for automating component registration in zend-mvc and Expressive applications", + "time": "2017-04-25T16:43:54+00:00" + }, + { + "name": "zendframework/zend-config-aggregator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config-aggregator.git", + "reference": "9494f491db02112c48777f1948a3b7ef71d674ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config-aggregator/zipball/9494f491db02112c48777f1948a3b7ef71d674ab", + "reference": "9494f491db02112c48777f1948a3b7ef71d674ab", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "malukenho/docheader": "^0.1.5", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^5.7", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6 || ^3.0", + "zendframework/zend-servicemanager": "^2.7.7 || ^3.1.1" + }, + "suggest": { + "zendframework/zend-config": "Allows loading configuration from XML, INI, YAML, and JSON files", + "zendframework/zend-stdlib": "Allows removing configuration keys and globbing on Windows platform" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev", - "dev-develop": "1.4-dev" + "dev-master": "1.0-dev", + "dev-develop": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ConfigAggregator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Mateusz Tymek", + "email": "mtymek@gmail.com" + } + ], + "description": "Lightweight library for merging and caching application config", + "time": "2017-04-24T21:19:47+00:00" + }, + { + "name": "zendframework/zend-diactoros", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "c8664b92a6d5bc229e48b0923486c097e45a7877" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/c8664b92a6d5bc229e48b0923486c097e45a7877", + "reference": "c8664b92a6d5bc229e48b0923486c097e45a7877", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "psr/http-message": "^1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-dom": "*", + "ext-libxml": "*", + "phpunit/phpunit": "^5.7.16 || ^6.0.8", + "zendframework/zend-coding-standard": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev", + "dev-develop": "1.7-dev" } }, "autoload": { @@ -460,7 +1250,52 @@ "psr", "psr-7" ], - "time": "2017-01-23T04:53:24+00:00" + "time": "2017-10-12T15:24:51+00:00" + }, + { + "name": "zendframework/zend-dom", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-dom.git", + "reference": "a9e145b2b52fe6de5a7a6b0ddb5c773c2c72d59e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-dom/zipball/a9e145b2b52fe6de5a7a6b0ddb5c773c2c72d59e", + "reference": "a9e145b2b52fe6de5a7a6b0ddb5c773c2c72d59e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Dom\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides tools for working with DOM documents and structures", + "homepage": "https://github.com/zendframework/zend-dom", + "keywords": [ + "dom", + "zf2" + ], + "time": "2015-10-14T03:37:48+00:00" }, { "name": "zendframework/zend-escaper", @@ -508,49 +1343,59 @@ }, { "name": "zendframework/zend-expressive", - "version": "1.0.6", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive.git", - "reference": "b315ea9269ea3ee2e5fd3adb712fc278a2904eb1" + "reference": "5abe027d3d6d70c98b85080de602ef8572ac9995" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive/zipball/b315ea9269ea3ee2e5fd3adb712fc278a2904eb1", - "reference": "b315ea9269ea3ee2e5fd3adb712fc278a2904eb1", + "url": "https://api.github.com/repos/zendframework/zend-expressive/zipball/5abe027d3d6d70c98b85080de602ef8572ac9995", + "reference": "5abe027d3d6d70c98b85080de602ef8572ac9995", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", + "fig/http-message-util": "^1.1.2", + "http-interop/http-middleware": "^0.4.1", "php": "^5.6 || ^7.0", - "psr/http-message": "^1.0", - "zendframework/zend-diactoros": "^1.1", - "zendframework/zend-expressive-router": "^1.1", - "zendframework/zend-expressive-template": "^1.0.1", - "zendframework/zend-stratigility": ">=1.1.0 < 1.3.0 || >=1.3.1 <2.0.0" + "psr/container": "^1.0", + "psr/http-message": "^1.0.1", + "zendframework/zend-diactoros": "^1.3.10", + "zendframework/zend-expressive-router": "^2.1", + "zendframework/zend-expressive-template": "^1.0.4", + "zendframework/zend-stratigility": "^2.0.1" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0" }, "require-dev": { - "filp/whoops": "^1.1 || ^2.0", + "filp/whoops": "^2.1.6 || ^1.1.10", "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^4.7", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^5.7.22 || ^6.4.1", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-expressive-aurarouter": "^1.0", - "zendframework/zend-expressive-fastroute": "^1.0", - "zendframework/zend-expressive-zendrouter": "^1.0", - "zendframework/zend-servicemanager": "^2.6" + "zendframework/zend-expressive-aurarouter": "^2.0", + "zendframework/zend-expressive-fastroute": "^2.0", + "zendframework/zend-expressive-zendrouter": "^2.0.1", + "zendframework/zend-servicemanager": "^3.3 || ^2.7.8" }, "suggest": { - "aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container", - "filp/whoops": "^2.0 to use the Whoops error handler", + "aura/di": "^3.2 to make use of Aura.Di dependency injection container", + "filp/whoops": "^2.1 to use the Whoops error handler", "xtreamwayz/pimple-container-interop": "^1.0 to use Pimple for dependency injection", - "zendframework/zend-expressive-helpers": "^1.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware", - "zendframework/zend-servicemanager": "^2.5 to use zend-servicemanager for dependency injection" + "zendframework/zend-expressive-helpers": "^3.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware", + "zendframework/zend-expressive-tooling": "For migration and development tools; require it with the --dev flag", + "zendframework/zend-servicemanager": "^3.3 to use zend-servicemanager for dependency injection" }, + "bin": [ + "bin/expressive-tooling" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "1.1-dev" + "dev-master": "2.0-dev", + "dev-develop": "2.1-dev" } }, "autoload": { @@ -563,45 +1408,52 @@ "BSD-3-Clause" ], "description": "PSR-7 Middleware Microframework based on Stratigility", + "homepage": "https://docs.zendframework.com/zend-expressive/", "keywords": [ + "PSR-11", "http", "middleware", "psr", "psr-7" ], - "time": "2017-01-09T16:08:29+00:00" + "time": "2017-10-09T21:30:44+00:00" }, { "name": "zendframework/zend-expressive-fastroute", - "version": "1.3.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-fastroute.git", - "reference": "825c93ff72c0f629bb427a6da8ebfe9d4735c296" + "reference": "20767d9df6d0154190e344e2bd6ba1a4db74a959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-fastroute/zipball/825c93ff72c0f629bb427a6da8ebfe9d4735c296", - "reference": "825c93ff72c0f629bb427a6da8ebfe9d4735c296", + "url": "https://api.github.com/repos/zendframework/zend-expressive-fastroute/zipball/20767d9df6d0154190e344e2bd6ba1a4db74a959", + "reference": "20767d9df6d0154190e344e2bd6ba1a4db74a959", "shasum": "" }, "require": { - "fig/http-message-util": "^1.1", - "nikic/fast-route": "^1.0.0", + "fig/http-message-util": "^1.1.2", + "nikic/fast-route": "^1.2", "php": "^5.6 || ^7.0", - "psr/http-message": "^1.0", - "zendframework/zend-expressive-router": "^1.3.2" + "psr/container": "^1.0", + "psr/http-message": "^1.0.1", + "zendframework/zend-expressive-router": "^2.0.1", + "zendframework/zend-stdlib": "^3.1" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0" }, "require-dev": { "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^4.7 || ^5.6", + "phpunit/phpunit": "^6.0.7 || ^5.7.14", "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev", - "dev-develop": "1.4-dev" + "dev-master": "2.1-dev", + "dev-develop": "2.2-dev" } }, "autoload": { @@ -622,45 +1474,46 @@ "psr", "psr-7" ], - "time": "2016-12-14T19:47:05+00:00" + "time": "2017-08-11T18:46:49+00:00" }, { "name": "zendframework/zend-expressive-helpers", - "version": "2.2.0", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-helpers.git", - "reference": "b60666a7a2928bda15fceadcf15116c7df03b5e3" + "reference": "137d863d4741210d05297b4bb1c30264f100ba8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-helpers/zipball/b60666a7a2928bda15fceadcf15116c7df03b5e3", - "reference": "b60666a7a2928bda15fceadcf15116c7df03b5e3", + "url": "https://api.github.com/repos/zendframework/zend-expressive-helpers/zipball/137d863d4741210d05297b4bb1c30264f100ba8f", + "reference": "137d863d4741210d05297b4bb1c30264f100ba8f", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", - "php": "^5.5 || ^7.0", - "psr/http-message": "^1.0", - "zendframework/zend-expressive-router": "^1.1" + "php": "^5.6 || ^7.0", + "psr/container": "^1.0", + "psr/http-message": "^1.0.1", + "webimpress/http-middleware-compatibility": "^0.1.1", + "zendframework/zend-expressive-router": "^2.2" }, "require-dev": { - "mockery/mockery": "^0.9.5", - "phpunit/phpunit": "^4.7", + "malukenho/docheader": "^0.1.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^5.7.22 || ^6.4.1", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-diactoros": "^1.2" + "zendframework/zend-diactoros": "^1.3.10" }, "suggest": { - "aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container", + "aura/di": "^3.2 to make use of Aura.Di dependency injection container", "mouf/pimple-interop": "^1.0 to use Pimple for dependency injection", - "zendframework/zend-servicemanager": "^2.5 to use zend-servicemanager for dependency injection" + "zendframework/zend-servicemanager": "^3.3 to use zend-servicemanager for dependency injection" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev", - "dev-develop": "2.3-dev", - "dev-dev-3.0.0": "3.0.0-dev" + "dev-master": "4.2-dev", + "dev-develop": "4.3-dev" } }, "autoload": { @@ -680,30 +1533,31 @@ "psr", "psr-7" ], - "time": "2016-12-24T05:02:55+00:00" + "time": "2017-10-09T19:03:01+00:00" }, { "name": "zendframework/zend-expressive-router", - "version": "1.3.2", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-router.git", - "reference": "50c9e4dff0cf65d9937c56b597c530e1bf5f8ef0" + "reference": "f6eac53d39cdbf7b6db11b3e6bb3565896633de4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-router/zipball/50c9e4dff0cf65d9937c56b597c530e1bf5f8ef0", - "reference": "50c9e4dff0cf65d9937c56b597c530e1bf5f8ef0", + "url": "https://api.github.com/repos/zendframework/zend-expressive-router/zipball/f6eac53d39cdbf7b6db11b3e6bb3565896633de4", + "reference": "f6eac53d39cdbf7b6db11b3e6bb3565896633de4", "shasum": "" }, "require": { - "fig/http-message-util": "^1.1", + "fig/http-message-util": "^1.1.2", "php": "^5.6 || ^7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0.1", + "webimpress/http-middleware-compatibility": "^0.1.1" }, "require-dev": { "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^4.7 || ^5.6", + "phpunit/phpunit": "^6.0.8 || ^5.7.15", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { @@ -714,8 +1568,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev", - "dev-develop": "2.0.x-dev" + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" } }, "autoload": { @@ -735,7 +1589,7 @@ "psr", "psr-7" ], - "time": "2016-12-14T13:49:15+00:00" + "time": "2017-10-09T18:44:11+00:00" }, { "name": "zendframework/zend-expressive-template", @@ -787,126 +1641,84 @@ "time": "2017-01-11T18:42:34+00:00" }, { - "name": "zendframework/zend-http", - "version": "2.5.5", + "name": "zendframework/zend-json", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-http.git", - "reference": "98b1cac0bc7a91497c5898184281abcd0e24c8d6" + "url": "https://github.com/zendframework/zend-json.git", + "reference": "f42a1588e75c2a3e338cd94c37906231e616daab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/98b1cac0bc7a91497c5898184281abcd0e24c8d6", - "reference": "98b1cac0bc7a91497c5898184281abcd0e24c8d6", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/f42a1588e75c2a3e338cd94c37906231e616daab", + "reference": "f42a1588e75c2a3e338cd94c37906231e616daab", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-loader": "^2.5", - "zendframework/zend-stdlib": "^2.5 || ^3.0", - "zendframework/zend-uri": "^2.5", - "zendframework/zend-validator": "^2.5" + "php": "^5.5 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "^4.0", - "zendframework/zend-config": "^2.5" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.3", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "zendframework/zend-json-server": "For implementing JSON-RPC servers", + "zendframework/zend-xml2json": "For converting XML documents to JSON" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" } }, "autoload": { "psr-4": { - "Zend\\Http\\": "src/" + "Zend\\Json\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", - "homepage": "https://github.com/zendframework/zend-http", + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "homepage": "https://github.com/zendframework/zend-json", "keywords": [ - "http", + "json", "zf2" ], - "time": "2016-08-08T15:01:54+00:00" - }, - { - "name": "zendframework/zend-loader", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-loader.git", - "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", - "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Loader\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-loader", - "keywords": [ - "loader", - "zf2" - ], - "time": "2015-06-03T14:05:47+00:00" + "time": "2016-04-01T02:34:00+00:00" }, { "name": "zendframework/zend-servicemanager", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-servicemanager.git", - "reference": "596a2cde85a92c3366514ae0f55ea32ef59536ac" + "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/596a2cde85a92c3366514ae0f55ea32ef59536ac", - "reference": "596a2cde85a92c3366514ae0f55ea32ef59536ac", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/c3036efb81f71bfa36cc9962ee5d4474f36581d0", + "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0", "shasum": "" }, "require": { - "container-interop/container-interop": "~1.0", + "container-interop/container-interop": "^1.2", "php": "^5.6 || ^7.0", + "psr/container": "^1.0", "zendframework/zend-stdlib": "^3.1" }, "provide": { - "container-interop/container-interop-implementation": "^1.1" + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" }, "require-dev": { "mikey179/vfsstream": "^1.6", "ocramius/proxy-manager": "^1.0 || ^2.0", "phpbench/phpbench": "^0.10.0", - "phpunit/phpunit": "^4.6 || ^5.2.10", + "phpunit/phpunit": "^5.7 || ^6.0.6", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { @@ -920,8 +1732,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" + "dev-master": "3.3-dev", + "dev-develop": "3.4-dev" } }, "autoload": { @@ -939,7 +1751,7 @@ "servicemanager", "zf" ], - "time": "2016-12-19T20:04:51+00:00" + "time": "2017-03-01T22:08:02+00:00" }, { "name": "zendframework/zend-stdlib", @@ -988,26 +1800,27 @@ }, { "name": "zendframework/zend-stratigility", - "version": "1.3.3", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stratigility.git", - "reference": "2c4120d2af215c8261a36e0bc3aa8e179e05e148" + "reference": "7dfec8dee92dad0d01e68365015f2848c250fe9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stratigility/zipball/2c4120d2af215c8261a36e0bc3aa8e179e05e148", - "reference": "2c4120d2af215c8261a36e0bc3aa8e179e05e148", + "url": "https://api.github.com/repos/zendframework/zend-stratigility/zipball/7dfec8dee92dad0d01e68365015f2848c250fe9f", + "reference": "7dfec8dee92dad0d01e68365015f2848c250fe9f", "shasum": "" }, "require": { - "http-interop/http-middleware": "^0.2.0", "php": "^5.6 || ^7.0", "psr/http-message": "^1.0", + "webimpress/http-middleware-compatibility": "^0.1.3", "zendframework/zend-escaper": "^2.3" }, "require-dev": { - "phpunit/phpunit": "^5.6", + "malukenho/docheader": "^0.1.5", + "phpunit/phpunit": "^6.0.8 || ^5.7.15", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-diactoros": "^1.0" }, @@ -1017,8 +1830,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.0-dev", - "dev-develop": "2.0.0-dev" + "dev-master": "2.1.0-dev", + "dev-develop": "2.2.0-dev" } }, "autoload": { @@ -1037,156 +1850,38 @@ "middleware", "psr-7" ], - "time": "2017-01-23T22:59:03+00:00" - }, - { - "name": "zendframework/zend-uri", - "version": "2.5.2", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-uri.git", - "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/0bf717a239432b1a1675ae314f7c4acd742749ed", - "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-escaper": "^2.5", - "zendframework/zend-validator": "^2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Uri\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "a component that aids in manipulating and validating » Uniform Resource Identifiers (URIs)", - "homepage": "https://github.com/zendframework/zend-uri", - "keywords": [ - "uri", - "zf2" - ], - "time": "2016-02-17T22:38:51+00:00" - }, - { - "name": "zendframework/zend-validator", - "version": "2.8.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-validator.git", - "reference": "8ec9f57a717dd37340308aa632f148a2c2be1cfc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/8ec9f57a717dd37340308aa632f148a2c2be1cfc", - "reference": "8ec9f57a717dd37340308aa632f148a2c2be1cfc", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "^1.1", - "php": "^5.5 || ^7.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "^4.0", - "zendframework/zend-cache": "^2.6.1", - "zendframework/zend-config": "^2.6", - "zendframework/zend-db": "^2.7", - "zendframework/zend-filter": "^2.6", - "zendframework/zend-http": "^2.5.4", - "zendframework/zend-i18n": "^2.6", - "zendframework/zend-math": "^2.6", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", - "zendframework/zend-session": "^2.6.2", - "zendframework/zend-uri": "^2.5" - }, - "suggest": { - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator", - "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages as well as to use the various Date validators", - "zendframework/zend-i18n-resources": "Translations of validator messages", - "zendframework/zend-math": "Zend\\Math component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains", - "zendframework/zend-session": "Zend\\Session component", - "zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev", - "dev-develop": "2.9-dev" - }, - "zf": { - "component": "Zend\\Validator", - "config-provider": "Zend\\Validator\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Zend\\Validator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a set of commonly needed validators", - "homepage": "https://github.com/zendframework/zend-validator", - "keywords": [ - "validator", - "zf2" - ], - "time": "2016-06-23T13:44:31+00:00" + "time": "2017-10-12T13:14:14+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1211,24 +1906,25 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "filp/whoops", - "version": "2.1.5", + "version": "2.1.12", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "2abce9d956589122c6443d6265f01cf7e9388e3c" + "reference": "a99f0b151846021ba7a73b4e3cba3ebc9f14f03e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/2abce9d956589122c6443d6265f01cf7e9388e3c", - "reference": "2abce9d956589122c6443d6265f01cf7e9388e3c", + "url": "https://api.github.com/repos/filp/whoops/zipball/a99f0b151846021ba7a73b4e3cba3ebc9f14f03e", + "reference": "a99f0b151846021ba7a73b4e3cba3ebc9f14f03e", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0" + "php": "^5.5.9 || ^7.0", + "psr/log": "^1.0.1" }, "require-dev": { "mockery/mockery": "0.9.*", @@ -1268,23 +1964,170 @@ "exception", "handling", "library", - "whoops", - "zf2" + "throwable", + "whoops" ], - "time": "2016-12-26T16:13:31+00:00" + "time": "2017-10-15T13:05:10+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0", + "name": "myclabs/deep-copy", + "version": "1.7.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -1325,26 +2168,26 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -1370,24 +2213,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-08-30T18:51:59+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -1417,37 +2260,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.2", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "^2.0", + "phpspec/phpspec": "^2.5|^3.2", "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -1480,43 +2323,45 @@ "spy", "stub" ], - "time": "2016-11-21T14:58:47+00:00" + "time": "2017-09-04T11:05:03+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "5.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", + "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "5.2.x-dev" } }, "autoload": { @@ -1542,7 +2387,7 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2017-11-03T13:47:33+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1634,25 +2479,30 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1674,33 +2524,33 @@ "keywords": [ "timer" ], - "time": "2016-05-12T18:03:57+00:00" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.9", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1723,45 +2573,57 @@ "keywords": [ "tokenizer" ], - "time": "2016-11-15T14:06:22+00:00" + "time": "2017-08-20T05:47:52+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.33", + "version": "6.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6381a99bd2a398d2994b454ad6d57c73f5a7de3d" + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6381a99bd2a398d2994b454ad6d57c73f5a7de3d", - "reference": "6381a99bd2a398d2994b454ad6d57c73f5a7de3d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2.2", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^4.0.3", + "sebastian/comparator": "^2.0.2", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -1769,7 +2631,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "6.4.x-dev" } }, "autoload": { @@ -1795,30 +2657,33 @@ "testing", "xunit" ], - "time": "2017-01-25T19:17:47+00:00" + "time": "2017-10-16T13:18:59+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.0" + }, + "conflict": { + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-soap": "*" @@ -1826,7 +2691,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -1851,34 +2716,126 @@ "mock", "xunit" ], - "time": "2015-10-02T06:51:40+00:00" + "time": "2017-08-03T14:08:16+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.2", + "name": "psr/log", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "1174d9018191e93cb9d719edec01257fc05f8158" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", + "reference": "1174d9018191e93cb9d719edec01257fc05f8158", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1909,38 +2866,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2016-11-19T09:18:40+00:00" + "time": "2017-11-03T07:16:52+00:00" }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1967,32 +2924,32 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2017,34 +2974,34 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2084,27 +3041,27 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -2112,7 +3069,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2135,32 +3092,124 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.2", + "name": "sebastian/object-enumerator", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2188,23 +3237,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11T19:50:13+00:00" + "time": "2017-03-03T06:23:57+00:00" }, { - "name": "sebastian/version", - "version": "1.0.6", + "name": "sebastian/resource-operations", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, + "require": { + "php": ">=5.6.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -2223,20 +3322,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "2.7.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9b324f3a1132459a7274a0ace2e1b766ba80930f" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9b324f3a1132459a7274a0ace2e1b766ba80930f", - "reference": "9b324f3a1132459a7274a0ace2e1b766ba80930f", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -2301,62 +3400,47 @@ "phpcs", "standards" ], - "time": "2016-11-30T04:02:31+00:00" + "time": "2017-05-22T02:43:20+00:00" }, { - "name": "symfony/yaml", - "version": "v3.2.2", + "name": "theseer/tokenizer", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "50eadbd7926e31842893c957eca362b21592a97d" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/50eadbd7926e31842893c957eca362b21592a97d", - "reference": "50eadbd7926e31842893c957eca362b21592a97d", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", "shasum": "" }, "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-01-03T13:51:32+00:00" + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", @@ -2407,17 +3491,67 @@ "validate" ], "time": "2016-11-23T20:04:58+00:00" + }, + { + "name": "zfcampus/zf-development-mode", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zfcampus/zf-development-mode.git", + "reference": "ffef6ab8cf84ee1d1a77a2b51ba2240d2707c05d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zfcampus/zf-development-mode/zipball/ffef6ab8cf84ee1d1a77a2b51ba2240d2707c05d", + "reference": "ffef6ab8cf84ee1d1a77a2b51ba2240d2707c05d", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^5.4", + "squizlabs/php_codesniffer": "^2.3.1" + }, + "bin": [ + "bin/zf-development-mode" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "ZF\\DevelopmentMode\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Zend Framework development mode script", + "homepage": "http://github.com/zfcampus/zf-development-mode", + "keywords": [ + "framework", + "zf2" + ], + "time": "2017-01-09T23:34:49+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { + "doctrine/common": 20, "roave/security-advisories": 20 }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "platform-dev": [] } diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 0000000..9604301 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1 @@ +development.config.php diff --git a/config/autoload/dependencies.global.php b/config/autoload/dependencies.global.php index 9df1a3f..4777cd7 100644 --- a/config/autoload/dependencies.global.php +++ b/config/autoload/dependencies.global.php @@ -1,13 +1,21 @@ [ + // Use 'aliases' to alias a service name to another service. The + // key is the alias name, the value is the service to which it points. + 'aliases' => [ + 'Zend\Expressive\Delegate\DefaultDelegate' => Delegate\NotFoundDelegate::class, + ], // Use 'invokables' for constructor-less services, or services that do // not require arguments to the constructor. Map a service name to the // class name. @@ -16,10 +24,16 @@ return [ Helper\ServerUrlHelper::class => Helper\ServerUrlHelper::class, ], // Use 'factories' for services provided by callbacks/factory classes. - 'factories' => [ - Application::class => ApplicationFactory::class, - Helper\UrlHelper::class => Helper\UrlHelperFactory::class, - \App\Service\SkiesService::class => \App\Service\SkiesServiceFactory::class, + 'factories' => [ + Application::class => Container\ApplicationFactory::class, + Delegate\NotFoundDelegate::class => Container\NotFoundDelegateFactory::class, + Helper\ServerUrlMiddleware::class => Helper\ServerUrlMiddlewareFactory::class, + Helper\UrlHelper::class => Helper\UrlHelperFactory::class, + Helper\UrlHelperMiddleware::class => Helper\UrlHelperMiddlewareFactory::class, + + Zend\Stratigility\Middleware\ErrorHandler::class => Container\ErrorHandlerFactory::class, + Middleware\ErrorResponseGenerator::class => Container\ErrorResponseGeneratorFactory::class, + Middleware\NotFoundHandler::class => Container\NotFoundHandlerFactory::class, ], ], ]; diff --git a/config/autoload/development.local.php.dist b/config/autoload/development.local.php.dist new file mode 100644 index 0000000..9c8aa17 --- /dev/null +++ b/config/autoload/development.local.php.dist @@ -0,0 +1,34 @@ + [ + 'invokables' => [ + ], + 'factories' => [ + ErrorResponseGenerator::class => Container\WhoopsErrorResponseGeneratorFactory::class, + 'Zend\Expressive\Whoops' => Container\WhoopsFactory::class, + 'Zend\Expressive\WhoopsPageHandler' => Container\WhoopsPageHandlerFactory::class, + ], + ], + + 'whoops' => [ + 'json_exceptions' => [ + 'display' => true, + 'show_trace' => true, + 'ajax_only' => true, + ], + ], +]; diff --git a/config/autoload/local.dist.php b/config/autoload/local.dist.php deleted file mode 100644 index 937f362..0000000 --- a/config/autoload/local.dist.php +++ /dev/null @@ -1,7 +0,0 @@ - '', - 'debug' => true, - 'config_cache_enabled' => false, -]; diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist new file mode 100644 index 0000000..1b93b46 --- /dev/null +++ b/config/autoload/local.php.dist @@ -0,0 +1,11 @@ + [ - 'factories' => [ - Helper\ServerUrlMiddleware::class => Helper\ServerUrlMiddlewareFactory::class, - Helper\UrlHelperMiddleware::class => Helper\UrlHelperMiddlewareFactory::class, - ], - ], - // This can be used to seed pre- and/or post-routing middleware - 'middleware_pipeline' => [ - // An array of middleware to register. Each item is of the following - // specification: - // - // [ - // Required: - // 'middleware' => 'Name or array of names of middleware services and/or callables', - // Optional: - // 'path' => '/path/to/match', // string; literal path prefix to match - // // middleware will not execute - // // if path does not match! - // 'error' => true, // boolean; true for error middleware - // 'priority' => 1, // int; higher values == register early; - // // lower/negative == register last; - // // default is 1, if none is provided. - // ], - // - // While the ApplicationFactory ignores the keys associated with - // specifications, they can be used to allow merging related values - // defined in multiple configuration files/locations. This file defines - // some conventional keys for middleware to execute early, routing - // middleware, and error middleware. - 'always' => [ - 'middleware' => [ - // Add more middleware here that you want to execute on - // every request: - // - bootstrapping - // - pre-conditions - // - modifications to outgoing responses - Helper\ServerUrlMiddleware::class, - ], - 'priority' => 10000, - ], - - 'routing' => [ - 'middleware' => [ - ApplicationFactory::ROUTING_MIDDLEWARE, - Helper\UrlHelperMiddleware::class, - // Add more middleware here that needs to introspect the routing - // results; this might include: - // - route-based authentication - // - route-based validation - // - etc. - ApplicationFactory::DISPATCH_MIDDLEWARE, - ], - 'priority' => 1, - ], - - 'error' => [ - 'middleware' => [ - // Add error middleware here. - ], - 'error' => true, - 'priority' => -10000, - ], - ], -]; diff --git a/config/autoload/router.global.php b/config/autoload/router.global.php new file mode 100644 index 0000000..0505bee --- /dev/null +++ b/config/autoload/router.global.php @@ -0,0 +1,12 @@ + [ + 'invokables' => [ + RouterInterface::class => FastRouteRouter::class, + ], + ], +]; diff --git a/config/autoload/routes.global.php b/config/autoload/routes.global.php deleted file mode 100644 index b6bd336..0000000 --- a/config/autoload/routes.global.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'invokables' => [ - Zend\Expressive\Router\RouterInterface::class => Zend\Expressive\Router\FastRouteRouter::class, - App\Action\PingAction::class => App\Action\PingAction::class, - ], - 'factories' => [ - App\Action\HomePageAction::class => App\Action\HomePageFactory::class, - App\Action\ActivityAction::class => App\Action\ActivityFactory::class, - ], - ], - - 'routes' => [ - [ - 'name' => 'home', - 'path' => '/', - 'middleware' => App\Action\HomePageAction::class, - 'allowed_methods' => ['GET'], - ], - [ - 'name' => 'api.ping', - 'path' => '/api/ping', - 'middleware' => App\Action\PingAction::class, - 'allowed_methods' => ['GET'], - ], - [ - 'name' => 'api.activity', - 'path' => '/api/activity', - 'middleware' => App\Action\ActivityAction::class, - 'allowed_methods' => ['GET', 'POST', 'DELETE', 'OPTIONS'], - ], - [ - 'name' => 'api.activity.id', - 'path' => '/api/activity/{id:\d+}', - 'middleware' => App\Action\ActivityAction::class, - 'allowed_methods' => ['GET', 'PUT', 'DELETE', 'OPTIONS'], - ], - ], -]; diff --git a/config/autoload/zend-expressive.global.php b/config/autoload/zend-expressive.global.php index 44e980c..dd4acd1 100644 --- a/config/autoload/zend-expressive.global.php +++ b/config/autoload/zend-expressive.global.php @@ -1,11 +1,24 @@ true, + + // Enable debugging; typically used to provide debugging information within templates. 'debug' => false, - 'config_cache_enabled' => false, - 'zend-expressive' => [ + // Enable programmatic pipeline: Any `middleware_pipeline` or `routes` + // configuration will be ignored when creating the `Application` instance. + 'programmatic_pipeline' => true, + + // Provide templates for the error handling middleware to use when + // generating responses. 'error_handler' => [ 'template_404' => 'error::404', 'template_error' => 'error::error', diff --git a/config/config.php b/config/config.php index a5446be..4170efa 100644 --- a/config/config.php +++ b/config/config.php @@ -1,35 +1,32 @@ 'data/config-cache.php', +]; -$cachedConfigFile = 'data/cache/app_config.php'; +$aggregator = new ConfigAggregator([ + // Include cache configuration + new ArrayProvider($cacheConfig), -$config = []; -if (is_file($cachedConfigFile)) { - // Try to load the cached config - $config = include $cachedConfigFile; -} else { - // Load configuration from autoload path - foreach (Glob::glob('config/autoload/{{,*.}global,{,*.}local}.php', Glob::GLOB_BRACE) as $file) { - $config = ArrayUtils::merge($config, include $file); - } + // Default App module config + App\ConfigProvider::class, - // Cache config if enabled - if (isset($config['config_cache_enabled']) && $config['config_cache_enabled'] === true) { - file_put_contents($cachedConfigFile, 'getMergedConfig(); diff --git a/config/development.config.php.dist b/config/development.config.php.dist new file mode 100644 index 0000000..f9e594a --- /dev/null +++ b/config/development.config.php.dist @@ -0,0 +1,29 @@ + true, + ConfigAggregator::ENABLE_CACHE => false, +]; diff --git a/config/pipeline.php b/config/pipeline.php new file mode 100644 index 0000000..c551918 --- /dev/null +++ b/config/pipeline.php @@ -0,0 +1,55 @@ +pipe(ErrorHandler::class); +$app->pipe(ServerUrlMiddleware::class); + +// Pipe more middleware here that you want to execute on every request: +// - bootstrapping +// - pre-conditions +// - modifications to outgoing responses +// +// Piped Middleware may be either callables or service names. Middleware may +// also be passed as an array; each item in the array must resolve to +// middleware eventually (i.e., callable or service name). +// +// Middleware can be attached to specific paths, allowing you to mix and match +// applications under a common domain. The handlers in each middleware +// attached this way will see a URI with the MATCHED PATH SEGMENT REMOVED!!! +// +// - $app->pipe('/api', $apiMiddleware); +// - $app->pipe('/docs', $apiDocMiddleware); +// - $app->pipe('/files', $filesMiddleware); + +// Register the routing middleware in the middleware pipeline +$app->pipeRoutingMiddleware(); +$app->pipe(ImplicitHeadMiddleware::class); +$app->pipe(ImplicitOptionsMiddleware::class); +$app->pipe(UrlHelperMiddleware::class); + +// Add more middleware here that needs to introspect the routing results; this +// might include: +// +// - route-based authentication +// - route-based validation +// - etc. + +// Register the dispatch middleware in the middleware pipeline +$app->pipeDispatchMiddleware(); + +// At this point, if no Response is return by any middleware, the +// NotFoundHandler kicks in; alternately, you can provide other fallback +// middleware to execute. +$app->pipe(NotFoundHandler::class); diff --git a/config/routes.php b/config/routes.php new file mode 100644 index 0000000..30c555d --- /dev/null +++ b/config/routes.php @@ -0,0 +1,34 @@ +get('/', App\Action\HomePageAction::class, 'home'); + * $app->post('/album', App\Action\AlbumCreateAction::class, 'album.create'); + * $app->put('/album/:id', App\Action\AlbumUpdateAction::class, 'album.put'); + * $app->patch('/album/:id', App\Action\AlbumUpdateAction::class, 'album.patch'); + * $app->delete('/album/:id', App\Action\AlbumDeleteAction::class, 'album.delete'); + * + * Or with multiple request methods: + * + * $app->route('/contact', App\Action\ContactAction::class, ['GET', 'POST', ...], 'contact'); + * + * Or handling all request methods: + * + * $app->route('/contact', App\Action\ContactAction::class)->setName('contact'); + * + * or: + * + * $app->route( + * '/contact', + * App\Action\ContactAction::class, + * Zend\Expressive\Router\Route::HTTP_METHOD_ANY, + * 'contact' + * ); + */ + +$app->get('/', App\Action\HomePageAction::class, 'home'); +$app->get('/api/ping', App\Action\PingAction::class, 'api.ping'); + +$app->get('/api/activity[/{id:\d+}]', App\Action\ActivityAction::class, 'api.activity.get'); +$app->get('/api/activity/signup/{id:\d+}', App\Action\ActivitySignupAction::class, 'api.activity.signup'); +$app->get('/api/activity/signoff/{id:\d+}', App\Action\ActivitySignoffAction::class, 'api.activity.signoff'); diff --git a/phpcs.xml b/phpcs.xml.dist similarity index 78% rename from phpcs.xml rename to phpcs.xml.dist index f032dbb..de3035d 100644 --- a/phpcs.xml +++ b/phpcs.xml.dist @@ -1,6 +1,6 @@ - - Zend Framework coding standard + + Expressive Skeleton coding standard diff --git a/public/index.php b/public/index.php index f84c136..0fad61d 100644 --- a/public/index.php +++ b/public/index.php @@ -10,9 +10,20 @@ if (php_sapi_name() === 'cli-server' chdir(dirname(__DIR__)); require 'vendor/autoload.php'; -/** @var \Interop\Container\ContainerInterface $container */ -$container = require 'config/container.php'; +/** + * Self-called anonymous function that creates its own scope and keep the global namespace clean. + */ +call_user_func(function () { + /** @var \Interop\Container\ContainerInterface $container */ + $container = require 'config/container.php'; -/** @var \Zend\Expressive\Application $app */ -$app = $container->get(\Zend\Expressive\Application::class); -$app->run(); + /** @var \Zend\Expressive\Application $app */ + $app = $container->get(\Zend\Expressive\Application::class); + + // Import programmatic/declarative middleware pipeline and routing + // configuration statements + require 'config/pipeline.php'; + require 'config/routes.php'; + + $app->run(); +}); diff --git a/src/App/Action/AbstractAction.php b/src/App/Action/AbstractAction.php index 62f0120..31746d9 100644 --- a/src/App/Action/AbstractAction.php +++ b/src/App/Action/AbstractAction.php @@ -2,16 +2,17 @@ namespace App\Action; -use Psr\Http\Message\ResponseInterface; +use Interop\Http\ServerMiddleware\DelegateInterface; +use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface; use Psr\Http\Message\ServerRequestInterface; use Zend\Diactoros\Response\JsonResponse; -use Zend\Stratigility\MiddlewareInterface; +use Zend\Json\Json; -abstract class AbstractAction implements MiddlewareInterface +abstract class AbstractAction implements ServerMiddlewareInterface { const IDENTIFIER_NAME = 'id'; - public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function process(ServerRequestInterface $request, DelegateInterface $delegate) { $requestMethod = strtoupper($request->getMethod()); $id = $request->getAttribute(static::IDENTIFIER_NAME); @@ -19,68 +20,68 @@ abstract class AbstractAction implements MiddlewareInterface switch ($requestMethod) { case 'GET': return isset($id) - ? $this->get($request, $response, $next) - : $this->getList($request, $response, $next); + ? $this->get($request, $delegate) + : $this->getList($request, $delegate); case 'POST': - return $this->create($request, $response, $next); + return $this->create($request, $delegate); case 'PUT': - return $this->update($request, $response, $next); + return $this->update($request, $delegate); case 'DELETE': return isset($id) - ? $this->delete($request, $response, $next) - : $this->deleteList($request, $response, $next); + ? $this->delete($request, $delegate) + : $this->deleteList($request, $delegate); case 'HEAD': - return $this->head($request, $response, $next); + return $this->head($request, $delegate); case 'OPTIONS': - return $this->options($request, $response, $next); + return $this->options($request, $delegate); case 'PATCH': - return $this->patch($request, $response, $next); + return $this->patch($request, $delegate); default: - return $next($request, $response); + return $delegate->process($request); } } - public function get(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function get(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function getList(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function getList(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function create(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function create(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function update(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function update(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function delete(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function delete(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function deleteList(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function deleteList(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function head(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function head(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function options(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function options(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } - public function patch(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function patch(ServerRequestInterface $request, DelegateInterface $delegate) { return $this->createResponse(['content' => 'Method not allowed'], 405); } @@ -89,4 +90,69 @@ abstract class AbstractAction implements MiddlewareInterface { return new JsonResponse($data, $status); } + + /** + * + * @param ServerRequestInterface $request + * @return array|object + */ + public function getRequestData(ServerRequestInterface $request) + { + $body = $request->getParsedBody(); + + if (!empty($body)) { + return $body; + } + + return $this->parseRequestData( + $request->getBody()->getContents(), + $request->getHeaderLine('content-type') + ); + } + + /** + * + * @param string $input + * @param string $contentType + * @return mixed + */ + private function parseRequestData($input, $contentType) + { + $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); + $parser = $this->returnParserContentType($contentTypeParts[0]); + + return $parser($input); + } + + /** + * + * @param string $contentType + * @return callable + */ + private function returnParserContentType(string $contentType) + { + if ($contentType === 'application/x-www-form-urlencoded') { + return function ($input) { + parse_str($input, $data); + return $data; + }; + } elseif ($contentType === 'application/json') { + return function ($input) { + $jsonDecoder = new Json(); + try { + return $jsonDecoder->decode($input, Json::TYPE_ARRAY); + } catch (\Exception $e) { + return false; + } + }; + } elseif ($contentType === 'multipart/form-data') { + return function ($input) { + return $input; + }; + } + + return function ($input) { + return $input; + }; + } } diff --git a/src/App/Action/ActivityAction.php b/src/App/Action/ActivityAction.php index e185f3f..1e13797 100644 --- a/src/App/Action/ActivityAction.php +++ b/src/App/Action/ActivityAction.php @@ -2,33 +2,34 @@ namespace App\Action; -use App\Service\SkiesService; -use Psr\Http\Message\ResponseInterface; +use App\Service\SkiesClientService; +use Interop\Http\ServerMiddleware\DelegateInterface; use Psr\Http\Message\ServerRequestInterface; use Zend\Diactoros\Response\JsonResponse; +use Zend\Diactoros\Response\TextResponse; class ActivityAction extends AbstractAction { - private $skiesService; + /** + * @var SkiesClientService + */ + private $skiesClient; - public function __construct(SkiesService $skiesService) + public function __construct(SkiesClientService $skiesClient) { - $this->skiesService = $skiesService; + $this->skiesClient = $skiesClient; } - public function getList(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function getList(ServerRequestInterface $request, DelegateInterface $delegate) { - return new JsonResponse($this->skiesService->getActivityList()); + $authHeader = $request->getHeaderLine("x-passthru-auth"); + return new JsonResponse($this->skiesClient->setAuthHeader($authHeader)->getActivities()); } - public function get(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function get(ServerRequestInterface $request, DelegateInterface $delegate) { $id = $request->getAttribute(self::IDENTIFIER_NAME); - return new JsonResponse($this->skiesService->getActivity($id)); - } - - public function options(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) - { - return new JsonResponse(true); + $authHeader = $request->getHeaderLine("x-passthru-auth"); + return new JsonResponse($this->skiesClient->setAuthHeader($authHeader)->getActivity($id)); } } diff --git a/src/App/Action/ActivityFactory.php b/src/App/Action/ActivityFactory.php index b3cdd78..b0808a2 100644 --- a/src/App/Action/ActivityFactory.php +++ b/src/App/Action/ActivityFactory.php @@ -2,14 +2,14 @@ namespace App\Action; -use App\Service\SkiesService; +use App\Service\SkiesClientService; use Interop\Container\ContainerInterface; class ActivityFactory { public function __invoke(ContainerInterface $container) { - $skiesService = $container->get(SkiesService::class); - return new ActivityAction($skiesService); + $skiesClient = $container->get(SkiesClientService::class); + return new ActivityAction($skiesClient); } } diff --git a/src/App/Action/ActivitySignoffAction.php b/src/App/Action/ActivitySignoffAction.php new file mode 100644 index 0000000..db9d67a --- /dev/null +++ b/src/App/Action/ActivitySignoffAction.php @@ -0,0 +1,29 @@ +skiesClient = $skiesClient; + } + + public function process(ServerRequestInterface $request, DelegateInterface $delegate) + { + $authHeader = $request->getHeaderLine("x-passthru-auth"); + $id = $request->getAttribute("id"); + return new JsonResponse($this->skiesClient->setAuthHeader($authHeader)->signOffActivity($id)); + } +} diff --git a/src/App/Action/ActivitySignoffFactory.php b/src/App/Action/ActivitySignoffFactory.php new file mode 100644 index 0000000..6058d4b --- /dev/null +++ b/src/App/Action/ActivitySignoffFactory.php @@ -0,0 +1,15 @@ +get(SkiesClientService::class); + return new ActivitySignoffAction($skiesClient); + } +} diff --git a/src/App/Action/ActivitySignupAction.php b/src/App/Action/ActivitySignupAction.php new file mode 100644 index 0000000..d2ec3ef --- /dev/null +++ b/src/App/Action/ActivitySignupAction.php @@ -0,0 +1,29 @@ +skiesClient = $skiesClient; + } + + public function process(ServerRequestInterface $request, DelegateInterface $delegate) + { + $authHeader = $request->getHeaderLine("x-passthru-auth"); + $id = $request->getAttribute("id"); + return new JsonResponse($this->skiesClient->setAuthHeader($authHeader)->signUpActivity($id)); + } +} diff --git a/src/App/Action/ActivitySignupFactory.php b/src/App/Action/ActivitySignupFactory.php new file mode 100644 index 0000000..14fdfe1 --- /dev/null +++ b/src/App/Action/ActivitySignupFactory.php @@ -0,0 +1,15 @@ +get(SkiesClientService::class); + return new ActivitySignupAction($skiesClient); + } +} diff --git a/src/App/Action/HomePageAction.php b/src/App/Action/HomePageAction.php index 8486f5a..c9ed942 100644 --- a/src/App/Action/HomePageAction.php +++ b/src/App/Action/HomePageAction.php @@ -2,7 +2,8 @@ namespace App\Action; -use Psr\Http\Message\ResponseInterface; +use Interop\Http\ServerMiddleware\DelegateInterface; +use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface; use Psr\Http\Message\ServerRequestInterface; use Zend\Diactoros\Response\HtmlResponse; use Zend\Diactoros\Response\JsonResponse; @@ -12,7 +13,7 @@ use Zend\Expressive\Plates\PlatesRenderer; use Zend\Expressive\Twig\TwigRenderer; use Zend\Expressive\ZendView\ZendViewRenderer; -class HomePageAction +class HomePageAction implements ServerMiddlewareInterface { private $router; @@ -24,8 +25,15 @@ class HomePageAction $this->template = $template; } - public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function process(ServerRequestInterface $request, DelegateInterface $delegate) { + if (! $this->template) { + return new JsonResponse([ + 'welcome' => 'Congratulations! You have installed the zend-expressive skeleton application.', + 'docsUrl' => 'https://docs.zendframework.com/zend-expressive/', + ]); + } + $data = []; if ($this->router instanceof Router\AuraRouter) { @@ -36,7 +44,7 @@ class HomePageAction $data['routerDocs'] = 'https://github.com/nikic/FastRoute'; } elseif ($this->router instanceof Router\ZendRouter) { $data['routerName'] = 'Zend Router'; - $data['routerDocs'] = 'http://framework.zend.com/manual/current/en/modules/zend.mvc.routing.html'; + $data['routerDocs'] = 'https://docs.zendframework.com/zend-router/'; } if ($this->template instanceof PlatesRenderer) { @@ -47,14 +55,7 @@ class HomePageAction $data['templateDocs'] = 'http://twig.sensiolabs.org/documentation'; } elseif ($this->template instanceof ZendViewRenderer) { $data['templateName'] = 'Zend View'; - $data['templateDocs'] = 'http://framework.zend.com/manual/current/en/modules/zend.view.quick-start.html'; - } - - if (!$this->template) { - return new JsonResponse([ - 'welcome' => 'Congratulations! You have installed the zend-expressive skeleton application.', - 'docsUrl' => 'zend-expressive.readthedocs.org', - ]); + $data['templateDocs'] = 'https://docs.zendframework.com/zend-view/'; } return new HtmlResponse($this->template->render('app::home-page', $data)); diff --git a/src/App/Action/HomePageFactory.php b/src/App/Action/HomePageFactory.php index 8366ff8..cf3fe9f 100644 --- a/src/App/Action/HomePageFactory.php +++ b/src/App/Action/HomePageFactory.php @@ -11,7 +11,7 @@ class HomePageFactory public function __invoke(ContainerInterface $container) { $router = $container->get(RouterInterface::class); - $template = ($container->has(TemplateRendererInterface::class)) + $template = $container->has(TemplateRendererInterface::class) ? $container->get(TemplateRendererInterface::class) : null; diff --git a/src/App/Action/NewsAction.php b/src/App/Action/NewsAction.php new file mode 100644 index 0000000..5764831 --- /dev/null +++ b/src/App/Action/NewsAction.php @@ -0,0 +1,18 @@ +skiesClient = $skiesClient; + } +} diff --git a/src/App/Action/NewsFactory.php b/src/App/Action/NewsFactory.php new file mode 100644 index 0000000..49f5f80 --- /dev/null +++ b/src/App/Action/NewsFactory.php @@ -0,0 +1,15 @@ +get(SkiesClientService::class); + return new NewsAction($skiesClient); + } +} diff --git a/src/App/Action/PingAction.php b/src/App/Action/PingAction.php index 58f68d2..c24043d 100644 --- a/src/App/Action/PingAction.php +++ b/src/App/Action/PingAction.php @@ -2,16 +2,15 @@ namespace App\Action; +use Interop\Http\ServerMiddleware\DelegateInterface; +use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface; use Zend\Diactoros\Response\JsonResponse; -use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -class PingAction +class PingAction implements ServerMiddlewareInterface { - public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + public function process(ServerRequestInterface $request, DelegateInterface $delegate) { - return new JsonResponse([ - 'ack' => time(), - ]); + return new JsonResponse(['ack' => time()]); } } diff --git a/src/App/ConfigProvider.php b/src/App/ConfigProvider.php new file mode 100644 index 0000000..1e7dc97 --- /dev/null +++ b/src/App/ConfigProvider.php @@ -0,0 +1,66 @@ + $this->getDependencies(), + 'templates' => $this->getTemplates(), + ]; + } + + /** + * Returns the container dependencies + * + * @return array + */ + public function getDependencies() + { + return [ + 'invokables' => [ + Action\PingAction::class => Action\PingAction::class, + ], + 'factories' => [ + Action\HomePageAction::class => Action\HomePageFactory::class, + Action\ActivityAction::class => Action\ActivityFactory::class, + Action\ActivitySignupAction::class => Action\ActivitySignupFactory::class, + Action\ActivitySignoffAction::class => Action\ActivitySignoffFactory::class, + Action\NewsAction::class => Action\NewsFactory::class, + + Service\SkiesClientService::class => Service\SkiesClientServiceFactory::class, + ], + ]; + } + + /** + * Returns the templates configuration + * + * @return array + */ + public function getTemplates() + { + return [ + 'paths' => [ + 'app' => ['templates/app'], + 'error' => ['templates/error'], + 'layout' => ['templates/layout'], + ], + ]; + } +} diff --git a/src/App/Entity/Activity.php b/src/App/Entity/Activity.php new file mode 100644 index 0000000..7c352a7 --- /dev/null +++ b/src/App/Entity/Activity.php @@ -0,0 +1,305 @@ +comments = new ArrayCollection(); + } + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @param int $id + * @return Activity + */ + public function setId(int $id) + { + $this->id = $id; + return $this; + } + + /** + * @return string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param string $name + * @return Activity + */ + public function setName(?string $name): Activity + { + $this->name = $name; + return $this; + } + + /** + * @return \DateTime + */ + public function getDate(): ?\DateTime + { + return $this->date; + } + + /** + * @param \DateTime $date + * @return Activity + */ + public function setDate(?\DateTime $date): Activity + { + $this->date = $date; + return $this; + } + + /** + * @return string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $description + * @return Activity + */ + public function setDescription(?string $description): Activity + { + $this->description = $description; + return $this; + } + + /** + * @return \DateTime + */ + public function getFinalEntry(): ?\DateTime + { + return $this->finalEntry; + } + + /** + * @param \DateTime $finalEntry + * @return Activity + */ + public function setFinalEntry(\DateTime $finalEntry): Activity + { + $this->finalEntry = $finalEntry; + return $this; + } + + /** + * @return string + */ + public function getAccountable(): ?string + { + return $this->accountable; + } + + /** + * @param string $accountable + * @return Activity + */ + public function setAccountable(string $accountable): Activity + { + $this->accountable = $accountable; + return $this; + } + + /** + * @return Comment[]|ArrayCollection + */ + public function getComments() + { + return $this->comments; + } + + /** + * @param Comment[]|ArrayCollection $comments + * @return Activity + */ + public function setComments($comments): Activity + { + $this->comments = $comments; + return $this; + } + + /** + * @param Comment $comment + * @return Activity + */ + public function addComment(Comment $comment): Activity + { + if(!$this->comments->contains($comment)) { + $this->comments->add($comment); + } + return $this; + } + + /** + * @param Comment $comment + * @return Activity + */ + public function removeComment(Comment $comment): Activity + { + if($this->comments->contains($comment)) { + $this->comments->removeElement($comment); + } + return $this; + } + + /** + * @return string[] + */ + public function getSignedUsers(): ?array + { + return $this->signedUsers; + } + + /** + * @param string[] $signedUsers + * @return Activity + */ + public function setSignedUsers(array $signedUsers): Activity + { + $this->signedUsers = $signedUsers; + return $this; + } + + /** + * @param string $signed + * @return Activity + */ + public function addSignedUser(string $signed): Activity + { + $this->signedUsers[] = $signed; + return $this; + } + + /** + * @return bool + */ + public function isSignedup(): bool + { + return $this->isSignedup; + } + + /** + * @param bool $isSignedup + * @return Activity + */ + public function setIsSignedup(bool $isSignedup): Activity + { + $this->isSignedup = $isSignedup; + return $this; + } + + /** + * @return bool + */ + public function isCanChangeSignup(): bool + { + return $this->canChangeSignup; + } + + /** + * @param bool $canChangeSignup + * @return Activity + */ + public function setCanChangeSignup(bool $canChangeSignup): Activity + { + $this->canChangeSignup = $canChangeSignup; + return $this; + } + + /** + * Specify data which should be serialized to JSON + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + * @since 5.4.0 + */ + public function jsonSerialize() + { + return [ + 'id' => $this->getId(), + 'name' => $this->getName(), + 'date' => $this->getDate() + ? $this->getDate()->format("Y-m-d H:i:s") + : null, + 'description' => $this->getDescription(), + 'finalEntry' => $this->getFinalEntry() + ? $this->getFinalEntry()->format("Y-m-d H:i:s") + : null, + 'accountable' => $this->getAccountable(), + 'comments' => $this->getComments()->getValues(), + 'signedUsers' => $this->getSignedUsers(), + 'canChangeSignup' => $this->isCanChangeSignup(), + 'isSignedUp' => $this->isSignedup() + ]; + } +} diff --git a/src/App/Entity/Comment.php b/src/App/Entity/Comment.php new file mode 100644 index 0000000..6384afb --- /dev/null +++ b/src/App/Entity/Comment.php @@ -0,0 +1,93 @@ +text; + } + + /** + * @param string $text + * @return Comment + */ + public function setText(string $text): Comment + { + $this->text = $text; + return $this; + } + + /** + * @return \DateTime + */ + public function getCreatedAt(): \DateTime + { + return $this->createdAt; + } + + /** + * @param \DateTime $createdAt + * @return Comment + */ + public function setCreatedAt(\DateTime $createdAt): Comment + { + $this->createdAt = $createdAt; + return $this; + } + + /** + * @return User + */ + public function getUser(): User + { + return $this->user; + } + + /** + * @param User $user + * @return Comment + */ + public function setUser(User $user): Comment + { + $this->user = $user; + return $this; + } + + /** + * Specify data which should be serialized to JSON + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + * @since 5.4.0 + */ + public function jsonSerialize() + { + return [ + 'text' => $this->getText(), + 'user' => $this->getUser(), + 'createdAt' => $this->getCreatedAt() + ? $this->getCreatedAt()->format("Y-m-d H:i:s") + : null, + ]; + } +} diff --git a/src/App/Entity/News.php b/src/App/Entity/News.php new file mode 100644 index 0000000..e523bc4 --- /dev/null +++ b/src/App/Entity/News.php @@ -0,0 +1,8 @@ +username; + } + + /** + * @param string $username + * @return User + */ + public function setUsername(string $username): User + { + $this->username = $username; + return $this; + } + + /** + * @return string + */ + public function getDisplayName(): string + { + return $this->displayName; + } + + /** + * @param string $displayName + * @return User + */ + public function setDisplayName(string $displayName): User + { + $this->displayName = $displayName; + return $this; + } + + /** + * Specify data which should be serialized to JSON + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + * @since 5.4.0 + */ + public function jsonSerialize() + { + return [ + 'username' => $this->getUsername(), + 'displayName' => $this->getDisplayName(), + ]; + } +} \ No newline at end of file diff --git a/src/App/Service/SkiesClientService.php b/src/App/Service/SkiesClientService.php new file mode 100644 index 0000000..40faf22 --- /dev/null +++ b/src/App/Service/SkiesClientService.php @@ -0,0 +1,397 @@ +client = $client; + } + + /** + * @param string $authHeader + * @return SkiesClientService + */ + public function setAuthHeader(string $authHeader): SkiesClientService + { + $this->authHeader = $authHeader; + return $this; + } + + public function getNews() + { + $response = $this->doSkiesRequest('GET', self::SKIES_MAIN_URL); + $htmlBody = $response->getBody(); + return $this->parseMainPage($htmlBody); + } + + /** + * @return Activity[] + */ + public function getActivities() + { + $response = $this->doSkiesRequest('GET', self::SKIES_ACTIVITIES_URL); + $htmlBody = $response->getBody(); + return $this->parseActivitiesPage($htmlBody); + } + + /** + * @param string $htmlBody + * @return Activity[] + */ + private function parseActivitiesPage(string $htmlBody) + { + $domDocument = new Document($htmlBody); + $eventNodes = Document\Query::execute( + "div.container div.row div.box > table tr", + $domDocument, + Document\Query::TYPE_CSS + ); + + $activities = []; + + for ($i = 1; $i < $eventNodes->count(); $i++) { + $eventRow = $eventNodes[$i]; + $rowCells = Document\Query::execute( + "./td", + $domDocument, + Document\Query::TYPE_XPATH, + $eventRow + ); + + $href = $rowCells[0]->childNodes->item(0)->getAttribute("href"); + $queryString = parse_url($href, PHP_URL_QUERY); + parse_str($queryString, $queryParams); + $activities[] = $this->getActivity($queryParams["aktID"]); + } + + return $activities; + } + + /** + * @param int $id + * @return Activity + */ + public function getActivity(int $id): Activity + { + $response = $this->doSkiesRequest('GET', sprintf(self::SKIES_ACTIVITY_URL, $id)); + $htmlBody = $response->getBody(); + return $this->parseActivityPage($htmlBody, $id); + } + + /** + * @param int $id + * @return Activity + */ + public function signUpActivity(int $id): Activity + { + $this->doSkiesRequest('POST', sprintf(self::SKIES_ACTIVITY_SIGNUP_URL, $id), [ + 'form_params' => [ + 'user' => $this->getUsername(), + ], + ]); + return $this->getActivity($id); + } + + /** + * @param int $id + * @return Activity + */ + public function signOffActivity(int $id): Activity + { + $username = $this->getUsername(); + $this->doSkiesRequest('GET', sprintf(self::SKIES_ACTIVITY_SIGNOFF_URL, $id, $username)); + return $this->getActivity($id); + } + + /** + * @param string $htmlBody + * @param int $id + * @return Activity + */ + private function parseActivityPage(string $htmlBody, int $id): Activity + { + $domDocument = new Document($htmlBody); + /** Activity body */ + $activityNode = Document\Query::execute( + "div.col-md-10 div.box", + $domDocument, + Document\Query::TYPE_CSS + ); + + /** Activity name */ + $h5Nodes = Document\Query::execute( + "./h5", + $domDocument, + Document\Query::TYPE_XPATH, + $activityNode[0] + ); + + $divNodes = Document\Query::execute( + ".//div", + $domDocument, + Document\Query::TYPE_XPATH, + $activityNode[0] + ); + + /** Comment block */ + $commentNodes = Document\Query::execute( + './/div[@class="onecomment"]', + $domDocument, + Document\Query::TYPE_XPATH, + $activityNode[0] + ); + + /** Signed users block */ + $signedUserParagraph = Document\Query::execute( + '//div[@class="portlet"]//div[@class="paragraph"]/text()', + $domDocument, + Document\Query::TYPE_XPATH + ); + + preg_match("#Date:.*?([0-9]{4}-[0-9]{2}-[0-9]{2}).*?Time: ([0-9]{1,2}:[0-9]{2}).*?Final entry day:.*?([0-9]{4}-[0-9]{2}-[0-9]{2}).*?Accountable: (.*?) / ([0-9 +]*)#msi", $divNodes[1]->textContent, $matches); + + $signedUsers = $this->parseActivitySignedUsers($signedUserParagraph); + $isSignedUp = in_array($this->getDisplayName($this->getUsername()), $signedUsers); + $canChangeSignup = $isSignedUp + ? $this->canSignOff($domDocument, $activityNode[0]) + : $this->canSignup($domDocument, $activityNode[0]); + + $activity = new Activity(); + $activity->setId($id) + ->setName($this->clearTextNode($h5Nodes[0]->textContent)) + ->setDescription($this->parseActivityDescription($activityNode[0])) + ->setDate(new \DateTime(sprintf("%s %s", $matches[1], $matches[2]))) + ->setFinalEntry(new \DateTime($matches[3])) + ->setAccountable(str_replace( + " ", + " ", + $matches[5] + ? sprintf("%s (%s)", $matches[4], $matches[5]) + : $matches[4]) + ) + ->setSignedUsers($signedUsers) + ->setIsSignedup($isSignedUp) + ->setCanChangeSignup($canChangeSignup); + $this->parseActivityComments($commentNodes, $activity); + + return $activity; + } + + /** + * @param \DOMNode $element + * @return null|string + */ + private function parseActivityDescription(\DOMNode $element): ?string + { + $description = ""; + $isContent = false; + /** @var \DOMElement $childNode */ + foreach ($element->childNodes as $childNode) { + if ($childNode->nodeName == "hr") { + $isContent = true; + } + if ($childNode->nodeName == "form") { + break; + } + if ($childNode->nodeName == "span") { + break; + } + if ($childNode->nodeName == "script") { + break; + } + if ($isContent) { + $description .= $childNode->nodeName == "br" + ? "\n" + : rtrim($childNode->textContent); + } + } + return $this->clearTextNode($description); + } + + /** + * @param Document\NodeList $commentElements + * @param Activity $activity + */ + private function parseActivityComments(Document\NodeList $commentElements, Activity $activity) + { + /** @var \DOMElement $commentElement */ + foreach ($commentElements as $commentElement) { + $divElements = $commentElement->getElementsByTagName("div"); + + $queryString = parse_url( + $commentElement->getElementsByTagName("a")->item(0)->getAttribute("href"), + PHP_URL_QUERY + ); + parse_str($queryString, $queryParams); + preg_match( + "#(.*)\s/\s([0-9]{4}-[0-9]{2}-[0-9]{2})\s([0-9]{1,2}:[0-9]{1,2})#msi", + str_replace(" ", " ", $divElements->item(2)->textContent), + $matches + ); + + $user = new User(); + $user->setDisplayName($matches[1]) + ->setUsername($queryParams['username']); + + $comment = new Comment(); + $comment + ->setText($divElements->item(1)->textContent) + ->setUser($user) + ->setCreatedAt(new \DateTime(sprintf( + "%s %s", + $matches[2], + $matches[3] + ))); + $activity->addComment($comment); + } + } + + /** + * @param Document\NodeList $usersBlockText + * @return array + * @todo remove unsign button if it is present + */ + private function parseActivitySignedUsers(Document\NodeList $usersBlockText): array + { + $signed = []; + for ($i = 1; $i < $usersBlockText->count(); $i++) { + preg_match( + "#[0-9]+\.[^\p{L}]([\p{L}\s]+)#msiu", + $usersBlockText[$i]->textContent, + $usernameMatch + ); + $signed[] = $usernameMatch[1]; + } + $collator = new \Collator("hu_HU"); + $collator->sort($signed); + return $signed; + } + + /** + * Can sign off if there is no red span inside the node + * @param Document $domDocument + * @param \DOMNode $domNode + * @return bool + */ + private function canSignOff(Document $domDocument, \DOMNode $domNode): bool + { + $redSpanNodes = Document\Query::execute( + './span[@class="red"]', + $domDocument, + Document\Query::TYPE_XPATH, + $domNode + ); + return $redSpanNodes->count() == 0; + } + + /** + * Can sign up if there is a form direct descendant + * @param Document $domDocument + * @param \DOMNode $domNode + * @return bool + */ + private function canSignUp(Document $domDocument, \DOMNode $domNode): bool + { + $formNodes = Document\Query::execute( + "./form", + $domDocument, + Document\Query::TYPE_XPATH, + $domNode + ); + return $formNodes->count() == 1; + } + + private function parseMainPage(string $htmlBody) + { + return false; + } + + private function getDisplayName(string $username): string + { + $response = $this->doSkiesRequest("GET", sprintf(self::SKIES_PROFILE_URL, $username)); + $profilePage = $response->getBody(); + + $domDocument = new Document($profilePage); + $h1Nodes = Document\Query::execute( + '//div[@class="box"]/h1', + $domDocument, + Document\Query::TYPE_XPATH + ); + return $this->clearTextNode($h1Nodes[0]->textContent); + } + + /** + * Clear junk from text nodes + * + * @param string $text + * @return string + */ + private function clearTextNode(string $text): string + { + $text = str_replace(" ", " ", $text); + $text = str_replace("–", "-", $text); + $text = preg_replace("#[ \t]+#msiu", " ", $text); + return trim($text, " \t\n\r\0\x0B" . chr(0xC2) . chr(0xA0)); + } + + /** + * Do an http request adding the Authorization header + * + * @param string $method + * @param string $url + * @param array $options + * @return ResponseInterface + */ + private function doSkiesRequest(string $method, string $url, $options = []): ResponseInterface + { + if ($this->authHeader == null) { + throw new MissingDependencyException("X-Passthru-Auth header is missing"); + } + return $this->client + ->request($method, $url, [ + 'headers' => [ + 'Authorization' => "Basic {$this->authHeader}", + ] + ] + $options); + } + + /** + * @return string + */ + private function getUsername(): string + { + if (null == $this->authHeader) { + throw new MissingDependencyException("X-Passthru-Auth header is missing"); + } + $decodedHeader = base64_decode($this->authHeader); + list($username) = explode(":", $decodedHeader); + return $username; + } +} diff --git a/src/App/Service/SkiesClientServiceFactory.php b/src/App/Service/SkiesClientServiceFactory.php new file mode 100644 index 0000000..1d97458 --- /dev/null +++ b/src/App/Service/SkiesClientServiceFactory.php @@ -0,0 +1,17 @@ + true, + ]); + return new SkiesClientService($httpClient); + } +} diff --git a/src/App/Service/SkiesService.php b/src/App/Service/SkiesService.php deleted file mode 100644 index fd87bfd..0000000 --- a/src/App/Service/SkiesService.php +++ /dev/null @@ -1,187 +0,0 @@ -container = $container; - $this->httpClient = new Client(); - $headers = $this->httpClient->getRequest()->getHeaders(); - $headers->addHeaderLine('Authorization', 'Basic ' . $this->getAuthToken()); - } - - /** - * Get a list of all activities - * - * @return array - */ - public function getActivityList() - { - $this->httpClient->setUri(self::BASE_URI . "main.asp?rID=2"); - $skiesResponse = $this->httpClient->send(); - $skiesHtmlBody = $skiesResponse->getBody(); - - $cssToXpathConverter = new CssSelectorConverter(); - $xpathQuery = $cssToXpathConverter->toXPath('html > body > div > div.row > div.col-md-10 > div.row > div.col-md-9 > div.box > table.table-striped > tr'); - - $doc = new \DOMDocument(); - $doc->loadHTML($skiesHtmlBody); - - $xpath = new \DOMXPath($doc); - $elements = $xpath->query($xpathQuery); - - $parsed = []; - /** @var \DOMNode $domElement */ - foreach ($elements as $domElement) { - if($domElement->childNodes->item(0)->nodeName != 'td') { - continue; - } - $url = $domElement->childNodes->item(0)->childNodes->item(0)->attributes->getNamedItem('href')->textContent; - preg_match("/aktid=([0-9]+)/msi", $url, $match); - $parsed[] = [ - 'id' => (int)$match[1], - 'label' => $domElement->childNodes->item(0)->childNodes->item(0)->textContent, - 'date' => $domElement->childNodes->item(2)->textContent, - 'time' => trim($domElement->childNodes->item(3)->textContent, " \t\n\r\0\x0B\xc2\xa0"), - ]; - } - - return $parsed; - } - - /** - * Get a single activity - * - * @param int $id - * @return array - */ - public function getActivity(int $id) - { - $this->httpClient->setUri(self::BASE_URI . "main.asp?rID=2&alt=1&aktID=" . $id); - $skiesResponse = $this->httpClient->send(); - $skiesHtmlBody = $skiesResponse->getBody(); - - $cssToXpathConverter = new CssSelectorConverter(); - $xpathQuery = $cssToXpathConverter->toXPath('div.container > div.row > div.col-md-10 > div.row > div.col-md-9 > div.box'); - $xpathCommentsQuery = $cssToXpathConverter->toXPath('div.container div.paragraph > div.onecomment'); - - $doc = new \DOMDocument(); - $doc->loadHTML($skiesHtmlBody); - - $xpath = new \DOMXPath($doc); - $elements = $xpath->query($xpathQuery); - - $h5Elements = $elements->item(0)->getElementsByTagName('h5'); - $title = $h5Elements->item(0)->textContent; - - $detailDivElements = $elements->item(0)->getElementsByTagName('div'); - $commentElements = $xpath->query($xpathCommentsQuery); - - $eventDetails = $this->parseActivityDetails($detailDivElements->item(1)->textContent); - $eventDescription = $this->parseActivityDescription($elements->item(0)); - $eventComments = $this->parseActivityComments($commentElements); - - return [ - 'title' => $title, - 'details' => $eventDetails, - 'description' => $eventDescription, - 'comments' => $eventComments, - ]; - } - - /** - * @return null|string - * @todo real auth token from whatever... - */ - private function getAuthToken(): ?string - { - $config = $this->container->get('config'); - return $config['authKey']; - } - - /** - * Parse the activity information details returning the date, time finaly entry and the person accountable - * - * @param string $divText - * @return array|null - */ - private function parseActivityDetails(string $divText): ?array - { - preg_match("#Date:.*?([0-9]{4}-[0-9]{2}-[0-9]{2}).*?Time: ([0-9]{1,2}:[0-9]{2}).*?Final entry day:.*?([0-9]{4}-[0-9]{2}-[0-9]{2}).*?Accountable: (.*?) / ([0-9 +]*)#msi", $divText, $matches); - return [ - 'date' => $matches[1], - 'time' => $matches[2], - 'finalEntry' => $matches[3], - 'accountable' => str_replace(" ", " ", $matches[5] ? sprintf("%s (%s)", $matches[4], $matches[5]) : $matches[4]), - ]; - } - - /** - * Parses comment block. Comment section is pretty much unformatted text - * between a
tag and a
tag in the passed $element - * - * @param \DOMElement $element - * @return null|string - */ - private function parseActivityDescription(\DOMElement $element): ?string - { - $description = ""; - $isContent = false; - /** @var \DOMElement $childNode */ - foreach($element->childNodes as $childNode) { - if ($childNode->nodeName == "hr") { $isContent = true; } - if ($childNode->nodeName == "form") { break; } - if ($isContent) { - $description .= $childNode->nodeName == "br" - ? "\n" - : rtrim($childNode->textContent); - } - } - return trim($description); - } - - /** - * Parse $commentElements - * - * @param \DOMNodeList $commentElements - * @return array|null - */ - private function parseActivityComments(\DOMNodeList $commentElements): ?array - { - $comments = []; - /** @var \DOMElement $commentElement */ - foreach($commentElements as $commentElement) { - preg_match("#(.*)\s/\s([0-9]{4}-[0-9]{2}-[0-9]{2})\s([0-9]{1,2}:[0-9]{1,2})#msi", str_replace(" "," ", $commentElement->getElementsByTagName("div")->item(2)->textContent), $matches); - $comments[] = [ - 'comment' => $commentElement->getElementsByTagName("div")->item(1)->textContent, - 'user' => $matches[1], - 'date' => $matches[2], - 'time' => $matches[3], - ]; - } - return $comments; - } -} diff --git a/src/App/Service/SkiesServiceFactory.php b/src/App/Service/SkiesServiceFactory.php deleted file mode 100644 index 6a11149..0000000 --- a/src/App/Service/SkiesServiceFactory.php +++ /dev/null @@ -1,13 +0,0 @@ -router = $this->prophesize(RouterInterface::class); } - public function testResponse() + public function testReturnsJsonResponseWhenNoTemplateRendererProvided() { $homePage = new HomePageAction($this->router->reveal(), null); - $response = $homePage(new ServerRequest(['/']), new Response(), function () { - }); + $response = $homePage->process( + $this->prophesize(ServerRequestInterface::class)->reveal(), + $this->prophesize(DelegateInterface::class)->reveal() + ); - $this->assertTrue($response instanceof Response); + $this->assertInstanceOf(JsonResponse::class, $response); + } + + public function testReturnsHtmlResponseWhenTemplateRendererProvided() + { + $renderer = $this->prophesize(TemplateRendererInterface::class); + $renderer + ->render('app::home-page', Argument::type('array')) + ->willReturn(''); + + $homePage = new HomePageAction($this->router->reveal(), $renderer->reveal()); + + $response = $homePage->process( + $this->prophesize(ServerRequestInterface::class)->reveal(), + $this->prophesize(DelegateInterface::class)->reveal() + ); + + $this->assertInstanceOf(HtmlResponse::class, $response); } } diff --git a/test/AppTest/Action/HomePageFactoryTest.php b/test/AppTest/Action/HomePageFactoryTest.php index 3a98fcd..627a20c 100644 --- a/test/AppTest/Action/HomePageFactoryTest.php +++ b/test/AppTest/Action/HomePageFactoryTest.php @@ -5,10 +5,11 @@ namespace AppTest\Action; use App\Action\HomePageAction; use App\Action\HomePageFactory; use Interop\Container\ContainerInterface; +use PHPUnit\Framework\TestCase; use Zend\Expressive\Router\RouterInterface; use Zend\Expressive\Template\TemplateRendererInterface; -class HomePageFactoryTest extends \PHPUnit_Framework_TestCase +class HomePageFactoryTest extends TestCase { /** @var ContainerInterface */ protected $container; @@ -26,11 +27,11 @@ class HomePageFactoryTest extends \PHPUnit_Framework_TestCase $factory = new HomePageFactory(); $this->container->has(TemplateRendererInterface::class)->willReturn(false); - $this->assertTrue($factory instanceof HomePageFactory); + $this->assertInstanceOf(HomePageFactory::class, $factory); $homePage = $factory($this->container->reveal()); - $this->assertTrue($homePage instanceof HomePageAction); + $this->assertInstanceOf(HomePageAction::class, $homePage); } public function testFactoryWithTemplate() @@ -41,10 +42,10 @@ class HomePageFactoryTest extends \PHPUnit_Framework_TestCase ->get(TemplateRendererInterface::class) ->willReturn($this->prophesize(TemplateRendererInterface::class)); - $this->assertTrue($factory instanceof HomePageFactory); + $this->assertInstanceOf(HomePageFactory::class, $factory); $homePage = $factory($this->container->reveal()); - $this->assertTrue($homePage instanceof HomePageAction); + $this->assertInstanceOf(HomePageAction::class, $homePage); } } diff --git a/test/AppTest/Action/PingActionTest.php b/test/AppTest/Action/PingActionTest.php index d0911f5..71a22fb 100644 --- a/test/AppTest/Action/PingActionTest.php +++ b/test/AppTest/Action/PingActionTest.php @@ -3,20 +3,24 @@ namespace AppTest\Action; use App\Action\PingAction; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; +use Interop\Http\ServerMiddleware\DelegateInterface; +use PHPUnit\Framework\TestCase; +use Psr\Http\Message\ServerRequestInterface; +use Zend\Diactoros\Response\JsonResponse; -class PingActionTest extends \PHPUnit_Framework_TestCase +class PingActionTest extends TestCase { public function testResponse() { $pingAction = new PingAction(); - $response = $pingAction(new ServerRequest(['/']), new Response(), function () { - }); + $response = $pingAction->process( + $this->prophesize(ServerRequestInterface::class)->reveal(), + $this->prophesize(DelegateInterface::class)->reveal() + ); + $json = json_decode((string) $response->getBody()); - $this->assertTrue($response instanceof Response); - $this->assertTrue($response instanceof Response\JsonResponse); + $this->assertInstanceOf(JsonResponse::class, $response); $this->assertTrue(isset($json->ack)); } }