raspisms/index.php

30 lines
845 B
PHP
Raw Normal View History

2019-10-29 14:57:13 +01:00
<?php
2019-10-29 18:34:37 +01:00
require_once(__DIR__ . '/descartes/load.php');
2019-10-29 14:57:13 +01:00
############
# SESSIONS #
############
session_name(SESSION_NAME);
session_start();
//Create csrf token if it didn't exist
if (!isset($_SESSION['csrf']))
{
$_SESSION['csrf'] = str_shuffle(uniqid().uniqid());
}
2019-10-29 18:34:37 +01:00
#####################
# RASPISMS SETTINGS #
#####################
2019-11-08 19:17:47 +01:00
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
2019-10-29 14:57:13 +01:00
$internal_setting = new \controllers\internals\Setting($bdd);
2019-11-08 19:17:47 +01:00
$settings = $internal_setting->get_all();
2019-10-29 14:57:13 +01:00
foreach ($settings as $setting)
{
define('RASPISMS_SETTINGS_' . mb_convert_case($setting['name'], MB_CASE_UPPER), $setting['value']);
}
//Routing current query
2019-10-29 18:34:37 +01:00
descartes\Router::route(ROUTES, $_SERVER['REQUEST_URI']);