编辑“.env”文件,适用于laravel框架
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Phpeditdotenv
LICENSE
README.md
composer.json

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('../'));
}