static-php-cli/src/SPC/ConsoleApplication.php

55 lines
1.4 KiB
PHP
Raw Normal View History

2023-03-15 20:40:49 +08:00
<?php
declare(strict_types=1);
namespace SPC;
2023-09-12 16:27:07 +02:00
use SPC\command\BuildCliCommand;
use SPC\command\BuildLibsCommand;
use SPC\command\dev\AllExtCommand;
use SPC\command\dev\PhpVerCommand;
use SPC\command\dev\SortConfigCommand;
use SPC\command\DoctorCommand;
use SPC\command\DownloadCommand;
use SPC\command\DumpLicenseCommand;
use SPC\command\ExtractCommand;
use SPC\command\MicroCombineCommand;
2023-03-15 20:40:49 +08:00
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\HelpCommand;
use Symfony\Component\Console\Command\ListCommand;
/**
* static-php-cli console app entry
2023-03-15 20:40:49 +08:00
*/
2023-09-12 16:27:07 +02:00
final class ConsoleApplication extends Application
2023-03-15 20:40:49 +08:00
{
2024-02-17 00:37:09 +08:00
public const VERSION = '2.1.0-beta.3';
2023-03-15 20:40:49 +08:00
public function __construct()
{
parent::__construct('static-php-cli', self::VERSION);
2023-09-12 16:27:07 +02:00
$this->addCommands(
[
new BuildCliCommand(),
new BuildLibsCommand(),
new DoctorCommand(),
new DownloadCommand(),
new DumpLicenseCommand(),
new ExtractCommand(),
new MicroCombineCommand(),
// Dev commands
new AllExtCommand(),
new PhpVerCommand(),
new SortConfigCommand(),
]
);
2023-03-15 20:40:49 +08:00
}
protected function getDefaultCommands(): array
{
return [new HelpCommand(), new ListCommand()];
}
}