Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

error_collector.php

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


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  namespace phpbb;
15   
16  class error_collector
17  {
18      var $errors;
19      var $error_types;
20   
21      /**
22       * Constructor.
23       *
24       * The variable $error_types may be set to a mask of PHP error types that
25       * the collector should keep, e.g. `E_ALL`. If unset, the current value of
26       * the error_reporting() function will be used to determine which errors
27       * the collector will keep.
28       *
29       * @see PHPBB3-13306
30       * @param int|null $error_types
31       */
32      function __construct($error_types = null)
33      {
34          $this->errors = array();
35          $this->error_types = $error_types;
36      }
37   
38      function install()
39      {
40          set_error_handler(array(&$this, 'error_handler'), ($this->error_types !== null) ? $this->error_types : error_reporting());
41      }
42   
43      function uninstall()
44      {
45          restore_error_handler();
46      }
47   
48      function error_handler($errno, $msg_text, $errfile, $errline)
49      {
50          $this->errors[] = array($errno, $msg_text, $errfile, $errline);
51      }
52   
53      function format_errors()
54      {
55          $text = '';
56          foreach ($this->errors as $error)
57          {
58              if (!empty($text))
59              {
60                  $text .= "<br />\n";
61              }
62   
63              list($errno, $msg_text, $errfile, $errline) = $error;
64   
65              // Prevent leakage of local path to phpBB install
66              $errfile = phpbb_filter_root_path($errfile);
67   
68              $text .= "Errno $errno$msg_text at $errfile line $errline";
69          }
70   
71          return $text;
72      }
73  }
74