update
This commit is contained in:
31
module/Application/src/Command/RunCommand.php
Normal file
31
module/Application/src/Command/RunCommand.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user