bamarni / composition
There is no license information available for the latest version (v1.0.0) of this package.
v1.0.0
2016-03-18 11:20 UTC
Requires
- php: >5.3.0
- composer/composer: 1.*@beta
Requires (Dev)
- doctrine/common: 2.3.*
This package is auto-updated.
Last update: 2024-07-05 23:00:41 UTC
README
Composition ![Build Status](https://camo.githubusercontent.com/1e4bb56a219304396731f6c62a23263521835b8b0b9e050a4026690e45fe938e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f636f6d706f736974696f6e2f636f6d706f736974696f6e2e706e67)
Composition provides a lightweight and generic API, that you can use to check your environment at runtime, instead of manually go checking for regex in constants, classes/functions existence, matching a version against a class constant, ...
It only works when using Composer as package management tool.
Some examples
A single command to check your PHP environment :
if (!\Composition::has('vendor/super-package', '>=2.0') { $this->markTestSkipped('The following tests require "SuperPackage" to be at least at 2.0'); } \Composition::has('php', '5.4.*'); \Composition::has('ext-mongo');
Check the platform :
if (\Composition::isWindows()) { // ... }
Note
This tool should mostly be used in your unit tests, and not be abused in production.