This is a php library that creates badges like and and , according to Shields specification.
This library is used by https://poser.pugx.org
$ composer create-project badges/poser ~0.1
$ ln -s poser/bin/poser /usr/local/bin/poser
Create an image
$ poser license MIT blue -p "license.svg"
Flush an image
$ poser license MIT blue
composer require badge/poser ~0.1
use PUGX\Poser\Render\SvgRender;
use PUGX\Poser\Poser;
$render = new SvgRender();
$poser = new Poser(array($render));
echo $poser->generate('license', 'MIT', '428F7E', 'svg');
// or
echo $poser->generateFromURI('license-MIT-428F7E.svg');
// or
$image = $poser->generate('license', 'MIT', '428F7E', 'svg');
echo $image->getFormat();
Dashes --
→ -
Dash
Underscores __
→ _
Underscore
_
or Space → Space
For more info please see the behat features and the examples in the php-spec folder
Active contribution and patches are very welcome. See the github issues. To keep things in shape we have quite a bunch of examples and features. If you're submitting pull requests please make sure that they are still passing and if you add functionality please take a look at the coverage as well it should be pretty high :)
- First fork or clone the repository
git clone git:https://github.com/badges/poser.git
cd poser
- Install vendors:
composer install
- Run specs:
./bin/phpspec run --format=pretty
- Then run behat:
./bin/behat run