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

Abierto
#715 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
PHP
Estrellas
44
Forks
22
Merge medio
2 h 57 min
PR fusionados (30 d)
52

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quantum-php/framework

Todos los issues de quantum-php/framework

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.