bear / dotenv
Dotenv utility for BEAR.Sunday
Installs: 178 824
Dependents: 5
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/bear/dotenv
Requires
- php: ^7.3 || ^8.0
- vlucas/phpdotenv: ^5.1
Requires (Dev)
- doctrine/coding-standard: ^9.0
- phpmd/phpmd: ^2.10
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.15
- slevomat/coding-standard: ^7.0
- squizlabs/php_codesniffer: ^3.6
- vimeo/psalm: ^4.7
This package is auto-updated.
Last update: 2025-09-26 08:32:39 UTC
README
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ライブラリ以外の方法で用意されなければなりません。