laminas / laminas-migration
Migrate a Zend Framework project or third-party library to target Laminas/Expressive/Apigility
Fund package maintenance!
Community Bridge
Installs: 46 379
Dependents: 6
Suggesters: 0
Security: 0
Stars: 61
Watchers: 15
Forks: 9
Open Issues: 7
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0
- ext-json: *
- composer/semver: ^1.4 || ^2.0 || ^3.0
- laminas/laminas-zendframework-bridge: ^1.4.1
- symfony/console: ^3.4.17 || ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- laminas/laminas-coding-standard: ~2.4.0
- phpunit/phpunit: 9.5.26
- psalm/plugin-phpunit: ^0.18.0
- roave/security-advisories: dev-master
- vimeo/psalm: ^4.29.0
- 1.6.x-dev
- 1.5.x-dev
- 1.5.0
- 1.4.x-dev
- 1.4.0
- 1.3.x-dev
- 1.3.0
- 1.2.x-dev
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-renovate/all-minor-patch
- dev-renovate/major-laminas
- dev-renovate/lock-file-maintenance
- dev-renovate/symfony-console-7.x
- dev-renovate/phpunit-phpunit-11.x
This package is auto-updated.
Last update: 2024-11-21 19:48:43 UTC
README
π·πΊ Π ΡΡΡΠΊΠΈΠΌ Π³ΡΠ°ΠΆΠ΄Π°Π½Π°ΠΌ
ΠΡ, ΡΡΠ°ΡΡΠ½ΠΈΠΊΠΈ Laminas, ΡΠΎΠ΄ΠΈΠ»ΠΈΡΡ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² ΡΠ°Π·Π½ΡΡ ΡΡΡΠ°Π½Π°Ρ . Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ ΠΈΠ· Π½Π°Ρ Π΅ΡΡΡ Π΄ΡΡΠ·ΡΡ, ΡΠΎΠ΄ΡΡΠ²Π΅Π½Π½ΠΈΠΊΠΈ ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² Π ΠΎΡΡΠΈΠΈ, ΡΠ°ΠΊ ΠΈ Π² Π£ΠΊΡΠ°ΠΈΠ½Π΅. ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ· Π½Π°Ρ ΡΠΎΠ΄ΠΈΠ»ΠΈΡΡ Π² Π ΠΎΡΡΠΈΠΈ. ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ· Π½Π°Ρ ΠΆΠΈΠ²ΡΡ Π² Π ΠΎΡΡΠΈΠΈ. Π£ Π½Π΅ΠΊΠΎΡΠΎΡΡΡ Π±Π°Π±ΡΡΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡΡΠΊΠΈ ΡΡΠ°ΠΆΠ°Π»ΠΈΡΡ Ρ ΡΠ°ΡΠΈΡΡΠ°ΠΌΠΈ Π²ΠΎ ΠΡΠΎΡΠΎΠΉ ΠΌΠΈΡΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. ΠΠ΄Π΅ΡΡ Π½ΠΈΠΊΡΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅Ρ ΡΠ°ΡΠΈΠ·ΠΌ.
Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· Π½Π°Ρ Π΅ΡΡΡ ΡΠΊΡΠ°ΠΈΠ½ΡΠΊΠ°Ρ ΡΠΎΠ΄ΡΡΠ²Π΅Π½Π½ΠΈΡΠ°, ΠΊΠΎΡΠΎΡΠ°Ρ ΡΠΏΠ°ΡΠ»Π°ΡΡ ΠΈΠ· Π΄ΠΎΠΌΠ° Π²ΠΌΠ΅ΡΡΠ΅ Ρ ΡΡΠ½ΠΎΠΌ. ΠΠΎΠ΅Π·Π΄ Π·Π°Π΄Π΅ΡΠΆΠ°Π»ΡΡ ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡΠΎΠ³Π΅ Π²ΠΏΠ΅ΡΠ΅Π΄ΠΈ. Π£ Π½Π°Ρ Π΅ΡΡΡ Π΄ΡΡΠ·ΡΡ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΡΡΡΡΡΡΡ Π² Π±ΠΎΠΌΠ±ΠΎΡΠ±Π΅ΠΆΠΈΡΠ°Ρ . ΠΡ Ρ ΡΡΠ΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ Π²Π΅ΡΡΠΎΡΠΊΠΈ ΠΎΡ Π½ΠΈΡ ΠΏΠΎΡΠ»Π΅ Π²ΠΎΠ·Π΄ΡΡΠ½ΡΡ Π½Π°Π»Π΅ΡΠΎΠ², ΠΊΠΎΡΠΎΡΡΠ΅ Π±Π΅ΡΠΏΠΎΡΡΠ΄ΠΎΡΠ½ΠΎ Π½Π°Π½ΠΎΡΡΡ ΡΠ΄Π°ΡΡ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡΡ ΠΏΠΎ Π±ΠΎΠ»ΡΠ½ΠΈΡΠ°ΠΌ, ΡΠΊΠΎΠ»Π°ΠΌ, Π΄Π΅ΡΡΠΊΠΈΠΌ ΡΠ°Π΄Π°ΠΌ ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠΡ Π½Π΅ Π±Π΅ΡΠ΅ΠΌ ΡΡΠΎ ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ -Π»ΠΈΠ±ΠΎ Π‘ΠΠ. ΠΡ Π½Π°Π±Π»ΡΠ΄Π°Π΅ΠΌ ΡΡΠΎ Π½Π°ΠΏΡΡΠΌΡΡ.
ΠΡ Π΄ΠΎΠ²Π΅ΡΡΠ΅ΡΠ΅ Π½Π°ΠΌ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ, ΡΡΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Π½Π°ΡΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, ΠΈ ΠΌΡ ΠΏΡΠΎΡΠΈΠΌ Π²Π°Ρ Π΄ΠΎΠ²Π΅ΡΠΈΡΡΡΡ Π½Π°ΠΌ Π²Π½ΠΎΠ²Ρ. ΠΡ Π½ΡΠΆΠ΄Π°Π΅ΠΌΡΡ Π² ΠΏΠΎΠΌΠΎΡΠΈ. ΠΡΡ ΠΎΠ΄ΠΈΡΠ΅ ΠΈ ΠΏΡΠΎΡΠ΅ΡΡΡΠΉΡΠ΅ ΠΏΡΠΎΡΠΈΠ² ΡΡΠΎΠΉ Π±Π΅ΡΠΏΠΎΠ»Π΅Π·Π½ΠΎΠΉ Π²ΠΎΠΉΠ½Ρ. ΠΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ ΠΊΡΠΎΠ²ΠΎΠΏΡΠΎΠ»ΠΈΡΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡΠ΅ "ΠΠ΅Ρ Π²ΠΎΠΉΠ½Π΅!"
πΊπΈ To Citizens of Russia
We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"
Migrate a Zend Framework project or third-party library to target Laminas, Expressive, and/or Apigility.
This tool will migrate:
- Zend Framework MVC projects, all v2 and v3 releases.
- Apigility projects, all versions
- Expressive versions, all versions
For more details, please read the documentation and FAQ.
Installation
Via Composer
Install the library globally using Composer:
$ composer global require laminas/laminas-migration
Via cloning
Clone the repository somewhere:
$ git clone https://github.com/laminas/laminas-migration.git
Install dependencies:
$ cd laminas-migration
$ composer install
From there, either add the bin/
directory to your $PATH
, symlink the
bin/laminas-migration
script to a directory in your $PATH
, or create an
alias to the bin/laminas-migration
script using your shell:
# Adding to PATH: $ export PATH=/path/to/laminas-migration/bin:$PATH # Symlinking to a directory in your PATH: $ cd $HOME/bin && ln -s /path/to/laminas-migration/bin/laminas-migration . # creating an alias: $ alias laminas-migration=/path/to/laminas-migration/bin/laminas-migration
Usage
Migrating a library or project
To migrate a library or project to Laminas, use the migrate
command:
$ laminas-migration migrate [--no-plugin] [--exclude=|-e=] [--keep-locked-versions] [path]
where:
-
[path]
is the path to the project you want to migrate; if omitted, the command assumes the current working directory. -
[--no-plugin]
can be specified to omit adding the Composer plugin laminas/laminas-dependency-plugin to your library or project. We do not recommend using this option; the plugin ensures that any nested dependencies on Zend Framework packages will instead install the Laminas variants. There are very few cases where this behavior is not desired. -
[--exclude=|-e=]
can be used multiple times to specify directories to omit from the migration. Examples might include yourdata/
orcache/
directories. -
[--keep-locked-versions]
will synchronize yourcomposer.json
with thecomposer.lock
packages before the migration starts. This will ensure that your projects stays on the same versions even after deleting the lock-file. Thus, after runningcomposer install
(after the migration finished, you can manually re-configure yourcomposer.json
again by using a diff-tool) and updating thecomposer.lock
by just usingcomposer update --lock
. This wont trigger any update but refreshes thecomposer.lock
to be back in sync with thecomposer.json
again. Please note that we encourage to upgrade to the latest versions to avoid unexpected issues. If you experiencing issues after migration while using this flag we cannot offer support.
When done, you can check to see what files were changed, and examine the
composer.json
. Run composer install
to install dependencies, and then test
your application.
Forcing nested dependencies to resolve to Laminas packages
If you use the --no-plugin
option to the migrate
command, you can migrate
nested dependencies manually using the nested-deps
command:
$ laminas-migration nested-deps [path] [--composer=composer]
where:
-
[path]
is the path to the project for which you want to perform the operation; if omitted, the command assumes the current working directory. -
--composer
allows you to provide a custom path to thecomposer
binary.
This will be a one-off operation. If you add dependencies later, or perform a
composer update
, you may need to re-run it.