garkavenkov/dotenv
最新稳定版本:v2.0.1
Composer 安装命令:
composer require garkavenkov/dotenv
包简介
Register environments variable from .env
README 文档
README
Dotenv - Registers environment variables from a .env file
Getting Started
Use Composer
$ composer require garkavenkov/dotenv
or add it by hand to your composer.json file.
Usage
Initialization
<?php require('./vendor/autoload.php'); use Dotenv\Dotenv; ... Dotenv::load(path_to_file: dirname(__DIR__)); ...
In this case environment variables load from ./env file in root foolder of your application.
If you need to separate envorinment variables for different mode, you can create different file, for example .env.development.
.env
.env.development
Then set environment variable with respective mode.
APP_ENV=development
... Dotenv::load(path_to_file: dirname(__DIR__), env_var: "APP_ENV"); ...
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-25