bear/dotenv

Dotenv utility for BEAR.Sunday

1.1.0 2021-05-09 07:57 UTC

This package is auto-updated.

Last update: 2024-03-26 05:34:49 UTC


README

Scrutinizer Code Quality Build Status Build Status

Loads environment variables from .env to $_ENV and $_SERVER.

Installation

Installation is via Composer:

composer require bear/dotenv

Usage

use BEAR\Dotenv\Dotenv;

(new Dotenv)->load($dir);

If the .env.dist file exists in the $dir directory, environment variables are created from it. If you customize locally, the .env file is loaded first. If neither file is present, nothing is done. In that case, the environment variables must be provided by means other than the dotenv library.

.env.dist$dirディレクトリにあれば読み込まれ環境変数が作られます。ローカルでカスタマイズする場合には.envを用意すれば優先して読み込まれます。 どちらのファイルも無ければ何もしません。その場合、環境変数はdotenvライブラリ以外の方法で用意されなければなりません。