Skip to content

Commit

Permalink
Merge tag '1.4.0' into php-5.3
Browse files Browse the repository at this point in the history
zend-diactoros 1.4.0

Added
-----

- [zendframework#219](zendframework#219) adds two new
  classes, `Zend\Diactoros\Request\ArraySerializer` and
  `Zend\Diactoros\Response\ArraySerializer`. Each exposes the static methods
  `toArray()` and `fromArray()`, allowing de/serialization of messages from and
  to arrays.

- [zendframework#236](zendframework#236) adds two new
  constants to the `Response` class: `MIN_STATUS_CODE_VALUE` and
  `MAX_STATUS_CODE_VALUE`.

Changes
-------

- [zendframework#240](zendframework#240) changes the
  behavior of `ServerRequestFactory::fromGlobals()` when no `$cookies` argument
  is present. Previously, it would use `$_COOKIES`; now, if a `Cookie` header is
  present, it will parse and use that to populate the instance instead.

  This change allows utilizing cookies that contain period characters (`.`) in
  their names (PHP's built-in cookie handling renames these to replace `.` with
  `_`, which can lead to synchronization issues with clients).

- [zendframework#235](zendframework#235) changes the
  behavior of `Uri::__toString()` to better follow proscribed behavior in PSR-7.
  In particular, prior to this release, if a scheme was missing but an authority
  was present, the class was incorrectly returning a value that did not include
  a `//` prefix. As of this release, it now does this correctly.

Deprecated
----------

- Nothing.

Removed
-------

- Nothing.

Fixed
-----

- Nothing.
  • Loading branch information
jesseschalken committed May 15, 2017
2 parents 32669db + b03f285 commit c469dd4
Show file tree
Hide file tree
Showing 46 changed files with 3,599 additions and 378 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
coverage_clover: clover.xml
json_path: coveralls-upload.json
src_dir: src
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
doc/html/
vendor/
composer.lock
zf-mkdoc-theme/
phpunit.xml
106 changes: 89 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,110 @@ language: php
cache:
directories:
- $HOME/.composer/cache
- vendor
- $HOME/.local
- zf-mkdoc-theme

env:
global:
- COMPOSER_ARGS="--no-interaction"
- SITE_URL="https://zendframework.github.io/zend-diactoros"
- GH_USER_NAME="Matthew Weier O'Phinney"
- GH_USER_EMAIL="matthew@weierophinney.net"
- GH_REF="github.com/zendframework/zend-diactoros.git"
- secure: "abqt51VvId/3EvfymODyivOye2YNlTXPMNk297kM3G5bMxB7ILPUwwSTxfMHoiW9BHjJpdKi+IGBF4GKeYElQHdIwleyLow8dTCpUiJS3RogwaTcm2FbwEJDCFbkV4WRm/HHjriji/wBfBmaAJEfYYlLQAHQWTT7AK7dAgQmiAzaItStl2TV5D/XZU9GLNXay3nH0cDygf+g4t6rFcf3VsI5weHb3WhjATfN+mU82XXkwm2z8Pc1IglBYHskdlwUgbsz8ppTdXplXdKjnf6YdxPapYDKd7TecIV3BWtueC2i48rqblPaSWOzx7qMCA/4aJjzEBmuqqSlYXka2SdGPdBPbpGwcKv09e273xqWQ9sF3d8YhEsSrJBpMpgu4RN+ucLRa15Xcj0oF4aVxrFqxtC7wud7hC0pg6q48dY7PlQh/wTO2biuXcGACcGqMcjPgmE3HJYpK5HoWHUBoWi1VHqbTPRx1jIQD1ILibu9WkuTEtdAi5IXSYAmVSknfyZ7UYJuJgOjhmmkMOcYzD5JJuRGEJASzQk1tX5DItX8mH/LIW942bVOQ+fwsmL/Z+tJDnMpJXLd6tXtyYs99lxFSBSSjqNGAG5HUFjVczvQy9GeeDd2p70IA80NuQNjfXrsyQ9tg8d1keNTOpPCJUwZm7S6IEsvrWAGO6lZ+q7DPQk="

matrix:
fast_finish: true
include:
- php: 5.4
env:
- DEPS=lowest
- php: 5.4
env:
- DEPS=locked
- php: 5.4
env:
- DEPS=latest
- php: 5.5
env:
- DEPS=lowest
- php: 5.5
env:
- EXECUTE_CS_CHECK=true
- DEPS=locked
- php: 5.5
env:
- DEPS=latest
- php: 5.6
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- TEST_COVERAGE=true
- php: 5.6
env:
- EXECUTE_COVERAGE=true
- DEPS=latest
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=locked
- CHECK_CS=true
- php: 7
env:
- DEPS=latest
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=locked
- php: 7.1
env:
- DEPS=latest
- php: hhvm

notifications:
irc: "irc.freenode.org#zftalk.dev"
email: false
env:
- DEPS=lowest
- php: hhvm
env:
- DEPS=locked
- php: hhvm
env:
- DEPS=latest

before_install:
- if [[ $EXECUTE_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- composer self-update
- if [[ $EXECUTE_COVERAGE == 'true' ]]; then composer require --no-update satooshi/php-coveralls:dev-master ; fi
- travis_retry composer self-update
- if [[ $TEST_COVERAGE != 'true' && "$(php --version | grep xdebug -ci)" -ge 1 ]]; then phpenv config-rm xdebug.ini ; fi

install:
- travis_retry composer install --no-interaction --ignore-platform-reqs --prefer-source
- composer info -i
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS satooshi/php-coveralls:^1.0 ; fi
- travis_retry composer install $COMPOSER_ARGS
- composer show

script:
- if [[ $EXECUTE_COVERAGE == 'true' ]]; then composer test-coverage ; fi
- if [[ $EXECUTE_COVERAGE != 'true' ]]; then composer test ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CHECK_CS == 'true' ]]; then composer cs-check ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then travis_retry curl -sSL https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh | bash ; fi

after_script:
- if [[ $EXECUTE_COVERAGE == 'true' ]]; then composer coveralls ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer upload-coverage ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then ./zf-mkdoc-theme/deploy.sh ; fi

notifications:
email: false
irc:
channels:
- "irc.freenode.org#zftalk.dev"
on_success: change
on_failure: always
slack:
rooms:
- secure: "ZAuRmzfa+3KhaRS8h9HnDBvbPtToLMe2dXU5T8WiMLh+7CKcn035p8JvX0popIIsI+ue0uNP2YBDbfO/VtN6IiZnwmf6I2PqjVWmrSQEStyqMdJWetONISNBpQc1iinf2lp9Pp6DS2/622nB8/DVPthJvyCEOjgZZjzoPCfUWjpijHDr9vvw4aWhLuPDuJl58hfTjolkbA9O844VS40/Pr6ADOBs9ZZHRjMN0xg/0RyPe5B5+i1ppWGYFFmPwRGQMnV/MSwYpFiEKP8oqLINXpSHFutNr+al/RpZhDooxRmq8w+nUVrlHaL1740gO5lbXUijLqBp/tfX/y4rMg+c7F02k6oHvulbKMw6v2bC5Pn2TvubQC+Ix9bUvmRnW9Q6QxeVhT0Q0y7A8Glw0EoaggxNY6RmDUJJ/zRyNbSWFEGLUb19T6IveuUqxT+0NbJc8juI1yfGYskUHepY/5UYzW7y5qLsB7SdNVz8HU2LWH9To6BWTJwkkvSdcQwsLXGej+opYRjwCqYSj8rk7RvKN0pt22N/HfiC8ZUbPRNBFkA6TKv7ZXUY5O83IXEVOKU16KkZNlL1CjlJFNOEM07M9Nx+j0ujeBKFiBk2U2O7oyo2UCI4O5Q8lY2WRPa1gqNJ0lAqy3lGIYHeAyfra5kdnfUdXDN/+XMmPKVNWAIN3ic="
on_success: change
on_failure: always
205 changes: 205 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,211 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.4.0 - 2017-04-06

### Added

- [#219](https://github.com/zendframework/zend-diactoros/pull/219) adds two new
classes, `Zend\Diactoros\Request\ArraySerializer` and
`Zend\Diactoros\Response\ArraySerializer`. Each exposes the static methods
`toArray()` and `fromArray()`, allowing de/serialization of messages from and
to arrays.

- [#236](https://github.com/zendframework/zend-diactoros/pull/236) adds two new
constants to the `Response` class: `MIN_STATUS_CODE_VALUE` and
`MAX_STATUS_CODE_VALUE`.

### Changes

- [#240](https://github.com/zendframework/zend-diactoros/pull/240) changes the
behavior of `ServerRequestFactory::fromGlobals()` when no `$cookies` argument
is present. Previously, it would use `$_COOKIES`; now, if a `Cookie` header is
present, it will parse and use that to populate the instance instead.

This change allows utilizing cookies that contain period characters (`.`) in
their names (PHP's built-in cookie handling renames these to replace `.` with
`_`, which can lead to synchronization issues with clients).

- [#235](https://github.com/zendframework/zend-diactoros/pull/235) changes the
behavior of `Uri::__toString()` to better follow proscribed behavior in PSR-7.
In particular, prior to this release, if a scheme was missing but an authority
was present, the class was incorrectly returning a value that did not include
a `//` prefix. As of this release, it now does this correctly.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.3.11 - 2017-04-06

### Added

- Nothing.

### Changes

- [#241](https://github.com/zendframework/zend-diactoros/pull/241) changes the
constraint by which the package provides `psr/http-message-implementation` to
simply `1.0` instead of `~1.0.0`, to follow how other implementations provide
PSR-7.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#161](https://github.com/zendframework/zend-diactoros/pull/161) adds
additional validations to header names and values to ensure no malformed values
are provided.

- [#234](https://github.com/zendframework/zend-diactoros/pull/234) fixes a
number of reason phrases in the `Response` instance, and adds automation from
the canonical IANA sources to ensure any new phrases added are correct.

## 1.3.10 - 2017-01-23

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#226](https://github.com/zendframework/zend-diactoros/pull/226) fixed an
issue with the `SapiStreamEmitter` causing the response body to be cast
to `(string)` and also be read as a readable stream, potentially producing
double output.

## 1.3.9 - 2017-01-17

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#223](https://github.com/zendframework/zend-diactoros/issues/223)
[#224](https://github.com/zendframework/zend-diactoros/pull/224) fixed an issue
with the `SapiStreamEmitter` consuming too much memory when producing output
for readable bodies.

## 1.3.8 - 2017-01-05

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#222](https://github.com/zendframework/zend-diactoros/pull/222) fixes the
`SapiStreamEmitter`'s handling of the `Content-Range` header to properly only
emit a range of bytes if the header value is in the form `bytes {first-last}/length`.
This allows using other range units, such as `items`, without incorrectly
emitting truncated content.

## 1.3.7 - 2016-10-11

### Added

- [#208](https://github.com/zendframework/zend-diactoros/pull/208) adds several
missing response codes to `Zend\Diactoros\Response`, including:
- 226 ('IM used')
- 308 ('Permanent Redirect')
- 444 ('Connection Closed Without Response')
- 499 ('Client Closed Request')
- 510 ('Not Extended')
- 599 ('Network Connect Timeout Error')
- [#211](https://github.com/zendframework/zend-diactoros/pull/211) adds support
for UTF-8 characters in query strings handled by `Zend\Diactoros\Uri`.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.3.6 - 2016-09-07

### Added

- [#170](https://github.com/zendframework/zend-diactoros/pull/170) prepared
documentation for publication at https://zendframework.github.io/zend-diactoros/
- [#165](https://github.com/zendframework/zend-diactoros/pull/165) adds support
for Apache `REDIRECT_HTTP_*` header detection in the `ServerRequestFactory`.
- [#166](https://github.com/zendframework/zend-diactoros/pull/166) adds support
for UTF-8 characters in URI paths.
- [#204](https://github.com/zendframework/zend-diactoros/pull/204) adds testing
against PHP 7.1 release-candidate builds.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#186](https://github.com/zendframework/zend-diactoros/pull/186) fixes a typo
in a variable name within the `SapiStreamEmitter`.
- [#200](https://github.com/zendframework/zend-diactoros/pull/200) updates the
`SapiStreamEmitter` to implement a check for `isSeekable()` prior to attempts
to rewind; this allows it to work with non-seekable streams such as the
`CallbackStream`.
- [#169](https://github.com/zendframework/zend-diactoros/pull/169) ensures that
response serialization always provides a `\r\n\r\n` sequence following the
headers, even when no message body is present, to ensure it conforms with RFC
7230.
- [#175](https://github.com/zendframework/zend-diactoros/pull/175) updates the
`Request` class to set the `Host` header from the URI host if no header is
already present. (Ensures conformity with PSR-7 specification.)
- [#197](https://github.com/zendframework/zend-diactoros/pull/197) updates the
`Uri` class to ensure that string serialization does not include a colon after
the host name if no port is present in the instance.

## 1.3.5 - 2016-03-17

### Added
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ standards checks, and provides configuration for our selected checks.
To run checks only:

```console
$ ./vendor/bin/phpcs --standard=PSR2 src test
$ composer cs-check
```

`phpcs` also installs a tool named `phpcbf` which can attempt to fix problems
for you:

```console
$ ./vendor/bin/phpcbf --standard=PSR2 src test
$ composer cs-fix
```

If you allow phpcbf to fix CS issues, please re-run the tests to ensure
Expand Down
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,11 @@ This package supercedes and replaces [phly/http](https://github.com/phly/http).

## 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`;
> on *nix-like systems, you can do this by adding the following line to your
> `.bashrc` (or preferred shell RC file):
>
> ```bash
> export PATH="$HOME/.composer/vendor/bin:$PATH"
> ```
Documentation is available at:

- https://zendframework.github.io/zend-diactoros/

Source files for documentation are [in the doc/ tree](doc/).

[Master]: https://travis-ci.org/zendframework/zend-diactoros
[Master image]: https://secure.travis-ci.org/zendframework/zend-diactoros.svg?branch=master
Expand Down
Loading

0 comments on commit c469dd4

Please sign in to comment.