diff --git a/.gitignore b/.gitignore index 86974c6..ffc7e23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,16 @@ +.buildpath +.DS_Store +.idea +.project +.settings/ +.*.sw* +.*.un~ +nbproject doc/html/ +tmp/ vendor/ -composer.lock +zf-mkdoc-theme/ + +clover.xml +coveralls-upload.json phpunit.xml diff --git a/.travis.yml b/.travis.yml index 6bbc02c..47fe997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,16 @@ cache: directories: - $HOME/.composer/cache - vendor + - $HOME/.local + - zf-mkdoc-theme + +env: + global: + - SITE_URL: https://zendframework.github.io/zend-psr7bridge + - GH_USER_NAME: "Matthew Weier O'Phinney" + - GH_USER_EMAIL: matthew@weierophinney.net + - GH_REF: github.com/zendframework/zend-psr7bridge.git + - secure: "QsS9xhQuW/8b3kiYNf1mAN2DpGkyqFGqcUZzv4wO+IMhq7NeE9HST7y5H0ByecJb822DBh6IZMEH3a75J0ekECFlYYdXj54ZzXghEAqL+R3uwmlxNGvmj1Q8N/VS5xt0N6qusN8a91tvXOsprKwzFY2v+/aS+gnaNIKha69Z9nlqcQnrAaeldWgBJcc//Y/sf0k0bzpqFScAwkgEVVk6PI1yuwXhnNiJa0e7YFbVJrk1uMQVNuKIUaQfQEMX4pI7RfhtD6/oOrwxt35ep35NNfEAG8UhAmv0vSZ9xEcepwu37cnS06Jn2g7PAQ0QYwrxv01OGrtprrD98SQaXJV9HcBDmbjh4L3+rVRR5j9moIob4jj20K3d7AmNzt5Ffe5v0TBk43pw7Ub0tFbwpDlcHKDqd97tPanUJso/TIEIprYap/5rY5HwDwvYn3xelKYWtvuJg3Qc9joJkRp2cuWXEjnKjlmeFW0YoX1Qv9fSuuWjJ9aMFqteZFQLxe64byQs0j64QiHSPMSGOT569JgxsFqcrfWkHKmvyiYQJknMWKN3DxdSlKk089jyA28QcSC8unEV25bhpCMEBFF1GOzX3IrcH12qf3EcP37xJiEVDkOAL0///+oxRQanqMPxynfUAmiY9+58GACeoaxqPM+yvpUBIDwnM3p2qG0VN1Hcn9I=" matrix: fast_finish: true @@ -16,6 +26,8 @@ matrix: - php: 5.6 env: - EXECUTE_COVERAGE=true + - DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)" + - PATH="$HOME/.local/bin:$PATH" - php: 7 - php: hhvm allow_failures: @@ -38,6 +50,10 @@ script: - if [[ $EXECUTE_COVERAGE == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi - if [[ $EXECUTE_COVERAGE != 'true' ]]; then ./vendor/bin/phpunit ; fi - if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs ; fi + - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi + +after_success: + - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi after_script: - if [[ $EXECUTE_COVERAGE == 'true' ]]; then ./vendor/bin/coveralls ; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f4624..5321b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file, in reverse ### Added -- Nothing. +- [#8](https://github.com/zendframework/zend-psr8bridge/pull/8) adds and + publishes the documentation to https://zendframework.github.io/zend-psr7bridge/ ### Deprecated diff --git a/README.md b/README.md index 53e89cc..1bb4f12 100644 --- a/README.md +++ b/README.md @@ -8,29 +8,5 @@ versa. **Note: This project is a work in progress.** -Initial functionality is only covering conversion of non-body request data from -PSR-7 to zend-http in order to facilitate routing in -[zend-expressive](https://github.com/zendframework/zend-expressive); we plan to -expand this once initial work on zend-expressive is complete. - -## Installation - -Install this library using composer: - -```console -$ composer require zendframework/zend-psr7bridge -``` - -## Documentation - -Documentation is [in the doc tree](doc/), and can be compiled using [bookdown](http://bookdown.io): - -```console -$ bookdown doc/bookdown.json -$ php -S 0.0.0.0:8080 -t doc/html/ # then browse to http://localhost:8080/ -``` - -> ### Bookdown -> -> You can install bookdown globally using `composer global require bookdown/bookdown`. If you do -> this, make sure that `$HOME/.composer/vendor/bin` is on your `$PATH`. +- Issues: https://github.com/zendframework/zend-psr7bridge/issues +- Documentation: https://zendframework.github.io/zend-psr7bridge/ diff --git a/doc/book/index.html b/doc/book/index.html new file mode 100644 index 0000000..af316a7 --- /dev/null +++ b/doc/book/index.html @@ -0,0 +1,12 @@ +
+
+

