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