2015-10-29 00:47:40 +01:00
|
|
|
<?php
|
2017-03-29 23:46:26 +02:00
|
|
|
@include 'config.php';
|
2015-10-29 00:47:40 +01:00
|
|
|
require_once 'vendor/autoload.php';
|
|
|
|
|
|
|
|
// REDBEAN CONFIGURATION
|
|
|
|
use RedBeanPHP\Facade as RedBean;
|
2017-03-15 06:17:16 +01:00
|
|
|
|
|
|
|
if(defined('MYSQL_HOST') && defined('MYSQL_DATABASE') && defined('MYSQL_USER') && defined('MYSQL_PASSWORD')) {
|
2018-03-28 04:30:18 +02:00
|
|
|
if(!defined('MYSQL_PORT')) define('MYSQL_PORT', '3306');
|
|
|
|
RedBean::setup('mysql:host='. MYSQL_HOST . ';port=' . MYSQL_PORT . ';dbname=' . MYSQL_DATABASE , MYSQL_USER, MYSQL_PASSWORD);
|
2017-03-15 06:17:16 +01:00
|
|
|
RedBean::setAutoResolve(true);
|
2020-01-22 18:26:07 +01:00
|
|
|
// TODO: Implement freeze
|
|
|
|
// RedBean::freeze();
|
2017-03-15 06:17:16 +01:00
|
|
|
}
|
2015-10-29 00:47:40 +01:00
|
|
|
|
|
|
|
// SLIM FRAMEWORK
|
|
|
|
\Slim\Slim::registerAutoLoader();
|
|
|
|
$app = new \Slim\Slim();
|
|
|
|
|
2018-11-12 17:46:44 +01:00
|
|
|
// LOAD CONTROLLERS
|
|
|
|
foreach (glob('controllers/*.php') as $controller) {
|
|
|
|
include_once $controller;
|
|
|
|
}
|
|
|
|
|
2017-01-14 22:19:21 +01:00
|
|
|
Controller::init();
|
2015-10-29 00:47:40 +01:00
|
|
|
$app->run();
|