moodle/admin/phpinfo.php

34 lines
964 B
PHP
Raw Normal View History

<?PHP // $Id$
// phpinfo.php - shows phpinfo for the current server
require_once("../config.php");
2006-09-15 08:59:02 +00:00
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('phpinfo');
admin_externalpage_print_header();
2006-09-15 08:59:02 +00:00
echo '<div class="phpinfo">';
ob_start();
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
$html = ob_get_contents();
ob_end_clean();
/// Delete styles from output
2006-09-15 08:59:02 +00:00
$html = preg_replace('#(\n?<style[^>]*?>.*?</style[^>]*?>)|(\n?<style[^>]*?/>)#is', '', $html);
$html = preg_replace('#(\n?<head[^>]*?>.*?</head[^>]*?>)|(\n?<head[^>]*?/>)#is', '', $html);
/// Delete DOCTYPE from output
$html = preg_replace('/<!DOCTYPE html PUBLIC.*?>/is', '', $html);
/// Delete body and html tags
$html = preg_replace('/<html.*?>.*?<body.*?>/is', '', $html);
$html = preg_replace('/<\/body><\/html>/is', '', $html);
2006-09-15 08:59:02 +00:00
echo $html;
echo '</div>';
echo $OUTPUT->footer();
2006-09-15 08:59:02 +00:00
?>