Use a GitHub Branch as a Composer Dependency

Posted by Unknown on Tuesday, February 18, 2014

My 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.


The branch is called php-amqplib, and I need to do two things:



  • Add the Github repository for celery-php to the composer.json, so that it will be picked up rather than Composer looking on packagist for it.

  • Specify the version as dev-[branchname]


The result looks like this:




{
"repositories": [
{
"type": "git",
"url": "https://github.com/gjedeer/celery-php"
}
],
"require": {
"videlalvaro/php-amqplib": "2.2.*",
"massivescale/celery-php": "dev-php-amqplib"
}
}

Lorna is an independent web development consultant, author and trainer, available for work (interesting projects only). This post was originally published at LornaJane




more

{ 0 comments... » Use a GitHub Branch as a Composer Dependency read them below or add one }

Post a Comment

Popular Posts