yiisoft/yii-runner-console
Composer 安装命令:
composer require yiisoft/yii-runner-console
包简介
Console application runner
README 文档
README
Yii Console Runner
The package contains a bootstrap for running Yii3 console application.
Requirements
- PHP 8.0 - 8.5.
Installation
The package could be installed with Composer:
composer require yiisoft/yii-runner-console
General usage
In your console entry script do the following:
#!/usr/bin/env php <?php declare(strict_types=1); use Yiisoft\Yii\Runner\Console\ConsoleApplicationRunner; require_once __DIR__ . '/autoload.php'; (new ConsoleApplicationRunner( rootPath: __DIR__, debug: $_ENV['YII_DEBUG'], checkEvents: $_ENV['YII_DEBUG'], environment: $_ENV['YII_ENV'] ))->run();
Additional configuration
By default, the ConsoleApplicationRunner is configured to work with Yii application templates and follows the
config groups convention.
You can override the default configuration using constructor parameters and immutable setters.
Constructor parameters
$rootPath — the absolute path to the project root.
$debug — whether the debug mode is enabled.
$checkEvents — whether check events' configuration.
$environment — the environment name.
$bootstrapGroup — the bootstrap configuration group name.
$eventsGroup — the events' configuration group name.
$diGroup — the container definitions' configuration group name.
$diProvidersGroup — the container providers' configuration group name.
$diDelegatesGroup — the container delegates' configuration group name.
$diTagsGroup — the container tags' configuration group name.
$paramsGroup — the config parameters group name.
$nestedParamsGroups — configuration group names that are included into config parameters group. This is needed for
recursive merge parameters.
$nestedEventsGroups — configuration group names that are included into events' configuration group. This is needed for
reverse and recursive merge events' configurations.
Immutable setters
If the configuration instance settings differ from the default you can specify a customized configuration instance:
/** * @var Yiisoft\Config\ConfigInterface $config * @var Yiisoft\Yii\Runner\Console\ConsoleApplicationRunner $runner */ $runner = $runner->withConfig($config);
The default container is Yiisoft\Di\Container. But you can specify any implementation
of the Psr\Container\ContainerInterface:
/** * @var Psr\Container\ContainerInterface $container * @var Yiisoft\Yii\Runner\Console\ConsoleApplicationRunner $runner */ $runner = $runner->withContainer($container);
Documentation
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii Console Runner is free software. It is released under the terms of the BSD License.
Please see LICENSE for more information.
Maintained by Yii Software.
Support the project
Follow updates
yiisoft/yii-runner-console 适用场景与选型建议
yiisoft/yii-runner-console 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 208.49k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2021 年 11 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「console」 「runner」 「yii」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yiisoft/yii-runner-console 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yiisoft/yii-runner-console 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yiisoft/yii-runner-console 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
Parallel runner extension for Behat
Simple task scheduler for Neos Flow Framework
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
统计信息
- 总下载量: 208.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 14
- 依赖项目数: 25
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-11-01