minor updates
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Novaconium\Logger;
|
||||
use Novaconium\Session;
|
||||
use Novaconium\MessageHandler;
|
||||
use Novaconium\Database;
|
||||
use Novaconium\Post;
|
||||
use Novaconium\Redirect;
|
||||
use Novaconium\Router;
|
||||
|
||||
$db = null;
|
||||
$post = null;
|
||||
|
||||
// --- Load Config ---
|
||||
if (file_exists(\BASEPATH . '/App/config.php')) {
|
||||
require_once \BASEPATH . '/App/config.php';
|
||||
@@ -11,7 +22,6 @@ require_once \FRAMEWORKPATH . '/src/functions.php';
|
||||
require_once \FRAMEWORKPATH . '/src/twig.php';
|
||||
|
||||
// --- Logging ---
|
||||
use Novaconium\Logger;
|
||||
$log = new Logger(\BASEPATH . $config['logfile'], $config['loglevel']);
|
||||
|
||||
// --- Twig Data Array ---
|
||||
@@ -21,35 +31,29 @@ $data['matomo_url'] = $config['matomo_url'] ?? '';
|
||||
$data['matomo_id'] = $config['matomo_id'] ?? '0';
|
||||
|
||||
// --- Session ---
|
||||
use Novaconium\Session;
|
||||
$session = new Session();
|
||||
$data['token'] = $session->get('token');
|
||||
$data['username'] = $session->get('username');
|
||||
|
||||
// --- Messages ---
|
||||
use Novaconium\MessageHandler;
|
||||
$messages = new MessageHandler($session->flash('messages'));
|
||||
foreach (['error', 'notice'] as $key) {
|
||||
$data[$key] = $messages->showMessages($key);
|
||||
}
|
||||
|
||||
// --- Database ---
|
||||
use Novaconium\Database;
|
||||
if (!empty($config['database']['host'])) {
|
||||
$db = new Database($config['database']);
|
||||
}
|
||||
|
||||
// --- POST Wrapper ---
|
||||
use Novaconium\Post;
|
||||
if (!empty($_POST)) {
|
||||
$post = new Post($_POST);
|
||||
}
|
||||
|
||||
// --- Redirect Handler ---
|
||||
use Novaconium\Redirect;
|
||||
$redirect = new Redirect();
|
||||
|
||||
// --- Router ---
|
||||
use Novaconium\Router;
|
||||
$router = new Router();
|
||||
require_once $router->controllerPath;
|
||||
|
||||
Reference in New Issue
Block a user