2016-04-10 02:52:44 -05:00
|
|
|
<?php
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-12-27 09:33:06 -06:00
|
|
|
use Symfony\Component\Dotenv\Dotenv;
|
2016-04-10 02:52:44 -05:00
|
|
|
use Zend\ServiceManager\ServiceManager;
|
|
|
|
|
2016-04-10 05:06:28 -05:00
|
|
|
chdir(dirname(__DIR__));
|
|
|
|
|
2016-04-17 13:27:24 -05:00
|
|
|
require 'vendor/autoload.php';
|
2016-04-10 02:52:44 -05:00
|
|
|
|
2016-04-30 10:21:35 -05:00
|
|
|
// If the Dotenv class exists, load env vars and enable errors
|
|
|
|
if (class_exists(Dotenv::class)) {
|
|
|
|
error_reporting(E_ALL);
|
2017-10-12 04:28:45 -05:00
|
|
|
ini_set('display_errors', '1');
|
2017-12-27 09:33:06 -06:00
|
|
|
$dotenv = new Dotenv();
|
|
|
|
$dotenv->load(__DIR__ . '/../.env');
|
2016-04-30 10:21:35 -05:00
|
|
|
}
|
|
|
|
|
2016-04-10 02:52:44 -05:00
|
|
|
// Build container
|
|
|
|
$config = require __DIR__ . '/config.php';
|
2016-07-31 09:30:05 -05:00
|
|
|
$container = new ServiceManager($config['dependencies']);
|
2016-04-10 02:52:44 -05:00
|
|
|
$container->setService('config', $config);
|
2016-04-17 13:27:24 -05:00
|
|
|
return $container;
|