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

Commit 1192fac

Browse files
committed
Added migration documentation for changes introduced by #99
1 parent 3326a04 commit 1192fac

File tree

5 files changed

+101
-9
lines changed

5 files changed

+101
-9
lines changed

doc/book/migration/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Migration
2+
3+
While we strive to keep functionality backwards compatible between releases,
4+
occasionally we need to break features in order to fix critical or security
5+
issues. Additionally, in order to signal upcoming changes, we will introduce
6+
deprecation notices or add forwards-compatibility features to assist you in
7+
migration.
8+
9+
The chapters in this section document these changes.
10+
11+
- [Migrating from v2.X to v2.7](to-v2-7.md)
12+
- [Migrating to v3.0](to-v3-0.md)

doc/book/migration.md renamed to doc/book/migration/to-v2-7.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
# Migration Guide
2-
31
## Upgrading to 2.7
42

5-
### Middleware
3+
## Middleware
64

75
zend-mvc now registers `Zend\Mvc\MiddlewareListener` as a dispatch listener at
86
a priority higher than `Zend\Mvc\DispatchListener`, allowing dispatch of
97
[PSR-7](http://www.php-fig.org/psr/psr-7/) middleware. Read the
10-
[middleware chapter](middleware.md) for details on how to use this new feature.
8+
[middleware chapter](../middleware.md) for details on how to use this new feature.
119

12-
### Application
10+
## Application
1311

1412
The constructor signature of `Zend\Mvc\Application` has changed. Previously, it
1513
was:
@@ -43,7 +41,7 @@ signature.
4341
This change should only affect users who are manually instantiating the
4442
`Application` instance.
4543

46-
### EventManagerAware initializers
44+
## EventManagerAware initializers
4745

4846
zend-mvc provides two mechanisms for injecting event managers into
4947
`EventManagerAware` objects. One is the "EventManagerAwareInitializer"
@@ -80,7 +78,7 @@ This likely will not cause regressions in existing code, but may be something to
8078
be aware of if you were previously depending on lazy-loaded event manager
8179
state.
8280

83-
### ServiceLocatorAware initializers
81+
## ServiceLocatorAware initializers
8482

8583
zend-servicemanager v3.0 removes `Zend\ServiceManager\ServiceLocatorAwareInterface`.
8684
Since zend-mvc provides initializers around that interface, they needed updates

doc/book/migration/to-v3-0.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Upgrading to 3.0
2+
3+
With the release of Zend Framework 2, all components current at that time,
4+
regardless of history, were tagged as v2 releases; in reality, it was the first
5+
version of a new framework, as it was a completely new architecture from Zend
6+
Framework 1. As such, zend-mvc 3.0 marks the second major release of the
7+
component.
8+
9+
The primary goal for version 3 was to reduce the number of dependencies, and to
10+
split out unrelated, tangential, or extension functionality. As such, there are
11+
a number of changes that will impact users.
12+
13+
## Dependency reduction
14+
15+
In order to remove dependencies, we needed to provide alternate ways to ensure
16+
that default functionality, such as service registration and event listener
17+
attachment, could still occur.
18+
19+
The solution to this problem was to expose each component as a module. This
20+
however, raised another problem: you now have to register components as modules
21+
in your application.
22+
23+
To solve this new problem, we created a new component,
24+
[zend-component-installer](http://zendframework.github.io/zend-component-installer/).
25+
Install this in your application now:
26+
27+
```bash
28+
$ composer require --dev zendframework/zend-component-installer
29+
```
30+
31+
Once installed, the component acts as a Composer plugin, and will intercept
32+
packages marked as components or Zend Framework modules, and register them with
33+
your application configuration. Components are pushed to the top of the module
34+
list, while modules are pushed to the end. As a development component, it will
35+
not be installed in your production distributions.
36+
37+
## Routing
38+
39+
Routing was removed from zend-mvc, and moved to a new component,
40+
[zend-router](https://zendframework.github.io/zend-router/), which is now a
41+
dependency of zend-mvc.
42+
43+
The changes that will impact users are:
44+
45+
- [Query route removal](http://zendframework.github.io/zend-router/migration/v2-to-v3/#query-route-removal);
46+
this route had been deprecated since 2.3.0, and removed for the 3.0 release.
47+
- [Namespace changes](http://zendframework.github.io/zend-router/migration/v2-to-v3/#namespace-change);
48+
with the separation to the zend-router component, all routes changed
49+
namespaces from `Zend\Mvc\Router` to `Zend\Router`.
50+
51+
Follow the links above for more details on these changes, and how to migrate
52+
your code.
53+
54+
## Console tooling
55+
56+
Console tooling, including console routes, were split off to a new component,
57+
[zend-mvc-console](https://zendframework.github.io/zend-mvc-console/). If you
58+
were using the console tooling, install zend-mvc-console:
59+
60+
```bash
61+
$ composer require zendframework/zend-mvc-console
62+
```
63+
64+
(Make sure you've already installed zend-component-installer before you do, to
65+
ensure the component is registered with your application!)
66+
67+
zend-mvc-console exposes all of the same functionality as was in the v2 series
68+
of zend-mvc, but most components are in different namespaces. Please read the
69+
[zend-mvc-console migration guide](http://zendframework.github.io/zend-mvc-console/migration/v2-to-v3/)
70+
for full details of what changes you may need to make to your application to
71+
ensure console tooling continues to work.
72+
73+
> ### Migrate your console tooling
74+
>
75+
> Due to the amount of integration required to support console tooling via the
76+
> MVC, we do not plan on supporting zend-mvc-console long-term. As such, we
77+
> recommend migrating your code to use standalone tools such as
78+
> [zf-console](https://github.com/zfcampus/zf-console) or
79+
> [Aura.Cli](https://github.com/auraphp/Aura.Cli).

doc/book/services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ services configured out of the box.
115115
`Zend\Mvc\Service\ControllerPluginManagerFactory`. This instantiates the
116116
`Zend\Mvc\Controller\PluginManager` instance, passing it the service manager
117117
instance. It also uses the `DiAbstractServiceFactory` service, effectively
118-
allowing you to fall back to DI in order to retrieve your [controller plugins](controller-plugins.md).
118+
allowing you to fall back to DI in order to retrieve your [controller plugins](plugins.md).
119119
It registers a set of default controller plugins, and contains an
120120
initializer for injecting plugins with the current controller.
121121

mkdocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ pages:
1313
- 'Controller Plugins': plugins.md
1414
- Examples: examples.md
1515
- 'Dispatching PSR-7 Middleware': middleware.md
16-
- 'Migration Guide': migration.md
16+
- Migration:
17+
- "Migration Overview": migration/index.md
18+
- 'v2.X to v2.7': migration/to-v2-7.md
19+
- 'v2.X to v3.0': migration/to-v3-0.md
1720
site_name: zend-mvc
1821
site_description: 'zend-mvc: MVC application provider'
1922
repo_url: 'https://github.com/zendframework/zend-mvc'

0 commit comments

Comments
 (0)