myphpinfo.phps
<?php
// Written by Evgeny Stepanischev aka BOLK 2004 (http://bolknote.ru)
// Thanks for testing to <lj user=kukutz> and <lj user=karim>
// Ugly hack for PHP 4.0.x
if (!isset($_SERVER)) $_SERVER['PHP_SELF'] = @$HTTP_SERVER_VARS['PHP_SELF'];
if (!isset($_GET)) $_GET['screen'] = @$HTTP_GET_VARS['screen'];
if (isset($_GET['screen']) && $_GET['screen'] == 'credits')
{
if (function_exists('phpcredits'))
{
phpcredits();
exit;
}
}
$known_modules = array('standard', 'apache');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html><head>
<style type="text/css"><!--
body {background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: monospace;}
a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse;}
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
i {color: #666666; background-color: #cccccc;}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
center,font {display:none}
//--></style>
<title>PHP based phpinfo() version v0.8 (Evgeny Stepanischev aka BOLK)</title></head>
<body><div class="center">
<table border="0" cellpadding="3" width="600">
<tr class="h"><td>
<a href="http://www.php.net/"><img border="0" src="<?php echo $_SERVER['PHP_SELF'].'?='.php_logo_guid()?>" alt="PHP Logo" /></a><h1 class="p">PHP Version <?=PHP_VERSION?></h1>
</td></tr>
</table><br />
<table border="0" cellpadding="3" width="600">
<tr><td class="e">System </td><td class="v"><?php echo U_getos()?></td></tr>
<tr><td class="e">Server API </td><td class="v"><?php echo U_sapi()?></td></tr>
<tr><td class="e">Registered PHP Streams</td><td class="v"><?php echo U_streams()?></td></tr>
</table><br />
<?php if (function_exists('zend_version')):?>
<table border="0" cellpadding="3" width="600">
<tr class="v"><td>
<a href="http://www.zend.com/"><img border="0" src="<?php echo $_SERVER['PHP_SELF'].'?='.zend_logo_guid()?>" alt="Zend logo" /></a>
This program makes use of the Zend Scripting Language Engine:<br />Zend Engine v<?php echo zend_version()?>,
Copyright (c) Zend Technologies
</td></tr>
</table>
<?php endif?>
<?php if (function_exists('phpcredits')):?>
<hr />
<h1><a href="<?php echo $_SERVER['PHP_SELF'].'?screen=credits'?>">PHP Credits</a></h1>
<?php endif?>
<hr />
<h1>Configuration</h1>
<?php
U_module_core();
if (function_exists('apache_request_headers') || function_exists('apache_response_headers')):?>
<h2>HTTP Headers Information</h2>
<table border="0" cellpadding="3" width="600">
<?php if (function_exists('apache_request_headers')):?>
<tr class="h"><th colspan="2">HTTP Request Headers</th></tr>
<?php U_table(apache_request_headers(), '<tr><td class="e">%s</td><td class="v">%s</td></tr>')?>
<?php endif?>
<?php if (function_exists('apache_response_headers')):?>
<tr class="h"><th colspan="2">HTTP Response Headers</th></tr>
<?php U_table(apache_response_headers(), '<tr><td class="e">%s</td><td class="v">%s</td></tr>')?>
<?php endif?>
</table><br />
<?php endif?>
<?php
U_module('ntuser_getuserinfo', 'NT User API', 'NT User API');
if (U_module('mmcache_put', 'turck mmcache', 'Turck MMCache'))
U_options('mmcache');
U_module('bcadd', 'bcmath', 'BCMath');
U_module('bzclose', 'bz2', 'BZip2');
U_module('easter_days', 'calendar', 'Calendar');
if (class_exists('COM'))
{
U_module(true, 'com', 'COM');
U_options('com');
}
if (U_module('crack_opendict', 'crack', 'crack'))
U_options('crack');
U_module('ctype_alnum', 'ctype', 'ctype');
if (function_exists('curl_version'))
U_module_curl();
if (function_exists('dba_open'))
U_module_dba();
U_module('dbase_create', 'dbase', 'dBase');
U_module('dio_close', 'dio', 'dio');
if (function_exists('domxml_version'))
U_module_domxml();
U_module('exif_read_data', 'exif', 'EXIF');
U_module('fribidi_log2vis', 'fribidi', 'FriBidi');
U_module('ftp_cdup', 'ftp', 'FTP');
if (function_exists('imagecreate'))
U_module_gd();
if (U_module('iconv', 'iconv', 'iconv'))
if (!U_options('iconv'))
{
echo '<table border="0" cellpadding="3" width="600">',
'<tr class="h"><th>Directive</th><th>Value</th></tr>';
U_table(iconv_get_encoding(), '<tr><td class="e">%s</td><td class="v">%s</td></tr>');
echo '</table>';
}
U_module('iis_get_error', 'iisfunc', 'IIS Admin Functions');
if (class_exists('Java')) U_module(true, 'java', 'Java');
U_module('gettext', 'gettext', 'GetText');
U_module('gmp_abs', 'gmp', 'gmp');
if (U_module('hw_error', 'hyperwave', 'Hyperwave'))
U_options('hyperwave');
U_module('imap_8bit', 'imap', 'IMAP c-Client');
U_module('ldap_bind', 'ldap', 'LDAP');
if (defined('XML_SAX_IMPL') && constant('XML_SAX_IMPL') == 'libxml')
U_module_libxml();
U_module('mb_language', 'mbstring', 'mbstring');
U_module('mcal_append_event', 'mcal', 'MCAL');
if (function_exists('udm_errno'))
U_module_mnogosearch();
U_module('msql', 'msql', 'mSQL');
if (function_exists('mysql_connect'))
U_module_mysql();
if (function_exists('mcrypt_cbc'))
{
U_module_mcrypt();
U_options('mcrypt');
}
U_module('mhash', 'mhash', 'MHASH');
if (U_module('mime_content_type', 'mime_magic', 'mime_magic'))
U_options('mime_magic');
if (U_module('odbc_close', 'odbc', 'ODBC'))
U_options('odbc');
if (function_exists('xmlrpc_encode'))
U_module_xmlrpc();
U_module('openssl_seal', 'openssl', 'OpenSSL');
U_module('overload', 'overload', 'User-Space Object Overloading');
U_module('preg_match', 'pcre', 'PCRE (Perl Compatible Regular Expressions)');
if (function_exists('pg_close'))
U_module_pgsql();
if (function_exists('pdf_close'))
U_module_pdf();
U_module('posix_getcwd', 'posix', 'POSIX');
U_module('pspell_add_to_personal', 'pspell', 'PSpell');
if (function_exists('session_start'))
U_module_session();
U_module('simplexml_load_file', 'SimpleXML', 'Simplexml');
U_module('shmop_close', 'shmop', 'shmop');
U_module('msg_receive', 'sysvmsg', 'sysvmsg');
U_module('socket_accept', 'sockets', 'Sockets');
U_module_spl();
if (function_exists('sqlite_close'))
U_module_sqlite();
if (U_module('tidy_diagnose', 'tidy', 'libTidy', 'U_module_tidy_callback') && !class_exists('Tidy'))
{
echo '<table border="0" cellpadding="3" width="600">','
<tr class="h"><th>Tidy Configuration Directive</th><th>Value</th></tr>';
U_table(tidy_getopt(), '<tr><td class="e">%s</td><td class="v">%s</td></tr>');
echo '</table>';
}
U_module('token_get_all', 'tokenizer', 'Tokenizer');
U_module('wddx_add_vars', 'wddx', 'WDDX');
if (function_exists('extension_loaded') && extension_loaded('Zend Optimizer'))
U_module(true, 'Zend Optimizer', 'Zend Optimizer', 'U_module_zendoptimizer_callback');
U_module('zip_open', 'zip', 'Zip');
if (U_module('gzclose', 'zlib', 'Zlib'))
U_options('zlib');
if (U_module('sha256', 'varfilter', 'Hardening-Patch\'s variable filter support'))
{
U_options('hphp');
U_options('varfilter');
}
U_module('xml_parse', 'xml', 'XML');
U_module('xslt_create', 'xslt', 'XSLT');
U_module('yp_errno', 'yp', 'YP');
?>
<?php if (function_exists('apache_get_version')):?>
<h2><a name="module_apache">apache</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">Apache for <?php echo U_getos()?> </td></tr>
</table><br />
<table border="0" cellpadding="3" width="600">
<tr><td class="e">Apache Version </td><td class="v"><?php echo apache_get_version()?></td></tr>
<tr><td class="e">Hostname:Port </td><td class="v"><?php echo $_SERVER['SERVER_NAME'],':',$_SERVER['SERVER_PORT']?></td></tr>
<?php if (function_exists('apache_get_modules')):?>
<tr><td class="e">Loaded Modules </td><td class="v"><?php echo implode(', ', apache_get_modules())?></td></tr>
<?php endif?>
</table><br />
<?endif?>
<?php
U_module_additional();
U_module_unknown();
?>
<h2>PHP Variables</h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>Variable</th><th>Value</th></tr>
<?php
if ((float) PHP_VERSION >= 4.1)
$vars = array('_REQUEST', '_COOKIE', '_SERVER', '_ENV'); else
$vars = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_ENV_VARS');
foreach ($vars as $var)
U_table ($$var, '<tr><td class="e">%s</td><td class="v">%s</td></tr>', $var);
?>
</table>
<?php
// Functions
function U_sapi()
{
switch(PHP_SAPI)
{
case 'apache2handler': return 'Apache 2.0 Handler';
case 'apache': return 'Apache';
case 'cgi': return 'CGI';
default: return PHP_SAPI;
}
}
function U_getos()
{
if (function_exists('php_uname')) return php_uname();
if (PHP_OS == 'WINNT')
return 'Windows NT';
return PHP_OS;
}
function U_table($array, $template, $flag = false)
{
foreach ($array as $key=>$value)
{
if ($flag === true)
{
if ($value <> '')
printf($template, $key, $value == 1 ? 'enabled' : $value);
}
else
{
if ($flag !== false)
$key = $flag.'["'.$key.'"]';
printf($template, $key, U_value($value));
}
}
}
function U_value($value)
{
if ($value == '') return '<i>no value</i>';
if (is_bool($value)) return $value ? 'TRUE' : 'FALSE';
if ($value === null) return 'NULL';
if (is_object($value)) $value = (array) $value;
if (is_array($value))
{
ob_start();
print_r($value);
$value = ob_get_contents();
ob_end_clean();
}
return U_wordwrap((string) $value);
}
function U_wordwrap($str)
{
$str = wordwrap(htmlspecialchars($str), 100, '<wbr />', true);
return preg_replace('!(&[^;]*)<wbr />([^;]*;)!', '$1$2<wbr />', $str);
}
function U_module($func, $header, $module, $callback = false)
{
$GLOBALS['known_modules'][] = strtolower($header);
if ($func === true || function_exists($func))
{
if ($callback === false)
{
$module.= ' support';
$value = 'enabled';
}
else
{
$value = call_user_func($callback);
}
echo <<<MODULE_INFO
<h2><a name="module_{$header}">$header</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">$module</td><td class="v">$value</td></tr>
</table><br />
MODULE_INFO;
return true;
}
return false;
}
function U_module_gd()
{
$GLOBALS['known_modules'][] = 'gd';
echo <<<GD_INFO_HEADER
<h2><a name="module_gd">gd</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">GD Support </td><td class="v">enabled </td></tr>
GD_INFO_HEADER;
if (function_exists('1gd_info'))
U_table(gd_info(), '<tr><td class="e">%s</td><td class="v">%s</td></tr>', true); else
{
$version = false;
$versions = array
(
'imagejpeg' => '1.8.0',
'image2wbmp' => '1.8.0',
'imagealphablending' => '2.0.1',
'imagesetthickness' => '2.0.1',
'imagetruecolortopalette' => '2.0.1',
'imageellipse' => '2.0.2',
);
foreach ($versions as $key=>$value)
if (function_exists($key)) $version = $value;
if ($version === false)
$version = 'unknown'; else
$version.= ' compatible';
if (function_exists('imageantialias') || function_exists('imagecolormatch')
|| function_exists('imagefilter') || function_exists('imagelayereffect') ||
function_exists('imagerotate'))
$version = "bundled ($version)";
echo "<tr><td class=\"e\">GD Version </td><td class=\"v\">$version</td></tr>";
if (function_exists('imagepscopyfont'))
echo '<tr><td class="e">T1Lib Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagettftext'))
echo '<tr><td class="e">FreeType Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagecreatefromgif'))
echo '<tr><td class="e">GIF Read Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagegif'))
echo '<tr><td class="e">GIF Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagejpeg'))
echo '<tr><td class="e">JPEG Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagepng'))
echo '<tr><td class="e">PNG Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagewbmp'))
echo '<tr><td class="e">WBMP Support </td><td class="v">enabled </td></tr>';
if (function_exists('imagecreatefromxbm'))
echo '<tr><td class="e">XBM Support </td><td class="v">enabled </td></tr>';
}
echo '</table><br />';
}
function U_module_session()
{
$GLOBALS['known_modules'][] = 'session';
echo <<<SESSION_INFO
<h2><a name="module_session">session</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">Session Support </td><td class="v">enabled </td></tr>
</table><br />
SESSION_INFO;
U_options('session');
}
function U_module_tidy_callback()
{
$GLOBALS['known_modules'][] = 'tidy';
if (function_exists('tidy_get_release')) return tidy_get_release();
return function_exists('tidy_setopt') ? '1.xx' : '2.00 or later';
}
function U_module_libxml()
{
$GLOBALS['known_modules'][] = 'libxml';
$version = defined('LIBXML_DOTTED_VERSION') ? LIBXML_DOTTED_VERSION : 'unknown';
echo <<<LIBXML_INFO
<h2><a name="module_libxml">libxml</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">libXML support </td><td class="v">active </td></tr>
<tr><td class="e">libXML Version </td><td class="v">$version </td></tr>
LIBXML_INFO;
echo '</table><br />';
}
function U_module_mcrypt()
{
$GLOBALS['known_modules'][] = 'mcrypt';
// get_defined_constants only in PHP 4.1.0+!
$modes = array('MCRYPT_MODE_ECB', 'MCRYPT_MODE_CBC', 'MCRYPT_MODE_CFB',
'MCRYPT_MODE_OFB', 'MCRYPT_MODE_NOFB', 'MCRYPT_MODE_STREAM');
$cnt = sizeof($modes);
for ($i = 0; $i<$cnt; $i++)
if (defined($modes[$i]))
$modes[$i] = strtolower(substr($modes[$i], 12)); else
unset($modes[$i]);
$modes = implode(' ', $modes);
$crypts = array('3DES', 'ARCFOUR_IV', 'ARCFOUR', 'BLOWFISH', 'BLOWFISH_COMPAT',
'CAST_128', 'CAST_256', 'CRYPT', 'DES', 'DES_COMPAT', 'ENIGMA',
'GOST', 'IDEA', 'LOKI97', 'MARS', 'PANAMA', 'RIJNDAEL_128',
'RIJNDAEL_192', 'RIJNDAEL_256', 'RC2', 'RC4', 'RC6', 'RC6_128',
'RC6_192', 'RC6_256', 'SAFER64', 'SAFER128', 'SAFERPLUS',
'SERPENT', 'SERPENT_128', 'SERPENT_192', 'SERPENT_256', 'SKIPJACK',
'TEAN', 'THREEWAY', 'TRIPLEDES', 'TWOFISH', 'TWOFISH128',
'TWOFISH192', 'TWOFISH256', 'WAKE', 'XTEA');
$cnt = sizeof($crypts);
for ($i = 0; $i<$cnt; $i++)
if (defined('MCRYPT_'.$crypts[$i]))
$crypts[$i] = str_replace('_', '-', strtolower($crypts[$i])); else
unset($crypts[$i]);
$crypts = implode(' ', $crypts);
$version = defined('MCRYPT_MODE_STREAM') ? '2.4.x' : '2.2.x';
echo <<<INFO
<h2><a name="module_mcrypt">mcrypt</a></h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>mcrypt support</th><th>enabled</th></tr>
<tr><td class="e">version </td><td class="v">>= $version </td></tr>
<tr><td class="e">Supported ciphers </td><td class="v">$crypts</td></tr>
<tr><td class="e">Supported modes </td><td class="v">$modes</td></tr>
</table><br />
INFO;
}
function U_module_mysql()
{
$GLOBALS['known_modules'][] = 'mysql';
$client_api = function_exists('mysql_get_client_info') ?
mysql_get_client_info() :
'unknown';
echo <<<MYSQL_INFO
<h2><a name="module_mysql">mysql</a></h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>MySQL Support</th><th>enabled</th></tr>
<tr><td class="e">Client API version </td><td class="v">$client_api</td></tr>
</table><br />
MYSQL_INFO;
U_options('mysql');
}
function U_module_sqlite()
{
$GLOBALS['known_modules'][] = 'sqlite';
$enc = sqlite_libencoding();
$libver = sqlite_libversion();
echo <<<SQLITE_INFO
<h2><a name="module_SQLite">SQLite</a></h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>SQLite support</th><th>enabled</th></tr>
<tr><td class="e">SQLite Library </td><td class="v">$libver</td></tr>
<tr><td class="e">SQLite Encoding </td><td class="v">$enc</td></tr>
</table><br />
SQLITE_INFO;
}
function U_options($prefix)
{
// PHP 4.2.0
if (function_exists('ini_get_all'))
{
$prefix .= '.';
$prefix_len = strlen($prefix);
echo '<table border="0" cellpadding="3" width="600">',
'<tr class="h"><th>Directive</th><th>Local Value</th><th>Master Value</th></tr>';
foreach (ini_get_all() as $key=>$value)
{
if (substr($key, 0, $prefix_len) == $prefix)
printf('<tr><td class="e">%s</td><td class="v">%s</td><td class="v">%s</td></tr>',
$key, U_value($value['local_value']), U_value($value['global_value']));
}
echo '</table>';
return true;
}
return false;
}
function U_module_dba()
{
$GLOBALS['known_modules'][] = 'dba';
echo <<<DBA_INFO
<h2><a name="module_dba">dba</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">DBA support</td><td class="v">enabled</td></tr>
DBA_INFO;
if (function_exists('dba_handlers'))
echo '<tr><td class="e">Supported Handlers</td><td class="v">',
implode(', ', dba_handlers()),'</td></tr>';
echo '</table><br />';
}
function U_module_curl()
{
$GLOBALS['known_modules'][] = 'curl';
$version = curl_version();
echo <<<CURL_INFO
<h2><a name="module_curl">curl</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">CURL support </td><td class="v">enabled </td></tr>
<tr><td class="e">CURL Information </td><td class="v">$version</td></tr>
</table><br />
CURL_INFO;
}
function U_module_pdf()
{
$GLOBALS['known_modules'][] = 'pdf';
if (function_exists('pdf_get_majorversion'))
$version = pdf_get_majorversion().'.'.pdf_get_minorversion(); else
$version = 'unknown';
echo <<<PDF_INFO
<h2><a name="module_pdf">pdf</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">PDF Support </td><td class="v">enabled </td></tr>
<tr><td class="e">PDFlib GmbH Version </td><td class="v">$version.x</td></tr>
</table><br />
PDF_INFO;
}
function U_module_pgsql()
{
$GLOBALS['known_modules'][] = 'pgsql';
$version = '6.5 or later';
if (function_exists('pg_escape_bytea') || function_exists('pg_escape_string'))
$verstion = '7.2 or later'; else
if (function_exists('pg_client_encoding') || function_exists('pg_set_client_encoding'))
$version = '7.0 or later';
echo <<<PGSQL_INFO
<h2><a name="module_pgsql">pgsql</a></h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>PostgreSQL Support</th><th>enabled</th></tr>
<tr><td class="e">PostgreSQL Version </td><td class="v">$version</td></tr>
</table><br />
PGSQL_INFO;
U_options('pgsql');
}
function U_module_additional()
{
$modules = array();
if (function_exists('chat_check_pass')) $modules[] = 'Chat Database module';
if (function_exists('dbase_close')) $modules[] = 'dbase';
if (function_exists('filepro')) $modules[] = 'filepro';
if (function_exists('readline')) $modules[] = 'readline';
if (function_exists('sem_get')) $modules[] = 'sysvsem';
if (function_exists('shm_attach'))$modules[] = 'sysvshm';
$GLOBALS['known_modules'] = array_merge($GLOBALS['known_modules'], $modules);
if ((bool) $modules)
{
echo '<h2>Additional Modules</h2>',
'<table border="0" cellpadding="3" width="600">',
'<tr class="h"><th>Module Name</th></tr>';
U_table($modules, '<tr><td>%2$s</td></tr>');
echo '</table><br />';
}
}
function U_module_mnogosearch()
{
$GLOBALS['known_modules'][] = 'mnogosearch';
if (function_exists('udm_api_version'))
$version = udm_api_version(); else
$version = 'unknown';
echo <<<MNOGOSEARCH_INFO
<h2><a name="module_mnogosearch">mnogosearch</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">mnoGoSearch Support </td><td class="v">enabled </td></tr>
<tr><td class="e">mnoGoSearch library version </td><td class="v">$version</td></tr>
</table><br />
MNOGOSEARCH_INFO;
}
function U_module_xmlrpc()
{
$GLOBALS['known_modules'][] = 'xmlrpc';
echo <<<XMLRPC_INFO
<h2><a name="module_xmlrpc">xmlrpc</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">author </td><td class="v">Dan Libby </td></tr>
<tr><td class="e">homepage </td><td class="v">http://xmlrpc-epi.sourceforge.net </td></tr>
<tr><td class="e">open sourced by </td><td class="v">Epinions.com </td></tr>
</table><br />
XMLRPC_INFO;
}
function U_module_domxml()
{
$GLOBALS['known_modules'][] = 'domxml';
$version = domxml_version();
$props = array
(
'XPath Support' => 'xpath_eval',
'XPointer Support' => 'xptr_eval',
'DOM/XSLT' => 'domxml_xslt_stylesheet',
);
echo <<<DOMXML_INFO
<h2><a name="module_domxml">domxml</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">DOM/XML </td><td class="v">enabled </td></tr>
<tr><td class="e">libxml Version </td><td class="v">$version</td></tr>
DOMXML_INFO;
foreach ($props as $str=>$func)
if (function_exists($func))
echo "<tr><td class=\"e\">$str</td><td class=\"v\">enabled</td></tr>";
echo '</table><br />';
}
function U_module_spl()
{
$GLOBALS['known_modules'][] = 'spl';
if (function_exists('spl_classes'))
$classes = array_keys(spl_classes()); else
$classes = array('ArrayObject', 'ArrayIterator', 'CachingIterator',
'CachingRecursiveIterator', 'DirectoryIterator', 'FilterIterator',
'LimitIterator', 'ParentIterator', 'RecursiveDirectoryIterator',
'RecursiveIteratorIterator', 'SimpleXMLIterator');
// SPL - PHP 5.0 module, array_filter must exists
$classes = array_filter($classes, 'class_exists');
if ((bool) $classes)
{
$classes = implode(', ', $classes);
echo <<<SPL_INFO
<h2><a name="module_SPL">SPL</a></h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>SPL support</th><th>enabled</th></tr>
<tr><td class="e">Classes </td><td class="v">$classes</td></tr>
</table><br />
SPL_INFO;
}
}
function U_module_unknown()
{
global $known_modules;
if (!function_exists('get_loaded_extensions')) return;
$loaded = array_map('strtolower', get_loaded_extensions());
$unknown_modules = array();
foreach($loaded as $module)
if (!in_array($module, $known_modules))
$unknown_modules[] = $module;
if ((bool) $unknown_modules)
{
echo '<h2>Unknown Modules</h2>',
'<table border="0" cellpadding="3" width="600">',
'<tr class="h"><th>Module Name</th></tr>';
U_table($unknown_modules, '<tr><td>%2$s</td></tr>');
echo '</table><br />';
}
}
function U_module_zendoptimizer_callback()
{
if (defined('OPTIMIZER_VERSION')) return OPTIMIZER_VERSION;
return 'enabled';
}
function U_module_core()
{
echo <<<CORE_INFO
<h2>PHP Core</h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>Directive</th><th>Value</th></tr>
CORE_INFO;
$fields = array
(
'include_path' => 'get_include_path',
'magic_quotes_gpc' => 'get_magic_quotes_gpc',
'magic_quotes_runtime' => 'get_magic_quotes_runtime',
);
foreach ($fields as $name=>$func)
if (function_exists($func))
{
$value = call_user_func($func);
if (is_numeric($value))
{
if ($value == 1) $value = 'On'; else
if ($value == 0) $value = 'Off';
}
else
$value = U_value($value);
printf('<tr><td class="e">%s</td><td class="v">%s</td></tr>', $name, $value);
}
echo '</table><br />';
}
function U_streams()
{
if (function_exists('stream_get_wrappers'))
return implode(', ', stream_get_wrappers());
if (function_exists('set_error_handler'))
{
$hs = array('php', 'http', 'https', 'ftp',
'ftps', 'zlib', 'compress.zlib', 'compress.bzip2', 'ogg');
global $G_NOT_REGISTERED_STREAMS, $G_CURRENT_STREAM_URL;
$handler = set_error_handler('U_streams_callback');
foreach ($hs as $G_CURRENT_STREAM_URL)
fopen($G_CURRENT_STREAM_URL.'://', 'r');
restore_error_handler($handler);
return implode(', ', array_diff($hs, $G_NOT_REGISTERED_STREAMS));
}
return '<i>cannot detect</i>';
}
function U_streams_callback($errno, $errstr)
{
if ($errno == 8)
$GLOBALS['G_NOT_REGISTERED_STREAMS'][] = $GLOBALS['G_CURRENT_STREAM_URL'];
}
?>