Download the PHP package zorac/php-di-migration without Composer

On this page you can find all versions of the php package zorac/php-di-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-di-migration

PHP-DI Migration

PHP version Latest release

Eases migration from PHP-DI 6 annotations to PHP-DI 7 attributes.

Rationale

PHP-DI 7 replaces the usage of PHPDoc @Inject and @Injectable annotations with native PHP 8 #[Inject] and #[Injectable] attributes. This is very much a change for the better, but all of your code needs to be updated at once, which can be difficult or dangerous across a large codebase with multiple contributors. This project provides a smoother migration path by supporting attributes alongside annotations while you migrate your code.

Warning

This code has not been extensively tested for all use cases and edge cases. Use at your own risk!

Usage

Install the migration package alongside PHP-DI 6:

Replace ContainerBuilder with MigrationContainerBuilder and enable annotations:

Commit and merge the changes, and you're ready to start migrating!

Over time, migrate your code from attributes to annotations, remembering to add strong PHP types anywhere you're currently relying on PHPDoc typing, and to remove any imports of DI\Annotation\Inject etc.

Once your code is all migrated, remove the useAnnotations(false) call from the container builder for final testing. If you missed any typing changes, this is when things will break.

Once you're happy with your fully migrated code, you can remove zorac/php-di-migration and upgrade to PHP-DI 7, switching back to using DI\ContainerBuilder. You may also be able to remove doctrine/annotations if you're not relying on it for anything else.

Congratulations! Your PHP-DI migration is complete.

Implementation Notes


All versions of php-di-migration with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
php-di/php-di Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zorac/php-di-migration contains the following files

Loading the files please wait ...