rquadling / 抽象控制台
此包的最新版本(v2.0.0)没有提供许可证信息。
抽象应用程序和命令,以及输入输出辅助工具,由RQuadling项目使用
v2.0.0
2020-06-29 18:42 UTC
Requires
- php: ^7.4
- rquadling/class-file-conversion: ^2.0
- rquadling/dependency-injection: ^2.0
- rquadling/environment: ^2.0
- rquadling/reflection: ^2.0
- symfony/console: ^5.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12
- phpstan/phpstan-phpunit: ^0.12
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2024-09-14 06:37:20 UTC
README
抽象应用程序和命令,以及输入输出辅助工具,由RQuadling项目使用
安装
使用Composer
composer require rquadling/abstract-console
依赖注入
将以下条目添加到您的 di.php
// Symfony Console Input wrapper to allow potential operation via a web based controller \Symfony\Component\Console\Input\InputInterface::class => function () { return new \RQuadling\Console\Input\Input(array_get($_SERVER, 'argv', [])); }, // Symfony Console Output wrapper to allow potential operation via a web based controller \Symfony\Component\Console\Output\OutputInterface::class => function (\Psr\Container\ContainerInterface $c) { return PHP_SAPI == 'cli' ? $c->get(\Symfony\Component\Console\Output\ConsoleOutput::class) : $c->get(\Symfony\Component\Console\Output\BufferedOutput::class); },
环境变量
COMMAND_DIRECTORY
- 定义命令的位置。COMMAND_NAMESPACE
- 定义命令的命名空间。