PHP code example of lesser-evil / shell-verbosity-is-evil
1. Go to this page and download the library: Download lesser-evil/shell-verbosity-is-evil 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/ */
lesser-evil / shell-verbosity-is-evil example snippets
class SnafuCommand extends Command {
public function execute(...) {
shell_exec('find_data | filter_data > /tmp/my_data.json');
$data = json_decode(file_get_contents('/tmp/my_data.json'));
}
}
use LesserEvil\ShellVerbosityIsEvil;
class MyApplication extends Application {
protected function configureIO(InputInterface $input, OutputInterface $output) {
ShellVerbosityIsEvil::doWithoutEvil(function() use ($input, $output) {
parent::configureIO($input, $output);
});
}
}