Lets get together to learn some tips and tricks about composer. We will start with a brief explanation of why composer and move into how to composer. Then finally discuss some composer tricks that most developers dont use on the daily, but none the less are very powerful.
5. Why use composer?
Generically
Has become the standard in PHP.
Smaller repository size.
Easier to update you packages.
Less overhead on a project.
With Drupal
Installing Drupal
Better module management
Use non-Drupal libraries
5
17. Forking a package to update it (trick #6)
http://bit.ly/2sun0wI
Fork the repo, make your changes, add you repository to your
composer.json, then change the package version and preface it
with “dev-”
17
Could include modules that configuration would need.
Pay attention to what you merge into you local git.
When passing this flag, composer will attempt to grab a dist version of the packages. This can speed up installs on build servers and other areas where you typically do not run updates of the vendors.
Will sort you packages by alpha numeric order.
Most heavily used are the caret and the asterisk
You can no use composer to execute scripts for anything you want.
Will update only your lock file.
This is something I do on my build servers to make sure composer is still intact when we actually need to build to the prod server.
Make sure when trying to update a package, you remember it might have dependencies as well so update those at the same time.
Even guys with weird hair like to stay up to date.
Now don’t forget to create you file and add your patches to it.
I like this way because it keeps your composer.json clean. A lot like the sorting config option.