Download the PHP package badges/poser without Composer
On this page you can find all versions of the php package badges/poser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package poser
PHP badges poser 
This is a php library that creates badges like and
and
,
according to Shields specification.
This library is used by https://poser.pugx.org
Dependencies
- PHP 8.1 or higher
- GD extension
You can still use the library with lower PHP versions by using the old releases
Use as a command
1. Create a project
2. Launch the command
Create an image
Flush an image
Choose a different style
The available styles are plastic, flat, flat-square, for-the-badge, and social.
You can also use the provided Docker Compose services:
Usage as library
1. Add to composer dependencies
2. Use in your project as a lib
The allowed styles are: plastic, flat, flat-square, for-the-badge, and social.
Badge customization
Badges generated from a URI support these query string options:
| Option | Description |
|---|---|
style |
Badge style: plastic, flat, flat-square, for-the-badge, or social. |
labelColor |
Color for the left side of the badge. Accepts named colors, 6-digit hex, or 3-digit hex. |
logo |
Optional logo as an image URL, data:image/... URI, or SVG path data. |
logoColor |
Color used when logo is SVG path data. Defaults to white. Accepts named colors, 6-digit hex, or 3-digit hex. |
Examples:
When these options are used in a URL, encode reserved characters. In particular, encode # as %23, and encode full image/data URLs passed as logo.
The CLI currently exposes style selection with --style; labelColor, logo, and logoColor are available through URI-based generation.
Custom SVG templates
Since v3.4.0, SVG templates use vendorStartX and valueStartX instead of the old vendorStartPosition and valueStartPosition placeholders. If you maintain custom templates, update them before upgrading:
These values are the text center positions multiplied by 10 and are intended to be used with transform="scale(.1)", as the bundled templates do.
The renderer also provides these optional template placeholders: vendorUpper, valueUpper, vendorTextLength, valueTextLength, vendorWidthMinus1, valueWidthMinus1, valueRectX, separatorX, and logoElement.
Examples (generated with make doc-images)
Encoding
Dashes -- → - Dash
Underscores __ → _ Underscore
_ or Space → Space
More
For more info please see the behat features
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
Docker development
You can use the env var CONTAINER to run the tests in a specific PHP version. The default version if CONTAINER is omitted is php85.
1. Set up your Docker environment
2. Run the tests
3. Run the tests for all PHP versions
License
All versions of poser with dependencies
ext-gd Version *
ext-simplexml Version *
cybercog/php-svg-font Version ^1.0
kartsims/easysvg Version ^2.5
symfony/console Version ^5.0 || ^6.0 || ^7.0 || ^8.0