Example #1
0
set_include_path('./library');
spl_autoload_extensions('.php');
spl_autoload_register();
use Core\Application;
use Core\Config;
use Core\Setting;
use Utils\Menu;
use Manage\Authentification;
if (Config::Get('debug')) {
    error_reporting(-1);
    ini_set('display_errors', 1);
} else {
    error_reporting(0);
    ini_set('display_errors', 0);
}
$app = new Application();
$auth = new Authentification();
$navbar = new Menu();
$navbar->item($app->URL(), 'Share')->item($app->URL('review'), 'Review')->item($app->URL('details'), 'Details');
$navbar_right = new Menu();
if ((new Setting('api_display_doc'))->getValue() || $auth->isLogged()) {
    $navbar_right->item($app->URL('api'), 'API');
} else {
    if ((new Setting('api_requests'))->getValue()) {
        $navbar_right->item($app->URL('api/request'), 'API');
    }
}
$app->register(Menu::NAVBAR, $navbar);
$app->register(Menu::NAVBAR_RIGHT, $navbar_right);
// let's party hard
$app->run();