2014-07-20 12:26:15 +02:00
|
|
|
<?php
|
|
|
|
|
2014-10-22 19:59:09 +02:00
|
|
|
// Common file between cli and web interface
|
|
|
|
|
2014-07-20 12:26:15 +02:00
|
|
|
require __DIR__.'/Core/Loader.php';
|
|
|
|
require __DIR__.'/helpers.php';
|
2014-10-22 19:59:09 +02:00
|
|
|
require __DIR__.'/functions.php';
|
2014-07-20 12:26:15 +02:00
|
|
|
|
|
|
|
use Core\Loader;
|
|
|
|
use Core\Registry;
|
|
|
|
|
2014-10-22 19:59:09 +02:00
|
|
|
// Include password_compat for PHP < 5.5
|
|
|
|
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
|
|
|
|
require __DIR__.'/../vendor/password.php';
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
$loader = new Loader;
|
2014-10-22 19:59:09 +02:00
|
|
|
$loader->setPath('app');
|
|
|
|
$loader->setPath('vendor');
|
2014-07-20 12:26:15 +02:00
|
|
|
$loader->execute();
|
|
|
|
|
|
|
|
$registry = new Registry;
|
2014-10-22 19:59:09 +02:00
|
|
|
$registry->db = setup_db();
|
|
|
|
$registry->event = setup_events();
|
|
|
|
$registry->mailer = function() { return setup_mailer(); };
|