Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 571 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 571 Bytes

Accompanist

A simple PHP API for generating composer files

Examples

Basic

use Accompanist\Accompanist;

$accompanist = new Accompanist('Sample Composer File');

$accompanist->addRequire('monolog/monolog');
$accompanist->addRequire('guzzlehttp/guzzle', '^6.3');

$composerJSONString = $accompanist->generateJSON();
// or
$accompanist->writeToFile('output/composer.json');

Load from existing

use Accompanist\Accompanist;

$accompanist = new Accompanist('Imported Composer File');

$accompanist->loadFromFile('import/composer.json');