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

Aperta
#715 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
PHP
Stelle
44
Fork
22
Merge medio
2h 57m
PR unite (30g)
52

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quantum-php/framework

Tutte le issue di quantum-php/framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.