PHP Classes

File: usage/usage.php

Recommend this page to a friend!
  Classes of Miraz Mac   PHP DotEnv File Writer   usage/usage.php   Download  
File: usage/usage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP DotEnv File Writer
Manage configuration files in the dotenv format
Author: By
Last change:
Date: 3 years ago
Size: 381 bytes
 

Contents

Class file image Download
<?php

use MirazMac\DotEnv\Writer;

require_once
'../vendor/autoload.php';

$writer = new Writer(__DIR__ . '/' . '.env');

$writer
->set('APP_NAME', 'My App')
->
set('APP_URL', 'https://laravel.com')
// usage of an existing variable
->set('APP_DIR', '${BASE_DIR}/app')
// Force quote a single word value
->set('APP_BUCKET', 's3-bucket', true)
// Write the values to file
->write();