2016-04-10 10:52:44 +03:00
|
|
|
<?php
|
2016-04-30 18:21:35 +03:00
|
|
|
use Dotenv\Dotenv;
|
2016-04-10 10:52:44 +03:00
|
|
|
use Zend\ServiceManager\ServiceManager;
|
|
|
|
|
2016-04-10 13:06:28 +03:00
|
|
|
chdir(dirname(__DIR__));
|
|
|
|
|
2016-04-17 21:27:24 +03:00
|
|
|
require 'vendor/autoload.php';
|
2016-04-10 10:52:44 +03:00
|
|
|
|
2016-04-30 18:21:35 +03:00
|
|
|
// 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();
|
|
|
|
}
|
|
|
|
|
2016-04-10 10:52:44 +03:00
|
|
|
// Build container
|
|
|
|
$config = require __DIR__ . '/config.php';
|
|
|
|
$container = new ServiceManager($config['services']);
|
|
|
|
$container->setService('config', $config);
|
2016-04-17 21:27:24 +03:00
|
|
|
return $container;
|