-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (32 loc) · 1.41 KB
/
index.php
File metadata and controls
36 lines (32 loc) · 1.41 KB
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
<?php
session_start();
// define('HOST', '/predicciones-framework');
define('HOST', '');
define('URL_BASE', '/app');
define('VIEWS', 'pages');
define('SHARED', 'partials');
define('ROOT', __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR);
define('LOGS', ROOT . 'logs' . DIRECTORY_SEPARATOR);
define('FILE', __FILE__ . DIRECTORY_SEPARATOR);
define('URI', str_replace(HOST, '', explode('?', strtolower(trim($_SERVER['REQUEST_URI'])))[0]));
$actual_link = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
define('CURRENT_PAGE', $actual_link);
date_default_timezone_set('Europe/Madrid');
define('PAGES', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'pages' . DIRECTORY_SEPARATOR);
define('API', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'api' . DIRECTORY_SEPARATOR);
$isMobile = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "mobile"));
define('IS_MOBILE', $isMobile);
header('X-Powered-By: BoulderPHP');
require_once ROOT . 'global-functions.php';
require_once ROOT . 'Autoload.php';
if (getenv('APP_ENV') === 'dev') {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
}
Autoload::register();
Middlewares::refreshToken();
$request = new Request();
$router = new Router($request);
$router->handle($request);
die('You must add your env_vars in the htaccess file');