opensupports/server/index.php

27 lines
739 B
PHP
Raw Normal View History

<?php
@include 'config.php';
require_once 'vendor/autoload.php';
// REDBEAN CONFIGURATION
use RedBeanPHP\Facade as RedBean;
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);
RedBean::setAutoResolve(true);
2020-01-22 18:26:07 +01:00
// TODO: Implement freeze
// RedBean::freeze();
}
// SLIM FRAMEWORK
\Slim\Slim::registerAutoLoader();
$app = new \Slim\Slim();
// LOAD CONTROLLERS
foreach (glob('controllers/*.php') as $controller) {
include_once $controller;
}
2017-01-14 22:19:21 +01:00
Controller::init();
$app->run();