Git Product home page Git Product logo

poser's Introduction

PHP badges poser

This is a php library that creates badges like Badge Poser and I'm a badge and dark, according to Shields specification.

This library is used by https://poser.pugx.org

Latest Stable Version Latest Unstable Version Total Downloads Build Status

Dependencies

  • PHP 5.3 or higher
  • GD extension

Use as command

1. Create a project

$ composer create-project badges/poser ~1.2
$ ln -s poser/bin/poser /usr/local/bin/poser

2. Launch the command

Create an image

$ poser license MIT blue -p "license.svg"

Flush an image

$ poser license MIT blue

Usage as library

1. Add to composer

composer require badges/poser ~1.2

2. Use in your project as lib

    use PUGX\Poser\Render\SvgRender;
    use PUGX\Poser\Poser;

    $render = new SvgRender();
    $poser = new Poser(array($render));

    echo $poser->generate('license', 'MIT', '428F7E', 'plastic');
    // or
    echo $poser->generateFromURI('license-MIT-428F7E.plastic');
    // or
    $image = $poser->generate('license', 'MIT', '428F7E', 'plastic');

    echo $image->getFormat();

Encoding

Dashes --- Dash

Underscores ___ Underscore

_ or Space → Space

More

For more info please see the behat features and the examples in the php-spec folder

Contribution

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://github.com/badges/poser.git
cd poser
  • Install vendors:
composer install
  • Run specs:
./bin/phpspec run --format=pretty
  • Then run behat:
./bin/behat

Using Docker

We provide a docker-compose.yml.dist file to allow you to run tests in a Docker container.

cp docker-compose.yml.dist docker-compose.yml
docker-compose up -d
docker-compose exec fpm composer update
docker-compose exec fpm bin/phpspec run --format=pretty
docker-compose exec fpm bin/behat

The provided Docker compose file is for a PHP 7.1 environment, but you can modifiy it to use PHP 5.6.

See https://store.docker.com/community/images/jmleroux/fpm/tags

License

License

poser's People

Contributors

fefas avatar garak avatar haehnchen avatar jean85 avatar jmleroux avatar liuggio avatar maximkott avatar peterdavehello avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.