orumad/lumen-config-cache
最新稳定版本:1.1.0
Composer 安装命令:
composer require orumad/lumen-config-cache
包简介
Adds the Laravel command `php artisan config:cache` to Lumen
关键字:
README 文档
README
Adds the Laravel artisan command config:cache to Lumen.
Once installed you can type php artisan lumen-config:cache in your console to gets all your Lumen configuration files loaded in the cache, which will increase your Lumen app response times.
Installation
This package can be used in Laravel 5.4 or higher with PHP 7.0 or higher.
You can install the package via composer:
composer require orumad/lumen-config-cache
Now register the service provider in bootstrap/app.php file:
$app->register(Orumad\ConfigCache\ServiceProviders\ConfigCacheServiceProvider::class);
If you want to publish automatically the config file, you must install a package like lumen-vendor-publish, which contains a single command that enables you to publish a package config file to the config folder of your Lumen application.
So you can publish the config file like in Laravel:
php artisan vendor:publish --tag="lumen-config-cache"
If you dedice to not install any aditional package, then you can copy the file vendor/orumad/lumen-config-cache/src/config/config-cache.php to your app config folder.
This is the contents of the published config/config-cache.php config file:
return [ /** * The name of the key where the config is stored in cache */ 'cache_key' => 'config_cache', /** * Expiration time for the config in cache */ 'cache_expiration_time' => 60*24, // One day /** * The config files (app, database, queue, etc.) to be cached * Add to this array whatever config files you want to load in cache */ 'config_files' => [ 'app', ], ];
You should enable the use of facades in Lumen uncommenting the following line in your bootstrap/app.php file:
// $app->withFacades();
Usage
You can access your config keys with ConfigCache::get facade method:
use Orumad\ConfigCache\Facades\ConfigCache; ... $api_url = ConfigCache::get('app.API_URL');
Also you can force the cached config to be refreshed with ConfigCache::refresh facade method:
use Orumad\ConfigCache\Facades\ConfigCache; ... ConfigCache::refresh();
You can use the artisan command lumen-config:cache to force the cached configuration to be refreshed too.
TIP: Add this command to your deployment script to be sure you have the last config cached after deploy your new app release:
php artisan lumen-config:cache
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email dev@danielmunoz.io instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
orumad/lumen-config-cache 适用场景与选型建议
orumad/lumen-config-cache 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 97.5k 次下载、GitHub Stars 达 11, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「lumen」 「orumad」 「lumen-config-cache」 「laravel-6-package」 「laravel-7-package」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 orumad/lumen-config-cache 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 orumad/lumen-config-cache 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 orumad/lumen-config-cache 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
Laravel validator for spanish stuff: NIF, NIE, CIF, NSS, IBAN, Postal Code, Phone numbers
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
Class to generate a standard structure for api json responses
Amqp classes
Audit changes of your Eloquent models in Laravel/Lumen
统计信息
- 总下载量: 97.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 未知