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

Đang mở
#715 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend, documentation, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
PHP
Star
44
Fork
22
Merge trung bình
2 giờ 57 phút
Pull request đã merge (30 ngày)
52

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quantum-php/framework

Tất cả issue của quantum-php/framework

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.