mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
change commands definition to attribute
This commit is contained in:
@@ -4,23 +4,21 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Command;
|
||||
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\ConsoleSectionOutput;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use ZM\Exception\InitException;
|
||||
|
||||
#[AsCommand(name: 'init', description: '初始化框架运行的基础文件')]
|
||||
class InitCommand extends Command
|
||||
{
|
||||
// the name of the command (the part after "bin/console")
|
||||
protected static $defaultName = 'init';
|
||||
|
||||
private string $base_path;
|
||||
|
||||
private bool $force = false;
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('初始化框架运行的基础文件');
|
||||
$this->setDefinition([
|
||||
new InputOption('force', 'f', InputOption::VALUE_NONE, '覆盖现有文件'),
|
||||
new InputOption('docker', null, InputOption::VALUE_NONE, '启用 Docker 支持'),
|
||||
|
||||
Reference in New Issue
Block a user