Verzeichnisstruktur phpBB-3.1.0
- Veröffentlicht
- 27.10.2014
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
acp_php_info.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 /**
15 * @ignore
16 */
17 if (!defined('IN_PHPBB'))
18 {
19 exit;
20 }
21
22 class acp_php_info
23 {
24 var $u_action;
25
26 function main($id, $mode)
27 {
28 global $db, $user, $auth, $template;
29 global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
30
31 if ($mode != 'info')
32 {
33 trigger_error('NO_MODE', E_USER_ERROR);
34 }
35
36 $this->tpl_name = 'acp_php_info';
37 $this->page_title = 'ACP_PHP_INFO';
38
39 ob_start();
40 phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);
41 $phpinfo = ob_get_clean();
42
43 $phpinfo = trim($phpinfo);
44
45 // Here we play around a little with the PHP Info HTML to try and stylise
46 // it along phpBB's lines ... hopefully without breaking anything. The idea
47 // for this was nabbed from the PHP annotated manual
48 preg_match_all('#<body[^>]*>(.*)</body>#si', $phpinfo, $output);
49
50 if (empty($phpinfo) || empty($output[1][0]))
51 {
52 trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING);
53 }
54
55 $output = $output[1][0];
56
57 // expose_php can make the image not exist
58 if (preg_match('#<a[^>]*><img[^>]*></a>#', $output))
59 {
60 $output = preg_replace('#<tr class="v"><td>(.*?<a[^>]*><img[^>]*></a>)(.*?)</td></tr>#s', '<tr class="row1"><td><table class="type2"><tr><td>\2</td><td>\1</td></tr></table></td></tr>', $output);
61 }
62 else
63 {
64 $output = preg_replace('#<tr class="v"><td>(.*?)</td></tr>#s', '<tr class="row1"><td><table class="type2"><tr><td>\1</td></tr></table></td></tr>', $output);
65 }
66 $output = preg_replace('#<table[^>]+>#i', '<table>', $output);
67 $output = preg_replace('#<img border="0"#i', '<img', $output);
68 $output = str_replace(array('class="e"', 'class="v"', 'class="h"', '<hr />', '<font', '</font>'), array('class="row1"', 'class="row2"', '', '', '<span', '</span>'), $output);
69
70 // Fix invalid anchor names (eg "module_Zend Optimizer")
71 $output = preg_replace_callback('#<a name="([^"]+)">#', array($this, 'remove_spaces'), $output);
72
73 if (empty($output))
74 {
75 trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING);
76 }
77
78 $orig_output = $output;
79
80 preg_match_all('#<div class="center">(.*)</div>#siU', $output, $output);
81 $output = (!empty($output[1][0])) ? $output[1][0] : $orig_output;
82
83 $template->assign_var('PHPINFO', $output);
84 }
85
86 function remove_spaces($matches)
87 {
88 return '<a name="' . str_replace(' ', '_', $matches[1]) . '">';
89 }
90 }
91