-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvirgil-test.php
63 lines (51 loc) · 1.33 KB
/
virgil-test.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
<?php
function getPHPVersion(): string
{
return "v".PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;
}
function getCryptoVersion(): string
{
return file_get_contents(__DIR__ . DIRECTORY_SEPARATOR."..". DIRECTORY_SEPARATOR."VERSION");
}
function getExtensionsNamesAsArray(): array
{
$extensions = [
"vscf_foundation_php",
"vsce_phe_php",
"vscp_pythia_php"
];
return $extensions;
}
function getScannedIniDir()
{
$res = null;
$rawData = php_ini_scanned_files();
if ($rawData)
$res = explode(",", $rawData);
return pathinfo($res[0], PATHINFO_DIRNAME);
}
function getExtensionsInfo(): array
{
$extArr = [];
foreach (getExtensionsNamesAsArray() as $ext) {
$extArr[] = [
'name' => $ext,
'version' => phpversion($ext) ?: null,
'is_extension_loaded' => extension_loaded($ext),
];
}
return $extArr;
}
function getConfigInfo(): array
{
return [
'CRYPTO_VERSION' => getCryptoVersion(),
'OS' => PHP_OS,
'PHP_VERSION' => getPHPVersion(),
'PATH_TO_EXTENSIONS_DIR' => PHP_EXTENSION_DIR,
'PATH_TO_MAIN_PHP.INI' => php_ini_loaded_file(),
'PATH_TO_ADDITIONAL_INI_FILES' => getScannedIniDir(),
];
}
echo "<pre>".var_dump(getExtensionsInfo(), getConfigInfo())."</pre>";
exit(0);