2014-07-20 12:26:15 +02:00
|
|
|
<?php
|
|
|
|
|
2014-12-22 19:15:38 +01:00
|
|
|
require 'vendor/autoload.php';
|
2014-10-22 19:59:09 +02:00
|
|
|
|
2015-02-25 17:29:06 +01:00
|
|
|
// Automatically parse environment configuration (Heroku)
|
|
|
|
if (getenv('DATABASE_URL')) {
|
|
|
|
|
|
|
|
$dbopts = parse_url(getenv('DATABASE_URL'));
|
|
|
|
|
|
|
|
define('DB_DRIVER', $dbopts['scheme']);
|
|
|
|
define('DB_USERNAME', $dbopts["user"]);
|
|
|
|
define('DB_PASSWORD', $dbopts["pass"]);
|
|
|
|
define('DB_HOSTNAME', $dbopts["host"]);
|
|
|
|
define('DB_NAME', ltrim($dbopts["path"],'/'));
|
|
|
|
}
|
|
|
|
|
2014-07-20 12:26:15 +02:00
|
|
|
// Include custom config file
|
|
|
|
if (file_exists('config.php')) {
|
|
|
|
require 'config.php';
|
|
|
|
}
|
|
|
|
|
2014-10-22 19:59:09 +02:00
|
|
|
require __DIR__.'/constants.php';
|
2014-07-20 12:26:15 +02:00
|
|
|
|
2014-12-22 19:15:38 +01:00
|
|
|
$container = new Pimple\Container;
|
2015-01-16 14:23:05 +01:00
|
|
|
$container->register(new ServiceProvider\LoggingProvider);
|
|
|
|
$container->register(new ServiceProvider\DatabaseProvider);
|
|
|
|
$container->register(new ServiceProvider\ClassProvider);
|
|
|
|
$container->register(new ServiceProvider\EventDispatcherProvider);
|
|
|
|
$container->register(new ServiceProvider\MailerProvider);
|