Files
admin/module/Application/src/Command/RunCommand.php
2025-09-13 01:22:15 +08:00

31 lines
843 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
*
* @authorllbjj
* @DateTime2024/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;
}
}