PHP code example of efrane / console-additions
1. Go to this page and download the library: Download efrane/console-additions 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/ */
efrane / console-additions example snippets
\EFrane\ConsoleAdditions\Command\Batch::create($this->getApplication(), $output)
->add('my:command --with-option')
->add('my:other:command for-this-input')
->run();
class Command extends \Symfony\Component\Console\Command {
public function execute(InputInterface $input, OutputInterface $output) {
// send output to multiple destinations
$output = new \EFrane\ConsoleAdditions\Output\MultiplexedOutput([
$output,
new \EFrane\ConsoleAdditions\Output\NativeFileOutput('command.log')
]);
// normal console command
}
}