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

Debug.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 1.72 KiB


01  <?php
02   
03  /*
04   * This file is part of Twig.
05   *
06   * (c) 2011 Fabien Potencier
07   *
08   * For the full copyright and license information, please view the LICENSE
09   * file that was distributed with this source code.
10   */
11  class Twig_Extension_Debug extends Twig_Extension
12  {
13      public function getFunctions()
14      {
15          // dump is safe if var_dump is overridden by xdebug
16          $isDumpOutputHtmlSafe = extension_loaded('xdebug')
17              // false means that it was not set (and the default is on) or it explicitly enabled
18              && (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump'))
19              // false means that it was not set (and the default is on) or it explicitly enabled
20              // xdebug.overload_var_dump produces HTML only when html_errors is also enabled
21              && (false === ini_get('html_errors') || ini_get('html_errors'))
22              || 'cli' === php_sapi_name()
23          ;
24   
25          return array(
26              new Twig_SimpleFunction('dump', 'twig_var_dump', array('is_safe' => $isDumpOutputHtmlSafe ? array('html') : array(), 'needs_context' => true, 'needs_environment' => true)),
27          );
28      }
29   
30      public function getName()
31      {
32          return 'debug';
33      }
34  }
35   
36  function twig_var_dump(Twig_Environment $env, $context)
37  {
38      if (!$env->isDebug()) {
39          return;
40      }
41   
42      ob_start();
43   
44      $count = func_num_args();
45      if (2 === $count) {
46          $vars = array();
47          foreach ($context as $key => $value) {
48              if (!$value instanceof Twig_Template) {
49                  $vars[$key] = $value;
50              }
51          }
52   
53          var_dump($vars);
54      } else {
55          for ($i = 2; $i < $count; ++$i) {
56              var_dump(func_get_arg($i));
57          }
58      }
59   
60      return ob_get_clean();
61  }
62