wearesho-team / yii2-dotenv
Yii2 DotEnv File Support
1.3.5
2020-06-17 02:45 UTC
Requires
- php: >=7.4
- vlucas/phpdotenv: ^5.0
- yiisoft/yii2: ^2.0.35
Requires (Dev)
- phpunit/phpunit: ^9.2
- squizlabs/php_codesniffer: ^3.5
README
Yii2 Support for loading environment variables from DotEnv files using vlucas/phpdotenv. Required PHP >=7.4.
Installation
composer require wearesho-team/yii2-dotenv:^1.2
Usage
This package includes Bootstrap.
You need to prepend it to application bootstrap list:
<?php use Wearesho\Yii2\DotEnv; return [ 'id' => 'app', 'bootstrap' => [ DotEnv\Bootstrap::class, // ... other bootstraps ], 'components' => [ // ... components definitions ], ];
Environment Constants
You should set environment variables YII_ENV
and YII_DEBUG
.
It will be used to define Yii2 constants:
YII_ENV
(prod/dev/test), defaultdev
YII_DEBUG
(0/1), default1
(true)
See autoload file constants.php for details.