-
Handling Composer "lock file out of date" Warning
22 January 2016
Read moreComposer is dependency management for PHP, and it consists of two main files:
composer.json where you specify your dependencies
composer.lock where composer itself records exactly which precise version of every library and every dependency of every library it picked, so all installs will be identical
Crucially, the composer.lock also includes a hash of the current composer.json when it updates, so you can always tell if you've added a requirement to the composer.json file and forgotten to install it.
-
Relying on A Dev-Master Dependency in Composer
22 December 2015
Read moreI recently tweeted this:
If your project installation instructions recommend requiring dev-master in composer, I may need to reconsider my choice of package
— Lorna Mitchell (@lornajane) December 2, 2015
-
Using Composer Without GitIgnoring Vendor/
11 March 2014
Read moreRecent additions to the joind.in API have introduced some new dependencies so we decided we'd start using Composer to manage these - but we don't want to run composer unsupervised. I'm sure this will bring the rain of "just run composer install, it's probably mostly almost safe" criticism, but actually it's quite tricky to run Composer without excluding vendor/ from source control so I thought I'd share how we did it so that anyone who wants to do so can learn from my experience!
-
Use a GitHub Branch as a Composer Dependency
18 February 2014
Read moreMy current project sees Celery (a python distributed task queue) added to my PHP application. There's a handy PHP interface to the RabbitMQ that Celery uses as a backend, which makes it easy for me to create jobs, called celery-php. This requires either the PECL AMQP extension or alternatively it has experimental support for the PHP library for AMQP - I would normally prefer the PECL version but ran into version compatibility problems, missing manual pages, and decided that a pure PHP solution might be more portable and perhaps I would just add the experimental branch to my composer.json file for this project.
-
Using Composer in an Existing Project
19 August 2013
Read moreI've got an application (okay, scratty PHP script) which glues together some API things and shows them onto a dashboard for me. Recently, I updated it to use Guzzle as the consuming client, since twitter now needs me to authenticate (I wrote about that if you're interested), and I used Composer to bring the new library in. It was very simple so I thought I'd share it as it's quite minimal example, and those are my favourite kind.