forked from CodonoTeam/cryptocurrency-exchange-script
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_check.php
171 lines (166 loc) · 7.48 KB
/
install_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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
/*
Crypto Exchange Script white label blockchain solution is an open source software that is built for private and public libraries.
It is not controlled by centralized entities and is therefore free to use forever. Its codebase is open and tested by developers worldwide.
A leading Blockchain software development company, has created a secure and flexible white label version of the software for developers to deploy and customize cryptocurrency exchange services.
The software is based on the blockchain technology and is licensed under the Commercial License.
support@codono.com https://codono.com
telegram @ctoninja
*/
header('Content-type:text/html; charset=utf-8');
// PHP version
$phpVersion = PHP_VERSION;
$phpVersionCould = version_compare($phpVersion, '7.3.0', '>=');
const DB_HOST="127.0.0.1";
const DB_USER="root";
const DB_PWD="";
const DB_NAME="codono";
const PHP_PATH="php";
$mysqli = @new mysqli(DB_HOST, DB_USER, DB_PWD, DB_NAME);
$os_found=PHP_OS;
if($os_found=='WINNT'){
$found_php_path=str_replace('ext/', 'php.exe', ini_get('extension_dir'));
}else if ($os_found=='linux'){
$found_php_path = exec("which php");
}else{
$found_php_path= "Please google php path for $os_found";
}
/* check connection */
if (!$mysqli->connect_errno) {
$mysqli_version=mysqli_get_server_info($mysqli);
}else{
$mysqli_version="Connection Failed, Please check pure_config.php";
}
$phppath_result=strpos(exec(PHP_PATH." -v"),'Copyright');
if ($phppath_result !== false) {
$phppath_result =true;
}
$phpPath = version_compare($phpVersion, '7.3.0', '>=');
// Directory permissions
$bootstrapDirWriteable = is_writable('Upload');
$storageDirWriteable = is_writeable('Runtime');
$envWriteable = is_writeable('pure_config.php');
// Extension
$redisExtension =extension_loaded('redis');
$opensslExtension = extension_loaded('openssl');
$pdoMysqlExtension = extension_loaded('pdo_mysql');
$mbstringExtension = extension_loaded('mbstring');
$curlExtension = extension_loaded('curl');
$tokenizerExtension = extension_loaded('tokenizer');
$xmlExtension = extension_loaded('xml');
$fileinfoExtension = extension_loaded('fileinfo');
$ctypeExtension = extension_loaded('ctype');
$jsonExtension = extension_loaded('json');
$bcmathExtension = extension_loaded('bcmath');
$zipExtension = extension_loaded('zip');
$gdExtension = extension_loaded('gd');
$allow_url_fopen = ini_get('allow_url_fopen');
$iconvExtension = extension_loaded('iconv');
$libsodium=extension_loaded('iconv');
$exec=function_exists('exec');
$stream_socket_server=function_exists('stream_socket_server');
$gmpExtension = extension_loaded('gmp');
//$mcypt=function_exists('mcrypt_create_iv');
$extensionRows = [
'exec'=>$exec,
'openssl' => $opensslExtension,
'redis' => $redisExtension,
'pdo_mysql' => $pdoMysqlExtension,
'mbstring' => $mbstringExtension,
'curl' => $curlExtension,
'tokenizer' => $tokenizerExtension,
'xml' => $xmlExtension,
'fileinfo' => $fileinfoExtension,
'ctype' => $ctypeExtension,
'json' => $jsonExtension,
'bcmath' => $bcmathExtension,
'zip' => $zipExtension,
'GD' => $gdExtension,
'allow_url_fopen'=>$allow_url_fopen,
'iconv'=>$iconvExtension,
'libsodium'=>$libsodium,
'stream_socket_server'=>$stream_socket_server,
// 'mcrypt'=>$mcrypt,
'gmp [Required For Tron Network]' => $gmpExtension
];
$isCross = $phpVersionCould && $storageDirWriteable && $bootstrapDirWriteable && $envWriteable;
if ($isCross) {
foreach ($extensionRows as $extensionRow) {
$isCross = $isCross && $extensionRow;
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link crossorigin="anonymous" href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<title>Codono Environment Check</title>
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-sm-12 mb-0 text-center">
<h2 style="line-height: 60px;">Codono Environment Check</h2>
</div>
<div class="col-sm-12">
<ul class="list-group">
<li class="list-group-item list-group-item-info"><b>PHP version detection(Required version:=7.4)</b></li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo $phpVersion; ?>
<span class="badge badge-<?php echo $phpVersionCould ? 'success' : 'danger' ?> badge-pill">
<?php echo $phpVersionCould ? 'Pass' : 'Fail' ?>
</span>
</li>
<li class="list-group-item list-group-item-info"><b>PHP Path in Pure Config <strong>[Found: <?php echo $found_php_path;?>]</strong></b></li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo PHP_PATH;?>
<span class="badge badge-<?php echo $phppath_result ? 'success' : 'danger' ?> badge-pill">
<?php echo $phppath_result ? 'Correct Path' : 'Incorrect Path' ?>
</span>
</li>
<li class="list-group-item list-group-item-info"><b>MySQL connection </b></li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo $mysqli_version;?>
<span class="badge badge-warning badge-pill">
Recommended MariaDB
</span>
</li>
<li class="list-group-item list-group-item-info"><b>Directory permission writable</b></li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo ('Upload'); ?>
<span class="badge badge-<?php echo $bootstrapDirWriteable ? 'success' : 'danger' ?> badge-pill">
<?php echo $bootstrapDirWriteable ? 'Writable' : 'Not Writable' ?>
</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo ('Runtime'); ?>
<span class="badge badge-<?php echo $storageDirWriteable ? 'success' : 'danger' ?> badge-pill">
<?php echo $storageDirWriteable ? 'Writable' : 'Not Writable' ?>
</span>
</li>
<li class="list-group-item list-group-item-info"><b>PHP extension detection</b></li>
<?php foreach($extensionRows as $name => $row) { ?>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo $name; ?>
<span class="badge badge-<?php echo $row ? 'success' : 'danger' ?> badge-pill">
<?php echo $row ? 'Detected' : 'Not Found' ?>
</span>
</li>
<?php } ?>
</ul>
</div>
<div class="col-sm-12 text-center" style="line-height: 120px;">
<?php if ($isCross) { ?>
<span class="alert alert-info">You can continue installation </span>
<?php } else { ?>
<button disabled class="btn btn-info" type="button">Can't continue</button>
<?php } ?>
</div>
</div>
</div>
</body>
</html>