forked from inphinit/inphinit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.php
More file actions
109 lines (100 loc) · 2.83 KB
/
check.php
File metadata and controls
109 lines (100 loc) · 2.83 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
define('INPHINIT_ROOT', strtr(__DIR__, '\\', '/') . '/');
define('INPHINIT_PATH', INPHINIT_ROOT . 'system/');
$response = require INPHINIT_PATH . 'vendor/inphinit/framework/src/requirements.php';
if (PHP_SAPI === 'cli') {
if (empty($response->error) === false) {
echo ' - Fail: ' . implode(PHP_EOL . ' - Fail: ', $response->error), PHP_EOL;
}
if (empty($response->warn) === false) {
echo ' - Recommended: ' . implode(PHP_EOL . ' - Recommended: ', $response->warn), PHP_EOL;
}
if (empty($response->error) && empty($response->warn)) {
echo 'Your server is fine! ;]', PHP_EOL;
}
} else {
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inphinit php framework</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:100" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
<style type="text/css">
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body {
background: #F7F6F6;
min-width: 210px;
}
.container {
height: 100%;
}
.container h1 {
color: #5F5656;
font-size: 48pt;
font-weight: 100;
padding: 15px 0 20px 0;
margin: 0;
text-align: center;
}
.container h1, .done {
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, freesans, sans-serif;
}
.container ul {
list-style-type: none;
padding: 0 5px;
margin: 0;
}
.container ul li {
border-radius: 4px;
margin: 0 0 5px 0;
padding: 10px;
color: #fff;
}
.container ul.fail li {
background-color: #cc0a0a;
}
.container ul.warn li {
background-color: #e69e1b;
}
.done {
font-size: 24pt;
padding: 12px 0;
text-align: center;
}
@media only screen and (max-width: 400px) {
.container h1 {
font-size: 36pt;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Check server requirements</h1>
<?php
if ($response->error) {
echo '<ul class="fail"><li>Fail: ',
implode('</li><li>Fail: ', $response->error),
'</li></ul>';
}
if ($response->warn) {
echo '<ul class="warn"><li>Recommended: ',
implode('</li><li>Recommended: ', $response->warn),
'</li></ul>';
}
if (empty($response->error) && empty($response->warn)) {
echo '<div class="done">Your server is fine! :)</div>';
}
?>
</div>
</body>
</html>
<?php
}