gianfriaur/package-loader
Composer 安装命令:
composer require gianfriaur/package-loader
包简介
Laravel Package management
README 文档
README
just another package manager for laravel nothing more and nothing less
but if you want to use it you are welcome
Goal
In an ideal world we will all be the standard,
But it's also true that if there were a standard, our project wouldn't be the only one, wouldn't it?
Starting from this we can say that it is not always possible to make things according to the existing standard, or simply for the 'company' logic this is not possible
The purpose of this library is to provide a tool without forcing you to necessarily follow the rules decided at the start, if you want you can write your own logic if necessary and expect that nothing will 'break'
Also, because you can't think about what you need before you need it 😉
Install
Require package
composer require gianfriaur/package-loader
Publish configuration file
php artisan vendor:publish --provider="Gianfriaur\PackageLoader\PackageLoaderServiceProvider"
First setup
- TODO:DOC: package in directory + json file retrieve method
- TODO:DOC: package in vendor + json file retrieve method
Tips
- If it is useful you can manage the migrations of your packages in a parallel way from those of laravel TODO:DOC: configure vault migration_strategy
Documentation
You can find the full documentation at this location
Stress Tests 😍
I have tried to reduce loading times to reasonably low times
obtaining good results
- Load 10 packages : ~2 milliseconds
- Load 100 packages : ~10 milliseconds
- Load 1000 packages : ~400 milliseconds
you can find the stress test in this test: tests/Stress/StressTest.php
Why use LocalizationStrategy
Since PackageProvider extends ServiceProvider we can wonder why it has been given the possibility
to use a strategy specifically to load translations instead of using directly $this->loadTranslationsFrom($path,$namespace);
There is a very simple answer to this legitimate question, if for each PackageProvider it is necessary
to individually register a callback to the afterResolving and check if the 'translator' service has
been resolved and then load the translations, this as the packages increase can cause a drop in performance.
Yes it is true of just ~50 milliseconds for 100 packets
With the DefaultLocalizationStrategy Service this is done only once leaving only the time to read the files
But hey, there is, using it costs you nothing, but you save some time in requests
In the future there will be a command that will be loaded by the strategy that will allow you in production to collapse all the translation files of all the packages into a single one so that I could further reduce the times for loading all the translation files
Next releases
-
1.1.x
- Configuration
- New strategy
JsonConfigurationStrategyService - New strategy
JollyConfigurationStrategyService
- New strategy
- New Features
- New kind of strategy
ViewStrategyService
- New kind of strategy
- Configuration
-
1.2.x
- Localization
- Production Compress Localization Command
- Configuration
- New strategy
DatabaseConfigurationStrategyService
- New strategy
- Localization
-
1.3.x
- Configuration
- Production Compress Configuration Command
- Configuration
gianfriaur/package-loader 适用场景与选型建议
gianfriaur/package-loader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 03 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「manager」 「module」 「modules」 「loader」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gianfriaur/package-loader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gianfriaur/package-loader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gianfriaur/package-loader 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
Simple ASCII output of array data
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
KCFinder web file manager
Publish / Subscribe / Event Manager
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-08