31 lines
843 B
PHP
31 lines
843 B
PHP
<?php
|
||
/**
|
||
*
|
||
* @author:llbjj
|
||
* @DateTime:2024/3/29 15:12
|
||
* @Description:
|
||
*
|
||
*/
|
||
|
||
namespace Application\Command;
|
||
|
||
use Symfony\Component\Console\Input\InputInterface;
|
||
use Symfony\Component\Console\Input\InputOption;
|
||
use Symfony\Component\Console\Output\OutputInterface;
|
||
|
||
class RunCommand extends BasicCommand
|
||
{
|
||
protected static string $commandName = 'Run:Server';
|
||
protected function configure()
|
||
{
|
||
$this->setName(self::$commandName);
|
||
$this->addOption('sv', null, InputOption::VALUE_REQUIRED, 'Server Name');
|
||
$this->addOption('method', null, InputOption::VALUE_REQUIRED, 'Server Method');
|
||
}
|
||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||
{
|
||
$this->LocalService()->{$input->getOption('sv')}->{$input->getOption('method')}();
|
||
return 0;
|
||
}
|
||
} |