PHP code example of task / process

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

    

task / process example snippets


use Task\Plugin\ProcessPlugin;

$project->inject(function ($container) {
    $container['ps'] = new ProcessPlugin;
});

$project->addTask('whoami', ['ps', function ($ps) {
    $ps->run('whoami')->pipe($this->getOutput());
}]);

run($command, array $args = [], $cwd = null, array $env = [], OutputInterface $output = null)

run('whoami');

run('ls', ['-la']);

run('du', ['-hs'], '/path/to/my/project');

run('myscript', [], null, ['DEBUG' => 1]);

build($command, array $args = [])