4 || isset($_GET['SUMMARY']) ) {
if ( ($pidfile=ini_get('pid')) || ($pidfile=ini_get('hhvm.pid_file')) ) {
$uptime=($pidfile)&&($mtime=@filemtime($pidfile))?(new DateTime('@'.$mtime))->diff(new DateTime('NOW'))->format('%a days, %h hours, %i minutes'):'
unknown';
if ( !($inifile=(function_exists('php_ini_loaded_file')?php_ini_loaded_file():'')) && ($pid=@file_get_contents($pidfile))
&& ($cmdline=@file_get_contents("/proc/$pid/cmdline")) ) { $inifile=preg_match('@-?-c(onfig)?\s*([^ ]+?)($|\s|--)@',$cmdline,$match)?$match[2]:''; }
} else { $uptime=$inifile='unknown'; }
print_table( array(
'Host'=>function_exists('gethostname')?@gethostname():@php_uname('n'),
'System'=>php_uname(),
'PHP Version'=>phpversion(),
'HHVM Version'=>ini_get('hphp.compiler_version'),
'HHVM compiler id'=>ini_get('hphp.compiler_id'),
'SAPI'=>php_sapi_name().' '.ini_get('hhvm.server.type'),
'Loaded Configuration File'=>$inifile,
'Uptime'=>$uptime,
));
}
if ( isset($_GET['INI']) && $ini=ini_get_all() ) {
ksort($ini); echo 'ini
'; print_table($ini,array('Directive','Local Value','Master Value','Access'),false);
echo 'access level legend
';
print_table(array('Entry can be set in user scripts, ini_set()'=>INI_USER,'Entry can be set in php.ini, .htaccess, httpd.conf'=>INI_PERDIR,
'Entry can be set in php.ini or httpd.conf'=>INI_SYSTEM,'Entry can be set anywhere
'=>INI_ALL ));
}
if ( isset($_GET['EXTENSIONS']) && $extensions=get_loaded_extensions(true) ) {
echo 'extensions
'; natcasesort( $extensions); print_table($extensions,false,true);
}
if ( isset($_GET['FUNCTIONS']) && $functions=get_defined_functions() ) {
echo 'functions
'; natcasesort( $functions['internal']); print_table($functions['internal'],false,true);
}
if ( isset($_GET['CONSTANTS']) && $constants=get_defined_constants(true) ) {
ksort( $constants); foreach ( $constants as $key=>$value) { if (!empty($value)) { ksort( $value); echo 'Constants (',$key,')
'; print_table($value); } }
}
if ( isset($_GET['GLOBALS']) ) {
if (0) { $_SERVER; $_ENV; $_SESSION; $_COOKIE; $_GET; $_POST; $_REQUEST; $_FILES; } // PHP 5.4+ JIT
$order=array_flip(array('_SERVER','_ENV','_COOKIE','_GET','_POST','_REQUEST','_FILES'));
foreach ( $order as $key=>$ignore ) { if ( isset($GLOBALS[$key]) ) { echo '$',$key,'
'; if ( empty($GLOBALS[$key]) ) { echo '
'; } else { print_table( $GLOBALS[$key]); } } }
natcasesort($globals); $globals=array_flip($globals); unset( $globals['GLOBALS'] );
foreach ( $globals as $key=>$ignore ) { if ( !isset($order[$key]) ) { echo '$',$key,'
'; if ( empty($GLOBALS[$key]) ) { echo '
'; } else { print_table( $GLOBALS[$key]); } } }
}
?>