Choose the environment with APP_ENV instead of shared/config/env.php

未关闭 适合新手
#222 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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 内容生成。

描述

enhancement

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 --env or APP_ENV, the framework uses production and loads .env, as the file does today.
  • Tests: remove tests/_root/shared/config/env.php and add <php><env name="APP_ENV" value="testing"/></php> to phpunit.xml, so the tests keep loading .env.testing.
  • Document how to choose another environment: APP_ENV from the server or container, or --env on php qt commands, with a link to the framework docs.

Tests

  • vendor/bin/phpunit loads .env.testing through APP_ENV from phpunit.xml, with no deprecation logged.
  • A request and a php qt command without APP_ENV run as production.

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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quantum-php/project 的其他 Issue

查看 quantum-php/project 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。