Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/expressive-rc6' into develop
Browse files Browse the repository at this point in the history
Forward port #60
  • Loading branch information
weierophinney committed Jan 19, 2016
2 parents 14fb997 + 7a900ad commit d4ee0b1
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 30 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

## 1.0.0rc6 - TBD
## 1.0.0rc6 - 2016-01-19

Sixth release candidate.

Expand Down Expand Up @@ -36,6 +36,21 @@ Sixth release candidate.
- [#59](https://github.com/zendframework/zend-expressive-skeleton/pull/59)
updates the `config/container.php` implementation for zend-servicemanager such
that it can work with either v2 or v3 of that library.
- [#60](https://github.com/zendframework/zend-expressive-skeleton/pull/60)
updates the zend-expressive-helpers dependency to `^2.0`, and updates the
`config/autoload/middleware-pipeline.global.php` to follow the changes in
middleware configuration introduced in [zend-expressive #270](https://github.com/zendframework/zend-expressive/pull/270).
The change introduces convention-based keys for "always" (execute before
routing), "routing" (routing, listeners that act on the route result, and
dispatching), and "error", with reasonable priorities to ensure execution
order.
- [#60](https://github.com/zendframework/zend-expressive-skeleton/pull/60)
fixes the documentation for `composer create-project` to include the
`--no-dev` flag; this is done as composer currently installs the development
dependencies listed before the installer script rewrites the `composer.json`
file. Running `composer update` or `composer install` within the project
directory after the initial installation will install the development
dependencies.

## 1.0.0rc5 - 2015-12-22

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ removed.
Start your new Expressive project with composer:

```bash
$ composer create-project zendframework/zend-expressive-skeleton <project-path>
$ composer create-project --no-dev zendframework/zend-expressive-skeleton <project-path>
```

> ### Release Candidates
Expand All @@ -39,9 +39,15 @@ $ composer create-project zendframework/zend-expressive-skeleton <project-path>
> To install a release candidate, use the following:
>
> ```bash
> $ composer create-project zendframework/zend-expressive-skeleton:^1.0@rc <project-path>
> $ composer create-project --no-dev "zendframework/zend-expressive-skeleton:^1.0@rc" <project-path>
> ```
> ### Development requirements
>
> If you want Composer to install the development requirements defined by the
> skeleton — specifically PHPUnit and PHP_CodeSniffer — run a `composer update`
> after installing the skeleton.
After choosing and installing the packages you want, go to the
`<project-path>` and start PHP's built-in web server to verify installation:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"php": "^5.5 || ^7.0",
"roave/security-advisories": "dev-master",
"zendframework/zend-expressive": "~1.0.0@rc || ^1.0",
"zendframework/zend-expressive-helpers": "^1.3",
"zendframework/zend-expressive-helpers": "^2.0",
"zendframework/zend-stdlib": "~2.7"
},
"require-dev": {
Expand Down
75 changes: 50 additions & 25 deletions config/autoload/middleware-pipeline.global.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
use Zend\Expressive\Container\ApplicationFactory;
use Zend\Expressive\Helper;

return [
Expand All @@ -10,34 +11,58 @@
],
// This can be used to seed pre- and/or post-routing middleware
'middleware_pipeline' => [
// An array of middleware to register prior to registration of the
// routing middleware
'pre_routing' => [
//[
// Required:
// 'middleware' => 'Name or array of names of middleware services and/or callables',
// Optional:
// 'path' => '/path/to/match',
// 'error' => true,
//],
[
'middleware' => [
Helper\ServerUrlMiddleware::class,
Helper\UrlHelperMiddleware::class,
],
// 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,
],

// An array of middleware to register after registration of the
// routing middleware
'post_routing' => [
//[
// Required:
// 'middleware' => 'Name of middleware service, or a callable',
// Optional:
// 'path' => '/path/to/match',
// 'error' => true,
//],
'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.
],
'priority' => -10000,
],
],
];
2 changes: 1 addition & 1 deletion src/ExpressiveInstaller/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'zendframework/zend-expressive-twigrenderer' => '^1.0',
'zendframework/zend-expressive-zendrouter' => '^1.0',
'zendframework/zend-expressive-zendviewrenderer' => '^1.0',
'zendframework/zend-servicemanager' => '^2.5',
'zendframework/zend-servicemanager' => '^2.7.3 || ^3.0',
],

'require-dev' => [
Expand Down

0 comments on commit d4ee0b1

Please sign in to comment.