https://github.com/bamarni/composition
  
  
    Check your Composer dependencies at runtime. 
    https://github.com/bamarni/composition
  
        Last synced: 6 months ago 
        JSON representation
    
Check your Composer dependencies at runtime.
- Host: GitHub
 - URL: https://github.com/bamarni/composition
 - Owner: bamarni
 - Created: 2012-08-25T09:22:42.000Z (about 13 years ago)
 - Default Branch: master
 - Last Pushed: 2016-03-18T11:25:41.000Z (over 9 years ago)
 - Last Synced: 2025-04-08T19:22:06.630Z (7 months ago)
 - Language: PHP
 - Homepage:
 - Size: 8.79 KB
 - Stars: 105
 - Watchers: 8
 - Forks: 4
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-composer - Composer-Composition - Provides an API, for checking your environment at runtime. (Plugins / Support)
 
README
          # Composition [](https://secure.travis-ci.org/composition/composition)
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 :
``` php
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 :
``` php
if (\Composition::isWindows()) {
// ...
}
```
## Note
This tool should mostly be used in your unit tests, and not be abused in production.