PHP code example of smmccabe / accompanist

1. Go to this page and download the library: Download smmccabe/accompanist library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

smmccabe / accompanist example snippets


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');


use Accompanist\Accompanist;

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

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