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

Revert usage of ROUTE_MIDDLEWARE constant in ApplicationFactory #559

Conversation

weierophinney
Copy link
Member

This reverts #556.

The reversion is due to the fact that @webimpress has discovered that all supported containers resolve aliases to the target service BEFORE determining if the service has already been created. As such, pulling a service by its alias will retrieve the same instance as pulling it by its canonical name.

As such, we can use the canonical name in the ApplicationFactory when retrieving the routing middleware for use with the Application.

…service' into release-3.0.0"

This reverts commit 5f280f2, reversing
changes made to bf4a4f8.

The reversion is due to the fact that @webimpress has discovered that
all supported containers resolve aliases to the target service BEFORE
determining if the service has already been created. As such, pulling a
service by its alias will retrieve the same instance as pulling it by
its canonical name.

As such, we can use the canonical name in the `ApplicationFactory` when
retrieving the routing middleware for use with the `Application`.

Conflicts:
	CHANGELOG.md
@weierophinney weierophinney added this to the 3.0.0alpha8 milestone Feb 15, 2018
@weierophinney weierophinney merged commit beeaf6a into zendframework:release-3.0.0 Feb 15, 2018
weierophinney added a commit that referenced this pull request Feb 15, 2018
@weierophinney weierophinney deleted the hotfix/dispatch-middleware-constant branch February 15, 2018 20:59
weierophinney added a commit to weierophinney/zend-expressive-skeleton that referenced this pull request Feb 15, 2018
This patch follows on zendframework/zend-expressive#559, and modifies
the pipeline to directly refer to the `PathBasedRoutingMiddleware`
instead of using the `ROUTE_MIDDLEWARE` constant. It's better and faster
to use the canonical name, and the old name (to which the constant
resolves) is an alias for purposes of aiding those upgrading from v2;
since aliases resolve to the same instance as the canonical service,
this remains backwards compatible.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant