From d604aba24daa9945a07222ad9cc6df7e66bad8d4 Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sat, 7 May 2016 16:22:38 +0200 Subject: [PATCH 01/10] [Docs] Rename documentation files --- doc/book/{index.md => intro.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/book/{index.md => intro.md} (100%) diff --git a/doc/book/index.md b/doc/book/intro.md similarity index 100% rename from doc/book/index.md rename to doc/book/intro.md From c5b1aa7a38a20bc33ecf180d952f792b5e13b9be Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sat, 7 May 2016 16:24:53 +0200 Subject: [PATCH 02/10] [Docs] Switch from Bookdown to MkDocs configuration --- doc/bookdown.json | 9 --------- mkdocs.yml | 11 +++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 doc/bookdown.json create mode 100644 mkdocs.yml 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..5f2957c --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,11 @@ +docs_dir: doc/book +site_dir: doc/html +pages: + - index.md + - Intro: intro.md + - Installation: install.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.' \ No newline at end of file From 81a24b06743aff0b76a6849fc20b6c612ab7efd0 Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sat, 7 May 2016 16:25:18 +0200 Subject: [PATCH 03/10] [Docs] Add symlink for README.md --- doc/book/index.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/book/index.md diff --git a/doc/book/index.md b/doc/book/index.md new file mode 100644 index 0000000..fe84005 --- /dev/null +++ b/doc/book/index.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file From e43b2d367fc99c463ddff4ac468e0ab7eb8a80e6 Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sat, 7 May 2016 16:26:12 +0200 Subject: [PATCH 04/10] Docs] Create a doc/book/index.html --- doc/book/index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/book/index.html diff --git a/doc/book/index.html b/doc/book/index.html new file mode 100644 index 0000000..a469094 --- /dev/null +++ b/doc/book/index.html @@ -0,0 +1,11 @@ +
+
+

zend-psr7bridge

+ +

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

+ +
$ composer require zendframework/zend-psr7bridge
+
+
\ No newline at end of file From 1291666030726a3a3a038dcdf42d1306e0f33273 Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sat, 7 May 2016 16:26:56 +0200 Subject: [PATCH 05/10] [Docs] Update .gitignore file --- .gitignore | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 86974c6..2bc19ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,16 @@ +.buildpath +.DS_Store +.idea +.project +.settings/ +.*.sw* +.*.un~ +nbproject +tmp/ doc/html/ -vendor/ -composer.lock +zf-mkdoc-theme/ + +clover.xml +coveralls-upload.json phpunit.xml +vendor \ No newline at end of file From 7dca357aad33575da4d21cbc82f354955b72d68c Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sat, 7 May 2016 16:28:59 +0200 Subject: [PATCH 06/10] [Docs] Update .travis.yml file --- .travis.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6bbc02c..418a698 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: "" 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 From e1840a466c042c64fd5d26a90668d88cc5b22381 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 10 May 2016 16:39:51 -0500 Subject: [PATCH 07/10] Reviewed all docs for content and formatting --- doc/book/index.html | 5 +++-- doc/book/install.md | 7 ------- doc/book/intro.md | 9 ++------- doc/book/usage-examples.md | 36 +++++++++++++++++------------------- mkdocs.yml | 3 +-- 5 files changed, 23 insertions(+), 37 deletions(-) delete mode 100644 doc/book/install.md diff --git a/doc/book/index.html b/doc/book/index.html index a469094..af316a7 100644 --- a/doc/book/index.html +++ b/doc/book/index.html @@ -3,9 +3,10 @@

zend-psr7bridge

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

$ composer require zendframework/zend-psr7bridge
- \ 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 index ec21985..c046263 100644 --- a/doc/book/intro.md +++ b/doc/book/intro.md @@ -1,12 +1,7 @@ -# zend-psr7bridge +# Introduction 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 +[zend-http](https://zendframework.github.io/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. 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/mkdocs.yml b/mkdocs.yml index 5f2957c..5d967d6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,9 +3,8 @@ site_dir: doc/html pages: - index.md - Intro: intro.md - - Installation: install.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.' \ No newline at end of file +copyright: 'Copyright (c) 2016 Zend Technologies USA Inc.' From 81eb1bb3e6221abcb1d995719b1a9fa616f5167c Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 10 May 2016 16:42:22 -0500 Subject: [PATCH 08/10] Prepared documentation build automation --- .gitignore | 4 ++-- .travis.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2bc19ef..ffc7e23 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,11 @@ .*.sw* .*.un~ nbproject -tmp/ doc/html/ +tmp/ +vendor/ zf-mkdoc-theme/ clover.xml coveralls-upload.json phpunit.xml -vendor \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 418a698..47fe997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ env: - GH_USER_NAME: "Matthew Weier O'Phinney" - GH_USER_EMAIL: matthew@weierophinney.net - GH_REF: github.com/zendframework/zend-psr7bridge.git - - secure: "" + - secure: "QsS9xhQuW/8b3kiYNf1mAN2DpGkyqFGqcUZzv4wO+IMhq7NeE9HST7y5H0ByecJb822DBh6IZMEH3a75J0ekECFlYYdXj54ZzXghEAqL+R3uwmlxNGvmj1Q8N/VS5xt0N6qusN8a91tvXOsprKwzFY2v+/aS+gnaNIKha69Z9nlqcQnrAaeldWgBJcc//Y/sf0k0bzpqFScAwkgEVVk6PI1yuwXhnNiJa0e7YFbVJrk1uMQVNuKIUaQfQEMX4pI7RfhtD6/oOrwxt35ep35NNfEAG8UhAmv0vSZ9xEcepwu37cnS06Jn2g7PAQ0QYwrxv01OGrtprrD98SQaXJV9HcBDmbjh4L3+rVRR5j9moIob4jj20K3d7AmNzt5Ffe5v0TBk43pw7Ub0tFbwpDlcHKDqd97tPanUJso/TIEIprYap/5rY5HwDwvYn3xelKYWtvuJg3Qc9joJkRp2cuWXEjnKjlmeFW0YoX1Qv9fSuuWjJ9aMFqteZFQLxe64byQs0j64QiHSPMSGOT569JgxsFqcrfWkHKmvyiYQJknMWKN3DxdSlKk089jyA28QcSC8unEV25bhpCMEBFF1GOzX3IrcH12qf3EcP37xJiEVDkOAL0///+oxRQanqMPxynfUAmiY9+58GACeoaxqPM+yvpUBIDwnM3p2qG0VN1Hcn9I=" matrix: fast_finish: true From 6572be2eb4ad0be8beb15ed8b20a6c1d04dee41b Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 10 May 2016 16:43:39 -0500 Subject: [PATCH 09/10] Updated README - Got rid of obsolete information - Added issues and documentation links --- README.md | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) 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/ From cabc7f0dbe5f35b1eb3001de4e633fe1b7336869 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 10 May 2016 16:44:28 -0500 Subject: [PATCH 10/10] Added CHANGELOG for #8 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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