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

79 lines
2.3 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\BuildLibsCommand;
use SPC\command\BuildPHPCommand;
use SPC\command\CraftCommand;
2024-02-18 13:54:06 +08:00
use SPC\command\DeleteDownloadCommand;
2023-09-12 16:27:07 +02:00
use SPC\command\dev\AllExtCommand;
use SPC\command\dev\EnvCommand;
use SPC\command\dev\ExtVerCommand;
use SPC\command\dev\GenerateExtDepDocsCommand;
2024-05-29 13:53:08 +08:00
use SPC\command\dev\GenerateExtDocCommand;
use SPC\command\dev\GenerateLibDepDocsCommand;
use SPC\command\dev\LibVerCommand;
2024-07-07 20:45:18 +08:00
use SPC\command\dev\PackLibCommand;
2023-09-12 16:27:07 +02:00
use SPC\command\dev\PhpVerCommand;
use SPC\command\dev\SortConfigCommand;
use SPC\command\DoctorCommand;
use SPC\command\DownloadCommand;
use SPC\command\DumpExtensionsCommand;
2023-09-12 16:27:07 +02:00
use SPC\command\DumpLicenseCommand;
use SPC\command\ExtractCommand;
2024-02-18 13:54:06 +08:00
use SPC\command\InstallPkgCommand;
2023-09-12 16:27:07 +02:00
use SPC\command\MicroCombineCommand;
2024-12-10 23:09:00 +08:00
use SPC\command\SPCConfigCommand;
use SPC\command\SwitchPhpVersionCommand;
2023-03-15 20:40:49 +08:00
use Symfony\Component\Console\Application;
/**
* 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
{
2025-08-06 20:48:30 +08:00
public const string VERSION = '2.7.2';
2023-03-15 20:40:49 +08:00
public function __construct()
{
parent::__construct('static-php-cli', self::VERSION);
2024-10-01 15:37:37 +08:00
// Define internal env vars and constants
require_once ROOT_DIR . '/src/globals/internal-env.php';
2023-09-12 16:27:07 +02:00
$this->addCommands(
[
// Craft command
new CraftCommand(),
2024-03-31 15:36:38 +08:00
// Common commands
new BuildPHPCommand(),
2023-09-12 16:27:07 +02:00
new BuildLibsCommand(),
new DoctorCommand(),
new DownloadCommand(),
2024-02-18 13:54:06 +08:00
new InstallPkgCommand(),
new DeleteDownloadCommand(),
2023-09-12 16:27:07 +02:00
new DumpLicenseCommand(),
new ExtractCommand(),
new MicroCombineCommand(),
new SwitchPhpVersionCommand(),
2024-12-10 23:09:00 +08:00
new SPCConfigCommand(),
new DumpExtensionsCommand(),
2023-09-12 16:27:07 +02:00
// Dev commands
new AllExtCommand(),
new PhpVerCommand(),
new LibVerCommand(),
new ExtVerCommand(),
2023-09-12 16:27:07 +02:00
new SortConfigCommand(),
2024-05-29 13:53:08 +08:00
new GenerateExtDocCommand(),
new GenerateExtDepDocsCommand(),
new GenerateLibDepDocsCommand(),
2024-07-07 20:45:18 +08:00
new PackLibCommand(),
new EnvCommand(),
2023-09-12 16:27:07 +02:00
]
);
2023-03-15 20:40:49 +08:00
}
}