dev-master
9999999-dev https://github.com/Evozon-PHP/composer-utilitiesComposer utilities
MIT
The Requires
- php >=7.1
- composer-plugin-api ^1.1
- symfony/console ~2.6|~3.0
- symfony/property-access ^3.2
- symfony/filesystem ^3.3
- symfony/yaml ^3.3
Composer utilities
Different Composer utilities for various use cases., (*1)
composer require evozon-php/composer-utilities --dev
composer.json
When working on a monolith repository, you might have different .json
files., (*2)
In this case, there might one .json
file for development (i.e. dev.json
) which installs from local repositories and maybe also different releases. Another .json
file (i.e. composer.json
) would be used for installing packages from remote repositories and probably stable versions., (*3)
Add the following to your source .json
file:, (*4)
{ "config": { "composer-utilities": { "sync": { "ignore": { "nodes": [ "[require][vendorAbc/packageAbc]", "[require][vendorXyz/bundleXyz]", "[repositories]" ] } } } } }
All you need to do is to define the nodes you want to ignore during synchronization. Make sure you define them in PropertyAccess format., (*5)
The plugin will hook automatically to the post-install-cmd
and post-update-cmd
events and ask if you want to synchronize., (*6)
This will work only if you specifically use a custom .json
file:, (*7)
COMPOSER=dev.json composer install
There is also a custom command added when you want to manually trigger the synchronization process:, (*8)
composer sync:json --source dev.json --target composer.json
Useful when some parameters change in parameters.yml.dist
but updating them parameters.yml
is tedious. Usually it's the case with array parameters., (*9)
Add the following to your composer.json
file:, (*10)
{ "config": { "composer-utilities": { "parameters-update": { "file": "app/config/parameters.yml", "dist-file": "app/config/parameters.yml.dist", "parameters": [ "foo", "bar" ] } } } }
The plugin will hook automatically to the post-install-cmd
and post-update-cmd
events and ask if you want to update parameters., (*11)
composer install // or composer update
There is also a custom command added when you want to manually trigger parameters update process:, (*12)
``` composer parameters:update --source app/config/parameters.yml.dist --target app/config/parameters.yml, (*13)
Composer utilities
MIT