2015-10-29 00:47:40 +01:00
|
|
|
<?php
|
|
|
|
require_once 'config.php';
|
|
|
|
require_once 'vendor/autoload.php';
|
|
|
|
|
|
|
|
// REDBEAN CONFIGURATION
|
|
|
|
use RedBeanPHP\Facade as RedBean;
|
|
|
|
RedBean::setup('mysql:host='. $mysql_host .';dbname=' . $mysql_database, $mysql_user, $mysql_password);
|
2016-08-04 05:59:04 +02:00
|
|
|
RedBean::setAutoResolve(true);
|
2015-10-29 00:47:40 +01:00
|
|
|
|
|
|
|
// SLIM FRAMEWORK
|
|
|
|
\Slim\Slim::registerAutoLoader();
|
|
|
|
$app = new \Slim\Slim();
|
|
|
|
|
2016-05-15 00:08:30 +02:00
|
|
|
// LOAD LIBRARIES
|
|
|
|
include_once 'libs/Controller.php';
|
|
|
|
include_once 'libs/ControllerGroup.php';
|
|
|
|
include_once 'libs/Hashing.php';
|
2016-07-15 00:06:47 +02:00
|
|
|
include_once 'libs/MailSender.php';
|
2016-08-01 05:34:55 +02:00
|
|
|
include_once 'libs/Date.php';
|
2016-08-04 05:59:04 +02:00
|
|
|
include_once 'libs/DataStoreList.php';
|
2016-05-15 00:08:30 +02:00
|
|
|
|
2016-07-26 23:30:51 +02:00
|
|
|
// LOAD DATA
|
|
|
|
spl_autoload_register(function ($class) {
|
|
|
|
$classPath = "data/{$class}.php";
|
|
|
|
|
|
|
|
if(file_exists($classPath)) {
|
|
|
|
include_once $classPath;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-10-29 00:47:40 +01:00
|
|
|
// LOAD MODELS
|
|
|
|
spl_autoload_register(function ($class) {
|
|
|
|
$classPath = "models/{$class}.php";
|
|
|
|
|
|
|
|
if(file_exists($classPath)) {
|
2016-06-19 01:08:53 +02:00
|
|
|
include_once $classPath;
|
2015-10-29 00:47:40 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-08-04 05:59:04 +02:00
|
|
|
//Load custom validations
|
|
|
|
include_once 'libs/validations/dataStoreExists.php';
|
|
|
|
|
2015-10-29 00:47:40 +01:00
|
|
|
// LOAD CONTROLLERS
|
|
|
|
foreach (glob('controllers/*.php') as $controller) {
|
2016-06-19 01:08:53 +02:00
|
|
|
include_once $controller;
|
2015-10-29 00:47:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$app->run();
|