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

Blackfire.php

Zuletzt modifiziert: 09.10.2024, 12:59 - Dateigröße: 1.91 KiB


01  <?php
02   
03  /*
04   * This file is part of Twig.
05   *
06   * (c) 2015 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   
12  /**
13   * @author Fabien Potencier <fabien@symfony.com>
14   */
15  class Twig_Profiler_Dumper_Blackfire
16  {
17      public function dump(Twig_Profiler_Profile $profile)
18      {
19          $data = array();
20          $this->dumpProfile('main()', $profile, $data);
21          $this->dumpChildren('main()', $profile, $data);
22   
23          $start = microtime(true);
24          $str = <<<EOF
25  file-format: BlackfireProbe
26  cost-dimensions: wt mu pmu
27  request-start: {$start}
28   
29   
30  EOF;
31   
32   
33          foreach ($data as $name => $values) {
34              $str .= "{$name}//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n";
35          }
36   
37          return $str;
38      }
39   
40      private function dumpChildren($parent, Twig_Profiler_Profile $profile, &$data)
41      {
42          foreach ($profile as $p) {
43              if ($p->isTemplate()) {
44                  $name = $p->getTemplate();
45              } else {
46                  $name = sprintf('%s::%s(%s)', $p->getTemplate(), $p->getType(), $p->getName());
47              }
48              $this->dumpProfile(sprintf('%s==>%s', $parent, $name), $p, $data);
49              $this->dumpChildren($name, $p, $data);
50          }
51      }
52   
53      private function dumpProfile($edge, Twig_Profiler_Profile $profile, &$data)
54      {
55          if (isset($data[$edge])) {
56              $data[$edge]['ct'] += 1;
57              $data[$edge]['wt'] += floor($profile->getDuration() * 1000000);
58              $data[$edge]['mu'] += $profile->getMemoryUsage();
59              $data[$edge]['pmu'] += $profile->getPeakMemoryUsage();
60          } else {
61              $data[$edge] = array(
62                  'ct' => 1,
63                  'wt' => floor($profile->getDuration() * 1000000),
64                  'mu' => $profile->getMemoryUsage(),
65                  'pmu' => $profile->getPeakMemoryUsage(),
66              );
67          }
68      }
69  }
70