xiidea/easy-config
Composer 安装命令:
composer require xiidea/easy-config
包简介
A Symfony Bundle for easy configuration management
README 文档
README
A Symfony Bundle for easy configuration management.
Features Include
- Group wise dynamic form creation ability
- Store global configuration
- Store user wise configuration
- Get configuration through rest API
Install
- Download and Enable EasyConfigBundle
- Create Config entity class
- Configure yaml file
- Update database schema
- Create your first form
- Register the bundle’s routes
- Overriding default EasyConfigBundle templates (optional)
1. Download and Enable EasyConfigBundle :
Download through composer :
Open a command console, enter project directory and execute the following command to download the latest stable version of this bundle:
$ composer require xiidea/easy-config
Enable Bundle (No need when Flex is available):
The bundle should be automatically enabled by Symfony Flex. If you don't use Flex, you will need to enable the bundle manually by adding the following line in the config/bundles.php file of your project:
<?php // src/Kernel.php return [ // ... Xiidea\EasyConfigBundle\XiideaEasyConfigBundle::class => ['all' => true], ];
2. Create Config entity class:
By default EasyConfigBundle supports Doctrine ORM. However, you must provide an Entity class and the class has to extend the class \Xiidea\EasyConfigBundle\Model\BaseConfig. To configure the Entity class properly please follow the detailed instructions.
3. Configure yaml file:
Create a file in the following directory config/packages with the exact name xiidea_easy_config.yaml
A sample config file is available in this path Resources/config/config-sample.yml. Copy this sample file's content and paste to just created file. Do not forget to change your Entity class name which has been mentioned in Step 3.
# Xiidea Easy Config Configuration Sample xiidea_easy_config: config_class: App\Entity\Configuration
4. Update database schema:
It’s time to set up the database schema, open your command console, go to your project root path and execute the following command.
$ php bin/console doctrine:schema:update --force
5. Create form group and type:
Create a form group class and form type with your necessary fields. Please follow the instructions to create the form group and type.
6. Register the bundle’s routes:
Now it's time to access the form you have just created, for that you have to include bundle's routes to your application by the following way.
xiidea_config_route: resource: "@XiideaEasyConfigBundle/Resources/config/routes.yaml" prefix: '/config'
Note: You may change the prefix as your wish
Following routes are available in this bundle:
- Index route
(prefix/): List of all forms - Form group route
(prefix/group_key): Form of specific group key
7. Overriding default EasyConfigBundle templates (optional)
Template overriding is not important to use EasyConfigBundle bundle but if you want to keep UI as similar as your application you can override the template, to do so follow the instructions
Congratulations !
Your application is ready to store configurations, just browse the routes.
License
The Easy Config Bundle is licensed under the MIT license. See the LICENSE file for more details.
xiidea/easy-config 适用场景与选型建议
xiidea/easy-config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 754 次下载、GitHub Stars 达 6, 最近一次更新时间为 2024 年 07 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「configuration」 「config」 「Settings」 「settings-bundle」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xiidea/easy-config 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xiidea/easy-config 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xiidea/easy-config 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Persistent settings package for Laravel framework.
Configuration component
A Zend Framework module to quickly and easily set PHP settings.
Settings Card for Laravel Nova.
Utils to load, parse and work with configuration on Mezzio projects
Extends basic Wordpress features.
统计信息
- 总下载量: 754
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-25