HHVMinfo

ALL " href="?INI">ini href="?EXTENSIONS">Extensions href="?FUNCTIONS">Functions href="?CONSTANTS">Constants href="?GLOBALS">Globals
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]); } } } } ?>
'; if ( !empty($headers) ) { if ( !is_array( $headers) ) { $headers=array_keys( reset( $array) ); } echo ''; foreach ( $headers as $value) { echo '',$value,''; } echo ''; } foreach ( $array as $key=>$value ) { echo ''; if ( !is_numeric( $key) || !$formatkeys ) { echo '',($formatkeys?ucwords(str_replace('_',' ',$key)):$key),''; } if ( is_array($value) ) { foreach ($value as $column) { echo '',format_special($column,$formatnumeric),''; } } else { echo '',format_special($value,$formatnumeric),''; } echo ''; } echo ''; } function format_special( $value, $formatnumeric ) { if ( is_array($value) ) { $value='array'; } elseif ( is_object($value) ) { $value='object'; } elseif ( $value===true ) { $value='true'; } elseif ( $value===false ) { $value='false'; } elseif ( $value===NULL ) { $value='null'; } elseif ( $value===0 || $value===0.0 || $value==='0' ) { $value='0'; } elseif ( empty($value) ) { $value='no value'; } elseif ( is_string($value) && strlen($value)>50 ) { $value=implode('​',str_split($value,45)); } elseif ( $formatnumeric && is_numeric($value) ) { if ( $value>1048576 ) { $value=round($value/1048576,1).'M'; } elseif ( is_float($value) ) { $value=round($value,1); } } return $value; }