forked from firefoxrebo/estore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (30 loc) · 1.04 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace PHPMVC;
use PHPMVC\lib\Authentication;
use PHPMVC\lib\Messenger;
use PHPMVC\Lib\Registry;
use PHPMVC\LIB\FrontController;
use PHPMVC\LIB\Language;
use PHPMVC\LIB\SessionManager;
use PHPMVC\LIB\Template\Template;
if(!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
require_once '..' . DS . 'app' . DS . 'config' . DS . 'config.php';
require_once APP_PATH . DS . 'lib' . DS . 'autoload.php';
$session = new SessionManager();
$session->start();
if(!isset($session->lang)) {
$session->lang = APP_DEFAULT_LANGUAGE;
}
$template_parts = require_once '..' . DS . 'app' . DS . 'config' . DS . 'templateconfig.php';
$template = new Template($template_parts);
$language = new Language();
$messenger = Messenger::getInstance($session);
$authentication = Authentication::getInstance($session);
$registry = Registry::getInstance();
$registry->session = $session;
$registry->language = $language;
$registry->messenger = $messenger;
$frontController = new FrontController($template, $registry, $authentication);
$frontController->dispatch();