News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell:
Use a GitHub Branch as a Composer Dependency
February 19, 2014 @ 11:48:53

Lorna Mitchell has a quick post to her site today showing you how to use a GitHub branch as a Composer dependency when the need arrises for something other than master (or whatever branch is "stable" for the project).

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.

She includes an example of what the "composer.json" file would look like to pull this other branch. Two pieces of data have to be defined - the URL for the repository (to prevent Composer from trying to find it) and the branch name in the "require" section where the version would normally be.

0 comments voice your opinion now!
github repository branch composer dependency

Link: http://www.lornajane.net/posts/2014/use-a-github-branch-as-a-composer-dependency

blog comments powered by Disqus

Similar Posts

Jakub Zalas' Blog: Managing object creation in PHP with the Symfony2 Dependency Injection component

Kevin Schroeder's Blog: ZF2 Dependency Injection: Managing Configuration - Part 2

Phil Sturgeon: Composer: It's ALMOST Always About the Lock File

Henrik Bjørnskov's Blog: Travis & Composer sitting in a tree K-I-S-S-I-N-G

Gonzalo Ayuso: Auto injecting dependencies in PHP objects


Community Events





Don't see your event here?
Let us know!


library composer tool series community framework language interview opinion symfony introduction laravel version security podcast release update voicesoftheelephpant application package

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework