-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchecker.php
58 lines (53 loc) · 1.69 KB
/
checker.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
<?php
error_reporting(0);
function error($msg) { return '<div class="alert alert-danger" role="alert"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> ' . $msg . '</div>';}
function success($msg) { return '<div class="alert alert-success" role="alert"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> ' . $msg . '</div>';}
$html = '';
if(version_compare(PHP_VERSION, '5.4.0', '<')) {
$html .= error('PHP Version +5.4.0 Required');
}else{
$html .= success('PHP Version +5.4.0');
}
$requiredExtensions = array('xmlwriter', 'openssl', 'dom', 'hash', 'curl');
foreach ($requiredExtensions AS $ext) {
if (!extension_loaded($ext)) {
$html .= error('Extension ' . $ext . ' Required');
}else{
$html .= success('Extension ' . $ext . ' Installed');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Braintree Requirements</title>
<meta name="description" content="Check Braintree Requirements">
<meta name="author" content="Skinod">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style type="text/css">
html {
position: relative;
min-height: 100%;
}
.container {
width: auto;
max-width: 680px;
padding: 0 15px;
}
.container .text-muted {
margin: 20px 0;
}
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Braintree Requirements</h1>
</div>
<?php echo $html; ?>
<p>© <?php echo date('Y'); ?> By <a href="http://skinod.com">Skinod</a></p>
</div>
</body>
</html>