indvdum@0: tpl_name = 'acp_php_info'; indvdum@0: $this->page_title = 'ACP_PHP_INFO'; indvdum@0: indvdum@0: ob_start(); indvdum@0: phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES); indvdum@0: $phpinfo = ob_get_clean(); indvdum@0: indvdum@0: $phpinfo = trim($phpinfo); indvdum@0: indvdum@0: // Here we play around a little with the PHP Info HTML to try and stylise indvdum@0: // it along phpBB's lines ... hopefully without breaking anything. The idea indvdum@0: // for this was nabbed from the PHP annotated manual indvdum@0: preg_match_all('#]*>(.*)#si', $phpinfo, $output); indvdum@0: indvdum@0: if (empty($phpinfo) || empty($output)) indvdum@0: { indvdum@0: trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); indvdum@0: } indvdum@0: indvdum@0: $output = $output[1][0]; indvdum@0: indvdum@0: // expose_php can make the image not exist indvdum@0: if (preg_match('#]*>]*>#', $output)) indvdum@0: { indvdum@0: $output = preg_replace('#(.*?]*>]*>)(.*?)#s', '
\2\1
', $output); indvdum@0: } indvdum@0: else indvdum@0: { indvdum@0: $output = preg_replace('#(.*?)#s', '
\1
', $output); indvdum@0: } indvdum@0: $output = preg_replace('#]+>#i', '', $output); indvdum@0: $output = preg_replace('#', ''), array('class="row1"', 'class="row2"', '', '', ''), $output); indvdum@0: indvdum@0: // Fix invalid anchor names (eg "module_Zend Optimizer") indvdum@0: $output = preg_replace_callback('##', array($this, 'remove_spaces'), $output); indvdum@0: indvdum@0: if (empty($output)) indvdum@0: { indvdum@0: trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); indvdum@0: } indvdum@0: indvdum@0: $orig_output = $output; indvdum@0: indvdum@0: preg_match_all('#
(.*)
#siU', $output, $output); indvdum@0: $output = (!empty($output[1][0])) ? $output[1][0] : $orig_output; indvdum@0: indvdum@0: $template->assign_var('PHPINFO', $output); indvdum@0: } indvdum@0: indvdum@0: function remove_spaces($matches) indvdum@0: { indvdum@0: return '
'; indvdum@0: } indvdum@0: } indvdum@0: indvdum@0: ?>