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 摘要。