mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Use php_ini_loaded_file() instead of phpinfo() hack
This commit is contained in:
parent
120bfd1a07
commit
301c10f0be
@ -16,26 +16,11 @@
|
|||||||
<br>
|
<br>
|
||||||
<?php if (!extension_loaded("pdo_mysql")) {
|
<?php if (!extension_loaded("pdo_mysql")) {
|
||||||
echo "- <a class=\"text-danger\">pdo_mysql</a>";
|
echo "- <a class=\"text-danger\">pdo_mysql</a>";
|
||||||
} ?>
|
}
|
||||||
|
$phpini = php_ini_loaded_file();
|
||||||
|
|
||||||
|
echo "These extensions can be enabled in php.ini.<br><br>";
|
||||||
|
echo "php.ini location: <a class=\"text-info\">" . $phpini . "</a><br>";
|
||||||
<?php
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
phpinfo();
|
|
||||||
$phpinfo = array('phpinfo' => array());
|
|
||||||
if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER))
|
|
||||||
foreach ($matches as $match)
|
|
||||||
if (strlen($match[1]))
|
|
||||||
$phpinfo[$match[1]] = array();
|
|
||||||
elseif (isset($match[3]))
|
|
||||||
$phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
|
|
||||||
else
|
|
||||||
$phpinfo[end(array_keys($phpinfo))][] = $match[2];
|
|
||||||
|
|
||||||
echo "These extensions can be enabled in php.ini.<br>";
|
|
||||||
echo "php.ini location: <a class=\"text-info\">" . $phpinfo['phpinfo']["Loaded Configuration File"] . "</a>";
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user