-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.php
80 lines (71 loc) · 2.66 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
<?php
if (file_exists(__DIR__ . '/storage/installed')) {
header('Location: /');
exit;
}
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
$errors = [];
if (version_compare(phpversion(), '7.1.3', '<') || version_compare(phpversion(), '7.4', '>=')) {
$errors[] = sprintf('PHP <b>7.1.3 - 7.3</b> should be installed (currently installed PHP %s).', phpversion());
}
foreach(['openssl','pdo','mbstring','tokenizer','xml','curl','ctype','fileinfo','json','bcmath','zip'] as $extension)
if (!extension_loaded($extension)) {
$errors[] = sprintf('PHP extension <b>%s</b> should be loaded.', $extension);
}
foreach(['public',
'storage',
'storage/app/public/games/slots',
'storage/framework',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/views',
'storage/logs',
'bootstrap/cache'] as $folder)
if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . $folder))
$errors[] = sprintf('Folder <b>%s</b> should be writable', $folder);
if (!is_writable(__DIR__))
$errors[] = 'Folder <b>..</b> (web root) should be writable';
if (!file_exists('.env.install'))
$errors[] = 'Please check that <b>.env.install</b> file exists in the web root folder.';
if (in_array('set_time_limit', explode(',', ini_get('disable_functions'))))
$errors[] = 'PHP function <b>set_time_limit</b> should be enabled.';
if (empty($errors)) {
header('Location: /install/1');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Installation</title>
<link rel="stylesheet" type="text/css" href="public/css/dark-purple.css">
</head>
<body class="theme-dark-purple">
<div class="container">
<div class="row mt-3 mb-3">
<div class="col">
<h1 class="border-bottom border-light">Installation</h1>
</div>
</div>
<div class="row mt-3 mb-3">
<div class="col">
<h2><i class="fas fa-cogs"></i> System requirements</h2>
<div class="alert alert-danger">
<h4 class="alert-heading">
Please resolve the following issues before installing the application:
</h4>
<ul>
<?php foreach ($errors as $error):?>
<li><?php print $error?></li>
<?php endforeach;?>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>