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

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

StopwatchExtension.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.23 KiB


01  <?php
02   
03  /*
04   * This file is part of the Symfony package.
05   *
06   * (c) Fabien Potencier <fabien@symfony.com>
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 Symfony\Bridge\Twig\Extension;
13   
14  use Symfony\Bridge\Twig\TokenParser\StopwatchTokenParser;
15  use Symfony\Component\Stopwatch\Stopwatch;
16  use Twig\Extension\AbstractExtension;
17   
18  /**
19   * Twig extension for the stopwatch helper.
20   *
21   * @author Wouter J <wouter@wouterj.nl>
22   */
23  class StopwatchExtension extends AbstractExtension
24  {
25      private $stopwatch;
26      private $enabled;
27   
28      public function __construct(Stopwatch $stopwatch = null, $enabled = true)
29      {
30          $this->stopwatch = $stopwatch;
31          $this->enabled = $enabled;
32      }
33   
34      public function getStopwatch()
35      {
36          return $this->stopwatch;
37      }
38   
39      public function getTokenParsers()
40      {
41          return [
42              /*
43               * {% stopwatch foo %}
44               * Some stuff which will be recorded on the timeline
45               * {% endstopwatch %}
46               */
47              new StopwatchTokenParser(null !== $this->stopwatch && $this->enabled),
48          ];
49      }
50   
51      public function getName()
52      {
53          return 'stopwatch';
54      }
55  }
56