Added dotenv component to define env vars in local file

This commit is contained in:
Alejandro Celaya committed 2016-04-30 17:21:35 +02:00
1 parent 03298fc448
commit a60a6ccc4d
8 files changed
+69 -22

No files matched your search

+9 -1
View File
@@ -1,11 +1,19 @@
<?php
use Zend\Expressive\Application;
use Dotenv\Dotenv;
use Zend\ServiceManager\ServiceManager;
chdir(dirname(__DIR__));
require 'vendor/autoload.php';
// If the Dotenv class exists, load env vars and enable errors
if (class_exists(Dotenv::class)) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
$dotenv = new Dotenv(__DIR__ . '/..');
$dotenv->load();
}
// Build container
$config = require __DIR__ . '/config.php';
$container = new ServiceManager($config['services']);