aoepeople/zettr
Composer 安装命令:
composer require aoepeople/zettr
包简介
Manage and apply settings (formerly known as EnvSettingsTool)
README 文档
README
Author: Fabrizio Branca
(formerly known as "EnvSettingsTool")
What's a "setting"?
A 'setting' is everything that's different from one environment to another. During the installation the project needs to be 'adapted' to the target environment you're deploying it to. These values can't be hardcoded and they also shouldn't have to be changed manually after the installation.
The classic (and obvious) settings are urls, database parameters, maybe cache backend settings and payment provider configuration (you're probably using a sandbox in all non-production environments).
But really there are a lot more settings that you might want to control via Zettr:
- Feature flags
- Cache prefixes
- Enabling/disabling modules
- Enabling/disabling stores
- Enabling/disabling users
- Available shipping methods
And even if some specific settings are the same for all of your environments you might want to consider adding them to your settings file in order to enforce them being in place every time you run the tool (every time you install a new build) or in order to roll out values for settings you're introducing in your codebase.
Warning
Settings that are controlled via Zettr can still be overwritten in Magento. Zettr doesn't "lock" those settings and the user will not even notice that this value is "remote controlled" and will be overwritten on the next deployment.
Best practice
Make sure there are no leftovers by deleting all values in all stores first
(Insert example for % % --delete--)
Commands
Usage:
zettr.phar apply [--dryRun] [--groups=GROUPS] [--excludeGroups=EXCLUDEGROUPS] <environment> <file1.csv> [<file2.csv>]
Example:
zettr.phar apply devbox ../Configuration/settings.csv
Root dir = CWD (or --rootDir)
apply
- apply
- usage...
File format
- fixed columns 1-4
- optional group
- optional default
also used to enforce settings via version control Settings injection Why csv?
- see values next to each other
used for Magento, but not restricted to
What's a handler?
fixed set of 3 param
- different meaning per handler special feature to make csv file more efficient
- loops
- variables
- reference other values
- fallbacks
- groups comments, ignore errors,... What's a handler?
- Generic ones
- Magento specific ones Shortcuts specifying a handler in the csv
How to specify a handler (1st column of the csv file):
- Zettr\Handler\Magento\CoreConfigData: Class name with namespace
- \Zettr\Handler\Magento\CoreConfigData: Leading backslash will be trimmed
- Magento\CoreConfigData: Class will be looked up in the Zettr\Handler namespace as a fallback
- Est_Handler_Magento_CoreConfigData: Legacy handler classes will be converted
How to
- include this in your projects
- composer
- add phar
- add settings file
- include in build script (point to magento deploy scripts)
- add a new handler
- build the phar
- import db first (chicken and egg problem)
- run unit tests
aoepeople/zettr 适用场景与选型建议
aoepeople/zettr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.86k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2015 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 aoepeople/zettr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aoepeople/zettr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-10-06