zend-psr7bridge

+ +

+ PSR-7 <-> zend-http message conversions. +

+ +
$ composer require zendframework/zend-psr7bridge
+
+
+ diff --git a/doc/book/index.md b/doc/book/index.md index ec21985..fe84005 100644 --- a/doc/book/index.md +++ b/doc/book/index.md @@ -1,12 +1 @@ -# zend-psr7bridge - -Code for converting [PSR-7](http://www.php-fig.org/psr/psr-7/) messages to -[zend-http](https://github.com/zendframework/zend-http) messages, and vice -versa. - -**Note: This project is a work in progress.** - -Initial functionality is only covering conversion of non-body request data from -PSR-7 to zend-http in order to facilitate routing in -[zend-expressive](https://github.com/zendframework/zend-expressive); we plan to -expand this once initial work on zend-expressive is complete. +../../README.md \ No newline at end of file diff --git a/doc/book/install.md b/doc/book/install.md deleted file mode 100644 index c32bca2..0000000 --- a/doc/book/install.md +++ /dev/null @@ -1,7 +0,0 @@ -# Installation - -Install this library using composer: - -```console -$ composer require zendframework/zend-psr7bridge -``` diff --git a/doc/book/intro.md b/doc/book/intro.md new file mode 100644 index 0000000..c046263 --- /dev/null +++ b/doc/book/intro.md @@ -0,0 +1,7 @@ +# Introduction + +Code for converting [PSR-7](http://www.php-fig.org/psr/psr-7/) messages to +[zend-http](https://zendframework.github.io/zend-http/) messages, and vice +versa. + +**Note: This project is a work in progress.** diff --git a/doc/book/usage-examples.md b/doc/book/usage-examples.md index 74b37f8..5f7f4f2 100644 --- a/doc/book/usage-examples.md +++ b/doc/book/usage-examples.md @@ -22,28 +22,26 @@ It is useful to omit these for purposes of routing, for instance, when you may not need this more process-intensive data. By default, the `$shallow` flag is `false`, meaning a full conversion is done. -### Examples +## Examples -- Doing a full conversion: +### Full conversion to zend-http request - ```php - dispatch( - Psr7ServerRequest::toZend($request), - new Response() - ); - ``` +// Assume $controller is a Zend\Mvc\Controller\AbstractController instance. +$result = $controller->dispatch( + Psr7ServerRequest::toZend($request), + new Response() +); +``` -- Doing a shallow conversion: +### Shallow conversion to zend-http request - ```php - match(Psr7ServerRequest::toZend($request, true)); - ``` +// Assume $router is a Zend\Router\Http\TreeRouteStack instance. +$match = $router->match(Psr7ServerRequest::toZend($request, true)); +``` diff --git a/doc/bookdown.json b/doc/bookdown.json deleted file mode 100644 index efc240d..0000000 --- a/doc/bookdown.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "title": "zend-psr7bridge: PSR-7 <-> zend-http message conversion", - "content": [ - "book/index.md", - "book/install.md", - "book/usage-examples.md" - ], - "target": "./html" -} diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..5d967d6 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,10 @@ +docs_dir: doc/book +site_dir: doc/html +pages: + - index.md + - Intro: intro.md + - Usage: usage-examples.md +site_name: zend-psr7bridge +site_description: zend-psr7bridge +repo_url: 'https://github.com/zendframework/zend-psr7bridge' +copyright: 'Copyright (c) 2016 Zend Technologies USA Inc.'