PHP code example of johnitvn / composer-runtime

1. Go to this page and download the library: Download johnitvn/composer-runtime 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/ */

    

johnitvn / composer-runtime example snippets


$process = new ComposerProcess('path\to\working_dir');
$process->runDisplayOutput('install');

$process = new ComposerProcess('path\to\working_dir');
$process->setCommand('php /path/to/composer.phar');
$process->runDisplayOutput('install');

// Run command whithout any output
process->run($params) 
// Run command and capture output to output reference variable
process->runCapture($params, array &$output) 
// Run command and display output directly
process->runDisplayOutput($params) 

process->run(['install','-v']) 
process->runCapture(['install','-v'],$output)
$process->runDisplayOutput(['install','-v']);

php composer.phar