PHP code example of task / console

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


use Some\Application;
use Task\Plugin\Console\ApplicationPlugin;

$project->inject(function ($container) {
    $app = new Application;
    $container['app'] = new ApplicationPlugin($app)
});

$project->addTask('run', ['app', function ($app) {
    $app->command('run')
        ->setVerbose(true)
        ->pipe($this->getOutput());
}]);

[
    new InputOption('option', 'o', InputOption::VALUE_REQUIRED),
    new InputOption('flag', 'f', InputOption::VALUE_NONE),
    new InputArgument('arg', InputArgument::REQUIRED)
]