You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpdeclare(strict_types=1);
/** * This file is part of Kite. * * @link https://github.com/inhere/kite * @author https://github.com/inhere * @license MIT */namespaceInhere\Kite\Console\Command;
useInhere\Console\Command;
useInhere\Console\IO\Input;
useInhere\Console\IO\Output;
useToolkit\Stdlib\OS;
usefunctionis_scalar;
/** * Class DemoCommand */class EnvCommand extends Command
{
protectedstaticstring$name = 'env';
protectedstaticstring$desc = 'print system ENV information';
/** * print system ENV information * * @options * --format Format the env value * --match-value bool;Match ENV value by keywords. default is match key. * --split Split the env value by given char. eg ':' ',' * -s, --search The keywords for search ENV information * * @arguments * name The name in the ENV or keywords for search ENV keys * * @param Input $input * @param Output $output */protectedfunctionexecute(Input$input, Output$output)
{
$keywords = $this->flags->getOpt('search');
$name = $this->flags->getFirstArg();
if (!$name && !$keywords) {
// env | grep XXX$output->aList($_SERVER, 'ENV Information', ['ucFirst' => false]);
return;
}
$output->info("do something ...");
}
}