forked from spotweb/spotweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
82 lines (67 loc) · 1.71 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
error_reporting(2147483647);
require_once __DIR__ . '/vendor/autoload.php';
if (file_exists(__DIR__ . '/settings.php')) {
require_once __DIR__ . '/settings.php';
}
if (file_exists(__DIR__ . '/dbsettings.inc.php')) {
require_once __DIR__ . '/dbsettings.inc.php';
}
set_error_handler('SpotInstall::ownWarning', E_WARNING);
if (file_exists(__DIR__ . '/reallymyownsettings.php')) {
require_once __DIR__ . '/reallymyownsettings.php';
}
/**
* We output headers after already sending HTML, make
* sure output buffering is turned on.
*/
ob_start();
/**
* We default to a succeeded install, let it prove
* otherwise
*/
global $_testInstall_Ok;
$_testInstall_Ok = true;
session_start();
/**
* Dummy translate function.
*/
if (!function_exists('_')) {
function _($s)
{
return $s;
}
}
/**
* Only run the wizard when no database settings have been entered yet, to prevent
* any information disclosure
*/
if ((isset($dbsettings)) && (isset($_GET['page']))) {
SpotInstall::showTemplate(
'fatalerror.inc.php',
['x' => new Exception("Spotweb has already been setup. If you want to run this wizard again, please remove the file 'dbsettings.inc.php'")]
);
die();
}
/**
* determine what page of the wizzard we are on, and display that one
*/
$pageNumber = (isset($_GET['page']) ? $_GET['page'] : 1);
switch ($pageNumber) {
case 2:
SpotInstall::askDbSettings();
break;
case 3:
SpotInstall::askNntpSettings();
break;
case 4:
SpotInstall::askSpotwebSettings();
break;
case 99:
SpotInstall::createSystem();
break;
default:
SpotInstall::performAndPrintTests();
break;
}
ob_end_flush();