-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (37 loc) · 965 Bytes
/
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
43
44
45
46
47
<?php
/**
* foxverse Index File.
*/
// Declare namespace
namespace Miiverse;
use Miiverse\Helpers\ConsoleAuth;
// Include app
require_once __DIR__.'/../core.php';
// Start output buffering
ob_start(config('performance.compression') ? 'ob_gzhandler' : null);
// Initialise the current session
$cookiePrefix = config('cookie.prefix');
CurrentSession::start(
intval($_COOKIE["{$cookiePrefix}id"] ?? 0),
$_COOKIE["{$cookiePrefix}session"] ?? '',
Net::ip()
);
ConsoleAuth::check();
Translation::init();
// Set base variables
$templateBases = [
'ctr',
'portal',
'offdevice',
];
Template::set($templateBases[ConsoleAuth::$paramPack['platform_id']]);
Template::vars([
'get' => $_GET,
'user' => CurrentSession::$user,
'post' => $_POST,
'server' => $_SERVER,
'request' => $_REQUEST,
'session' => $_SESSION,
]);
// Handle requests
echo Router::handle($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);