Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
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 |
ProfilerExtension.php
01 <?php
02
03 /*
04 * This file is part of Twig.
05 *
06 * (c) 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 namespace Twig\Extension;
13
14 use Twig\Profiler\NodeVisitor\ProfilerNodeVisitor;
15 use Twig\Profiler\Profile;
16
17 class ProfilerExtension extends AbstractExtension
18 {
19 private $actives = [];
20
21 public function __construct(Profile $profile)
22 {
23 $this->actives[] = $profile;
24 }
25
26 public function enter(Profile $profile)
27 {
28 $this->actives[0]->addProfile($profile);
29 array_unshift($this->actives, $profile);
30 }
31
32 public function leave(Profile $profile)
33 {
34 $profile->leave();
35 array_shift($this->actives);
36
37 if (1 === \count($this->actives)) {
38 $this->actives[0]->leave();
39 }
40 }
41
42 public function getNodeVisitors()
43 {
44 return [new ProfilerNodeVisitor(static::class)];
45 }
46 }
47
48 class_alias('Twig\Extension\ProfilerExtension', 'Twig_Extension_Profiler');
49