forked from NamelessMC/Nameless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
57 lines (49 loc) · 1.67 KB
/
install.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
48
49
50
51
52
53
54
55
56
57
<?php
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
*
* License: MIT
*
* Installer
*/
// Definitions
if (!defined('PATH')) {
define('PATH', '/');
define('ROOT_PATH', __DIR__);
}
$page = 'install';
$install_path = str_replace('\\', '/', substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT'])));
// Start initialising the page
require(ROOT_PATH . '/core/init.php');
// Disable error reporting
error_reporting(0);
ini_set('display_errors', 0);
// Set default timezone to prevent potential issues
date_default_timezone_set('Europe/London');
// Select language
if (isset($_SESSION['installer_language'])
&& is_file('custom/languages/' . $_SESSION['installer_language'] . '/installer.php')
) {
require(ROOT_PATH . '/custom/languages/' . $_SESSION['installer_language'] . '/version.php');
require(ROOT_PATH . '/custom/languages/' . $_SESSION['installer_language'] . '/installer.php');
} else {
// Require default language (EnglishUK)
require(ROOT_PATH . '/custom/languages/EnglishUK/version.php');
require(ROOT_PATH . '/custom/languages/EnglishUK/installer.php');
}
// Get installation path
$install_path = substr(str_replace('\\', '/', substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT']))), 1);
if (!isset($CONFIG['installed'])) {
if (isset($_GET['language'])) {
// Set language
if (is_file('custom/languages/' . $_GET['language'] . '/installer.php')) {
$_SESSION['installer_language'] = $_GET['language'];
die('OK');
}
}
require(ROOT_PATH . '/core/installation/installer.php');
} else {
require(ROOT_PATH . '/core/installation/already_installed.php');
}