-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheck.php
135 lines (121 loc) · 4.31 KB
/
check.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
define('ENV', basename(__DIR__) == "public" ? 'local' : 'production');
function isProduction() {
return (ENV == 'production');
}
$devCheckerFile= __DIR__ . '/../RequirementsChecker.php';
$productionCheckerFile = __DIR__ . '/application/RequirementsChecker.php';
if(isProduction()) {
include_once ($productionCheckerFile);
}
else {
include_once ($devCheckerFile);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Checking minimum requirements</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/>
<style>
body {
background: #eeeeee;
padding-bottom: 100px;
}
#mainColumn {
background: #ffffff;
padding: 30px;
}
</style>
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6021241502394', {'value':'22.5','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6021241502394&cd[value]=22.5&cd[currency]=USD&noscript=1" /></noscript>
</head>
<body>
<div class="text-center" style="margin: 40px 0px;"><h1>Checking Minimum requirements</h1></div>
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1" id="mainColumn">
<?php
/*
* Check if everything is ok to run laravel
*/
$requirementsChecker = new RequirementChecker();
$requirementsChecker->run();
?>
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">Checking requirements</div>
</div>
<div class="panel-body">
<ol>
<?php
foreach ($requirementsChecker->getChecks() as $check) {
?>
<li><?php echo $check; ?></li>
<?php
}
?>
</ol>
</div>
</div>
<?php
if(empty($requirementsChecker->getErrors())) {
?>
<div class="text-center">
<br>
<h1 class="text-success">Success! </h1>
<h2>Your hosting meets all the requirements!</h2>
<br>
<?php
if(!empty($onSuccessHtml))
echo $onSuccessHtml;
?>
</div>
<?php
} else {
?>
<h2>Sorry! You are missing some requirements</h2><br/>
<?php
foreach ($requirementsChecker->getErrors() as $error) {
?>
<div class="panel panel-danger">
<div class="panel-heading">
<div class="panel-title">
<?php echo $error['title'] ?>
</div>
</div>
<div class="panel-body">
<?php echo $error['message'] ?>
</div>
</div>
<?php
}
?>
<div class="text-center alert alert-warning">
<h3>Get them fixed</h3>
<p>Contact your hosting provider to fix them if possible or move to a different host that meets all the requirements stated above.</p>
<br/>
</div>
<?php
}
?>
</div>
</div>
</div>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</body>
</html>