Environment: remove the shared/config/env.php fallback

未关闭
#715 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
php

调研方向

Read the environment selection logic in packages/environment/ and the tests that cover it, then check the 3.3 upgrade guide and changelog. Remove the shared/config/env.php fallback and its deprecation, preserving the stated --env, APP_ENV, then production order and .env file choice. Done means the listed behavior and tests match the issue, the core test fixture no longer contains tests/_root/shared/config/env.php, and the docs describe the new order.

由索引模型根据 Issue 内容生成。

描述

breaking change enhancement

Summary

#714 (3.2.0) chooses the environment from --env, then APP_ENV from the real environment, then app_env in shared/config/env.php, deprecated, then production. This ticket removes the deprecated fallback.

Proposed change

  • The environment name comes from the first of: --env=<name> on a php qt command, APP_ENV from the real environment, production.
  • shared/config/env.php is no longer read, and the deprecation from #714 is removed with it.
  • The file choice is unchanged: production → .env, any other name → .env.<name>.
  • No APP_ENV inside .env: the environment is chosen before a file is loaded. A developer's machine keeps its own .env (it is not committed), so local values need no separate environment name; .env.<name> files are for choosing between several environments on one machine, such as tests (APP_ENV=testing in phpunit.xml).

Breaking changes

An application that still chooses its environment in shared/config/env.php runs as production and loads .env, until it sets APP_ENV (or --env). Changelog BREAKING entry and an upgrade-guide note for 3.3, pointing to the deprecation logged since 3.2.0.

Tests

  • With env.php present and no --env / APP_ENV, the environment is production and the file is not read.
  • --env and APP_ENV work as in #714.
  • The core's tests no longer have tests/_root/shared/config/env.php.

Docs

packages/environment/ and the 3.3 upgrade guide: the order without env.php.

Depends on

#714

主要语言
PHP
星标
44
派生
22
平均合并
2 小时 57 分钟
30 天内合并 PR
52

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

quantum-php/framework 的其他 Issue

查看 quantum-php/framework 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

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