Verzeichnisstruktur phpBB-3.0.0


Veröffentlicht
12.12.2007

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

acp_php_info.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 2.18 KiB


 01  <?php
 02  /**
 03  *
 04  * @package acp
 05  * @version $Id$
 06  * @copyright (c) 2005 phpBB Group
 07  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 08  *
 09  */
 10   
 11  /**
 12  * @ignore
 13  */
 14  if (!defined('IN_PHPBB'))
 15  {
 16      exit;
 17  }
 18   
 19  /**
 20  * @package acp
 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))
 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          if (empty($output))
 71          {
 72              trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING);
 73          }
 74   
 75          $orig_output = $output;
 76   
 77          preg_match_all('#<div class="center">(.*)</div>#siU', $output, $output);
 78          $output = (!empty($output[1][0])) ? $output[1][0] : $orig_output;
 79   
 80          $template->assign_var('PHPINFO', $output);
 81      }
 82  }
 83   
 84  ?>