bear / dotenv
Dotenv utility for BEAR.Sunday
Installs: 100 954
Dependents: 4
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
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: 2024-10-26 06:42:28 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ライブラリ以外の方法で用意されなければなりません。