• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 10 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PHP badges library

PHP badges poser GitHub actions

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 Github actions Build PHP Version Require

Dependencies

  • PHP 7.4 or higher
  • GD extension

to use the library with lower php version use the tag v1.4

Use as command

1. Create a project

composer create-project badges/poser
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

Choose a different style

poser license MIT blue -s "for-the-badge"

Usage as library

1. Add to composer dependencies

composer require badges/poser

2. Use in your project as lib

use PUGX\Poser\Render\SvgPlasticRender;
use PUGX\Poser\Poser;

$render = new SvgPlasticRender();
$poser = new Poser([$render]);

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

echo $image->getStyle();

The allowed styles are: plastic, flat, flat-square, and for-the-badge.

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

Why a composer badge?

Not only because all the other languages already have it, but having the latest stable release in the readme could save time.

Contributing

Active contribution and patches are very welcome.
Please refer to CONTRIBUTING

License

License

More Repositories

1

shields

Concise, consistent, and legible badges in SVG and raster format
JavaScript
23,674
star
2

buckler

Go library and CLI for making Shields-style badges (PNG)
Go
299
star
3

stability-badges

A set of SVG badges to mark your modules with the Node stability index
JavaScript
251
star
4

awesome-badges

A curated collection of awesome things related to status badges
237
star
5

badgerbadgerbadger

Generate Github project badges like a boss
Ruby
183
star
6

gh-badges

Go to badges/shields. Especially if you don't know why. (This repo is old.)
JavaScript
86
star
7

pypipins

Badges for your site to display download totals, latest version using PyPI
Python
78
star
8

cocoapod-badges

Status badges to inform a pod's latest version and platform released on Cocoapods!
Python
74
star
9

svg-to-image-proxy

Web function to generate PNGs from SVGs
JavaScript
15
star
10

badgr.co

Badgr.co is going away. Please use Shields.
Python
11
star
11

squint

raster badge proxy that look okay if you squint enough πŸ˜†
Rust
10
star
12

shielded

Deprecated. Please use https://github.com/badges/shields instead.
JavaScript
8
star
13

ServerScript

A few niceties to help run the shields server.
Shell
7
star
14

img.shields.io-old

Dynamic image server for Shields.io.
Python
5
star
15

daily-tests

Daily tests for the Shields.io server
4
star
16

badges.github.io

Retina badges (SVG with PHP backend)
CSS
4
star
17

shield-server

http service for creating github shields ala https://github.com/olivierlacan/shields/
JavaScript
3
star
18

badger

A server that serves great lookin' status badges for Travis CI.
Ruby
1
star