Watch 1 Star 0 Fork 0

技安-幻果 / phpeditdotenvPHPMIT

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
编辑“.env”文件 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

phpeditdotenv

编辑“.env”文件

加载

composer require 'agile/phpeditdotenv:~1.0'

或者在composer.json文件中添加
"require": {
    "agile/phpeditdotenv": "~1.0"
}

使用

use Agile\Phpeditdotenv\Dotenv;

public function index()
{
    // 读取
    $envData = Dotenv::load(realpath('../'));
    var_dump($envData);

    // 修改某一项参数并保存
    $envData['CACHE_DRIVER'] = 'redis';
    Dotenv::save($envData, realpath('../'));
}

Comments ( 2 )

You need to Sign in for post a comment

Help Search