Choose the environment with APP_ENV instead of shared/config/env.php

オープン 初心者向け
#222 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php

調査の方向性

shared/config/env.php、tests/_root/shared/config/env.php、phpunit.xmlから始め、環境の選択方法に関する案内をプロジェクトのドキュメントで確認してください。非推奨の設定を削除し、PHPUnit用にAPP_ENVを設定して、APP_ENVまたは--envを使った環境の選択方法をドキュメントに記載してください。記載されたPHPUnitのチェックがすべて通り、ドキュメントからフレームワークガイドにリンクされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Summary

Framework 3.2.0 chooses the environment from --env or APP_ENV, and deprecates app_env in shared/config/env.php (quantum-php/framework#714). A new application created from this project should not log that deprecation, so the project moves to APP_ENV.

Proposed change

  • Remove shared/config/env.php. Without --env or APP_ENV, the framework uses production and loads .env, as the file does today.
  • Tests: remove tests/_root/shared/config/env.php and add <php><env name="APP_ENV" value="testing"/></php> to phpunit.xml, so the tests keep loading .env.testing.
  • Document how to choose another environment: APP_ENV from the server or container, or --env on php qt commands, with a link to the framework docs.

Tests

  • vendor/bin/phpunit loads .env.testing through APP_ENV from phpunit.xml, with no deprecation logged.
  • A request and a php qt command without APP_ENV run as production.

Depends on

quantum-php/framework#714, merged and released in framework 3.2.0; until then composer.json requires the framework's 3.2.*@dev.

主要言語
PHP
スター
50
フォーク
20
平均マージ
22分
マージ済み PR(30日)
6

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quantum-php/project のほかの issue

quantum-php/project の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。