<?php

session_start();
if(!isset($_SESSION['role'])){
    $_SESSION['role']='visitor';
}
if(!isset($_SESSION['user'])){
    $_SESSION['user']=NULL;
}
if(!isset($_SESSION['theme'])){
    $_SESSION['theme']='dark';
}

//chargement config
require_once __DIR__ . '/config/config.php';
require __DIR__ . '/vendor/autoload.php';

//$co = new \Gateway\Connection('pgsql:host=localhost;dbname=wikifantasy3;', 'postgres', 'sucepute');
$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd');

//twig
$loader = new \Twig\Loader\FilesystemLoader('vue/templates');
$twig   = new \Twig\Environment($loader, [
    'cache' => false,
]);

global $racine;
$twig->addGlobal('racine',$racine);



$cont = new Controleur\FrontControler($co);


?>
