Skip to content

bearsunday/BEAR.Dotenv

Repository files navigation

BEAR.Dotenv

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ライブラリ以外の方法で用意されなければなりません。

About

Dotenv utility for BEAR.Sunday

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages