Choose the environment with APP_ENV instead of shared/config/env.php
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- php
调研方向
从 shared/config/env.php、tests/_root/shared/config/env.php 和 phpunit.xml 开始,然后查看项目文档中有关环境选择的说明。移除已弃用的配置,为 PHPUnit 设置 APP_ENV,并记录如何使用 APP_ENV 或 --env 选择环境。列出的 PHPUnit 检查全部通过且文档链接到框架指南时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
Framework 3.2.0 chooses the environment from --env or APP_ENV, and deprecates app_env in shared/config/env.php (quantum-php/framework#714). A new application created from this project should not log that deprecation, so the project moves to APP_ENV.
Proposed change
- Remove
shared/config/env.php. Without--envorAPP_ENV, the framework usesproductionand loads.env, as the file does today. - Tests: remove
tests/_root/shared/config/env.phpand add<php><env name="APP_ENV" value="testing"/></php>tophpunit.xml, so the tests keep loading.env.testing. - Document how to choose another environment:
APP_ENVfrom the server or container, or--envonphp qtcommands, with a link to the framework docs.
Tests
vendor/bin/phpunitloads.env.testingthroughAPP_ENVfromphpunit.xml, with no deprecation logged.- A request and a
php qtcommand withoutAPP_ENVrun asproduction.
Depends on
quantum-php/framework#714, merged and released in framework 3.2.0; until then composer.json requires the framework's 3.2.*@dev.
- 主要语言
- PHP
- 星标
- 50
- 派生
- 20
- 平均合并
- 22 分钟
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quantum-php/project 的其他 Issue
-
feature
难度 5/5 一周以上 新手友好度 35/100
quantum-php/project#215 ·
-
demo good first issue templates
难度 5/5 一周以上 新手友好度 45/100
quantum-php/project#195 ·
查看 quantum-php/project 的全部 Issue
相似的 Issue
-
support
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
15.0
难度 2/5 1-3 小时 新手友好度 66/100
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
mailcow/mailcow-dockerized#7717 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
mage-os/devdocs-website#75 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
mollie/WooCommerce#1346 ·