2 // phpinfo.php - shows phpinfo for the current server
4 require_once("../config.php");
5 require_once($CFG->libdir
.'/adminlib.php');
7 $adminroot = admin_get_root();
8 admin_externalpage_setup('phpinfo', $adminroot);
12 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM
, SITEID
));
14 admin_externalpage_print_header($adminroot);
16 echo '<div class="phpinfo">';
19 phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES
);
20 $html = ob_get_contents();
23 /// Delete styles from output
24 $html = preg_replace('#(\n?<style[^>]*?>.*?</style[^>]*?>)|(\n?<style[^>]*?/>)#is', '', $html);
25 $html = preg_replace('#(\n?<head[^>]*?>.*?</head[^>]*?>)|(\n?<head[^>]*?/>)#is', '', $html);
26 /// Delete DOCTYPE from output
27 $html = preg_replace('/<!DOCTYPE html PUBLIC.*?>/is', '', $html);
28 /// Delete body and html tags
29 $html = preg_replace('/<html.*?>.*?<body.*?>/is', '', $html);
30 $html = preg_replace('/<\/body><\/html>/is', '', $html);
36 admin_externalpage_print_footer($adminroot);