orchestra/config
Composer 安装命令:
composer require orchestra/config
包简介
Configuration Component for Laravel and Orchestra Platform
README 文档
README
Config Component is a configuration with environment based support for Laravel 5 and above. The component is actually based from Laravel 4 configuration.
Table of Content
Version Compatibility
| Laravel | Config |
|---|---|
| 5.5.x | 3.5.x |
| 5.6.x. | 3.6.x |
| 5.7.x. | 3.7.x |
| 5.8.x | 3.8.x |
| 6.x | 4.x |
| 7.x | 5.x |
Installation
To install through composer, run the following command from terminal:
composer require "orchestra/config"
Configuration
To swap Laravel 5 default configuration, all you need to do is add the following code to bootstrap/app.php:
$app->singleton( Illuminate\Foundation\Bootstrap\LoadConfiguration::class, Orchestra\Config\Bootstrap\LoadConfiguration::class );
Configuration Caching Support
Config Component also bring an enhanced php artisan config:cache support to speed up configuration loading, some features include:
- Caching packages/namespaced config instead of just application
configdirectory. - Enforcing lazy loaded packages config by including list of packages config key in
compile.config.
In order to do this you need to replace Illuminate\Foundation\Provider\ArtisanServiceProvider with a new App\Providers\ArtisanServiceProvider:
<?php namespace App\Providers; use Orchestra\Config\Console\ConfigCacheCommand; use Illuminate\Foundation\Providers\ArtisanServiceProvider as ServiceProvider; class ArtisanServiceProvider extends ServiceProvider { /** * Register the command. * * @return void */ protected function registerConfigCacheCommand() { $this->app->singleton('command.config.cache', function ($app) { return new ConfigCacheCommand($app['files']); }); } }
Don't forget to update your
config/app.phpto replacesIlluminate\Foundation\Provider\ArtisanServiceProviderwithApp\Providers\ArtisanServiceProvider.
Caching lazy loaded packages file
In order to force certain packages to be included in config caching, you can specify either the relative key of desired packages in your config/compile.php file:
<?php return [ // ... 'config' => [ 'orchestra/foundation::config', // if package config is group under "config/config.php" 'orchestra/foundation::roles', // Using one of the key available in "config/config.php" 'orchestra/html::form', // When package contain "config/form.php" ], ];
orchestra/config 适用场景与选型建议
orchestra/config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.07k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2014 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「configuration」 「laravel」 「orchestra-platform」 「orchestral」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 orchestra/config 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 orchestra/config 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 orchestra/config 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Asset Component for Orchestra Platform
Orchestra Platform Foundation
Configuration component
Orchestra Platform
CMS Extension for Orchestra Platform
Contracts for Orchestra Platform
统计信息
- 总下载量: 9.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 17
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-09