PHPackages                             webimpress/zend-expressive-migration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. webimpress/zend-expressive-migration

Abandoned → [zendframework/zend-expressive-migration](/?search=zendframework%2Fzend-expressive-migration)ArchivedLibrary[Database &amp; ORM](/categories/database)

webimpress/zend-expressive-migration
====================================

Migrate Expressive applications from v2 to v3

0.1.0(8y ago)453[3 issues](https://github.com/webimpress/zend-expressive-migration/issues)[1 PRs](https://github.com/webimpress/zend-expressive-migration/pulls)BSD-3-ClausePHPPHP ^7.1

Since Mar 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/webimpress/zend-expressive-migration)[ Packagist](https://packagist.org/packages/webimpress/zend-expressive-migration)[ RSS](/packages/webimpress-zend-expressive-migration/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

zend-expressive-migration
=========================

[](#zend-expressive-migration)

> ## Repository abandoned 2019-12-31
>
> [](#repository-abandoned-2019-12-31)
>
> This repository has moved to [mezzio/mezzio-migration](https://github.com/mezzio/mezzio-migration).

[![Build Status](https://camo.githubusercontent.com/d739f6bea7ac15b924e108e1436d77334ca9583f136b358b506424b6b6f9b7ed/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a656e646672616d65776f726b2f7a656e642d657870726573736976652d6d6967726174696f6e2e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zendframework/zend-expressive-migration)[![Coverage Status](https://camo.githubusercontent.com/0a064ae663192ab92faf40fbd67eef508748b36347f1f4c8ddf8c28502d8d5b1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a656e646672616d65776f726b2f7a656e642d657870726573736976652d6d6967726174696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zendframework/zend-expressive-migration?branch=master)

This library provides a tool for migrating from Expressive v2 to v3.

Installation
------------

[](#installation)

Run the following to install this library:

```
$ composer require --dev zendframework/zend-expressive-migration
```

Usage
-----

[](#usage)

Once you have installed the tool, execute it with the following:

```
$ ./vendor/bin/expressive-migration migrate
```

> ### Cloning versus composer installation
>
> [](#cloning-versus-composer-installation)
>
> If you'd rather clone the tooling once and re-use it many times, you can do that instead. Clone using:
>
> ```
> $ git clone https://github.com/zendframework/zend-expressive-migration
> ```
>
>
>
> And then, instead of using `./vendor/bin/expressive-migration migrate`, use `/full/path/to/zend-expressive-migration/bin/expressive-migration`.

> **TODO:**
>
> Our goal is to prepare a downloadable [phar](http://php.net/phar) file that can be installed in your system and re-used; this change will come at a future date.

Requirements
------------

[](#requirements)

All external packages used within your project must be compatible with Expressive v3 libraries. If you are unsure, check their dependencies.

This script will uninstall all dependent packages and then will try to install them with the latest compatible version. In case any package is not compatible, the script will report an error indicating which package need to be updated.

The following table indicates Expressive package versions compatible with version 3, and to which the migration tool will update.

Package nameVersionzend-auradi-config1.0.0zend-component-installer2.1.0zend-config-aggregator1.1.0zend-diactoros1.7.1zend-expressive3.0.0zend-expressive-aurarouter3.0.0zend-expressive-authentication0.4.0zend-expressive-authentication-basic0.3.0zend-expressive-authentication-oauth20.4.0zend-expressive-authentication-session0.4.0zend-expressive-authentication-zendauthentication0.4.0zend-expressive-authorization0.4.0zend-expressive-authorization-acl0.3.0zend-expressive-authorization-rbac0.3.0zend-expressive-csrf1.0.0zend-expressive-fastroute3.0.0zend-expressive-flash1.0.0zend-expressive-hal1.0.0zend-expressive-helpers5.0.0zend-expressive-platesrenderer2.0.0zend-expressive-router3.0.0zend-expressive-session1.0.0zend-expressive-session-ext1.0.0zend-expressive-template2.0.0zend-expressive-tooling1.0.0zend-expressive-twigrenderer2.0.0zend-expressive-zendrouter3.0.0zend-expressive-zendviewrenderer2.0.0zend-httphandlerrunner1.0.1zend-pimple-config1.0.0zend-problem-details1.0.0zend-stratigility3.0.0What does the tool do?
----------------------

[](#what-does-the-tool-do)

In order to operate, the tool requires that the application directory contains a `composer.json` file, and that this file is writable by the script.

Next, it attempts to detect the currently used Expressive version. If the version detected is not a 2.X version, the script will exit without performing any changes.

It then performs the following steps:

1. Removes the `vendor` directory.
2. Installs current dependencies using `composer install`.
3. Analyzes `composer.lock` to identify all packages which depends on Expressive packages.
4. Removes all installed Expressive packages and packages that depend on them.
5. Updates all remaining packages using `composer update`.
6. Requires all Expressive packages previously installed, adding the packages `zendframework/zend-component-installer` and `zendframework/zend-expressive-tooling`as development packages if they were not previously installed.
7. Requires all packages installed previously that were dependent on Expressive. **This step may fail** in situations where external packages are not yet compatible with Expressive v3 or its required libraries.
8. Updates `config/pipeline.php`:

    1. adds strict type declarations to the top of the file;
    2. adds a function wrapper (as is done in the version 3 skeleton);
    3. updates the following middleware:
        - `pipeRoutingMiddleware` becomes a `pipe()` statement referencing `Zend\Expressive\Router\Middleware\RouteMiddleware`.
        - `pipeDispatchMiddleware` becomes a `pipe()` statement referencing `Zend\Expressive\Router\Middleware\DispatchMiddleware`,
        - References to `Zend\Expressive\Middleware\NotFoundHandler` become `Zend\Expressive\Handler\NotFoundHandler`,
        - References to `Zend\Expressive\Middleware\ImplicitHeadMiddleware` become `Zend\Expressive\Router\Middleware\ImplicitHeadMiddleware`,
        - References to `Zend\Expressive\Middleware\ImplicitOptionsMiddleware` become `Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware`,
    4. pipes `Zend\Expressive\Router\Middleware\MethodNotAllowedMiddleware` after `Implicit*Middleware` (or if these are not piped, after `Zend\Expressive\Router\Middleware\RouteMiddleware`).
9. Updates `config/routes.php`:

    1. adds strict type declaration on top of the file;
    2. adds a function wrapper (as is done in the version 3 skeleton).
10. Replaces `public/index.php` with the latest version from the v3 skeleton.
11. Updates container configuration if `pimple` or `Aura.Di` were used (`config/container.php`) from the latest skeleton version. Additionally, it does the following:

    - For `pimple`: the package `xtreamwayz/pimple-container-interop` is replaced by `zendframework/zend-pimple-config`.
    - For `Aura.Di`: the package `aura/di` is replaced by `zendframework/zend-auradi-config`.
12. Migrates http-interop middleware to PSR-15 middleware using `./vendor/bin/expressive migrate:interop-middleware`.
13. Migrates PSR-15 middleware to PSR-15 request handlers using `./vendor/bin/expressive migrate:middleware-to-request-handler`.
14. Runs `./vendor/bin/phpcbf` if it is available.

What should you do after migration?
-----------------------------------

[](#what-should-you-do-after-migration)

You will need to update your tests to use PSR-15 middleware instead of http-interop middleware. This step is not done automatically because *it is too complicated*. We can easily change imported classes, but unfortunately test strategies and mocking strategies vary widely, and detecting all http-interop variants makes this even more difficult.

Please manually compare and verify all changes made. It is possible that in some edge cases, the script will not work correctly. This will depend primarily on the number of modifications you have made to the original skeleton.

> #### Configuration-driven pipelines and routes
>
> [](#configuration-driven-pipelines-and-routes)
>
> The script does not work currently make any modifications to pipeline and route configuration; these will need to be updated manually.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2978d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06864e2afad0a0cb0b46016664bf5895c3378c8b413e0bddd03075011fc6d731?d=identicon)[webimpress](/maintainers/webimpress)

---

Top Contributors

[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (37 commits)")[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (14 commits)")[![geerteltink](https://avatars.githubusercontent.com/u/9497586?v=4)](https://github.com/geerteltink "geerteltink (1 commits)")

---

Tags

migrationZendFrameworkzfexpressive

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webimpress-zend-expressive-migration/health.svg)

```
[![Health](https://phpackages.com/badges/webimpress-zend-expressive-migration/health.svg)](https://phpackages.com/packages/webimpress-zend-expressive-migration)
```

###  Alternatives

[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M262](/packages/ssch-typo3-rector)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[doesntmattr/mongodb-migrations

Managed Database Migrations for MongoDB

23598.7k1](/packages/doesntmattr-mongodb-migrations)[elie29/zend-phpdi-config

PSR-11 PHP-DI autowire container configurator for Laminas, Mezzio, ZF2, ZF3 and Zend Expressive applications

20238.6k7](/packages/elie29-zend-phpdi-config)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
