Verzeichnisstruktur phpBB-3.3.16


Veröffentlicht
27.04.2026

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

defineparser.php

Zuletzt modifiziert: 01.05.2026, 11:26 - Dateigröße: 1.93 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  * @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
 08  * @license GNU General Public License, version 2 (GPL-2.0)
 09  *
 10  * For full copyright and license information, please see
 11  * the docs/CREDITS.txt file.
 12  *
 13  */
 14   
 15  namespace phpbb\template\twig\tokenparser;
 16   
 17  class defineparser extends \Twig\TokenParser\AbstractTokenParser
 18  {
 19      /**
 20      * Parses a token and returns a node.
 21      *
 22      * @param \Twig\Token $token A Twig\Token instance
 23      *
 24      * @return \Twig\Node\Node A Twig\Node instance
 25      * @throws \Twig\Error\SyntaxError
 26      * @throws \phpbb\template\twig\node\definenode
 27      */
 28      public function parse(\Twig\Token $token)
 29      {
 30          $lineno = $token->getLine();
 31          $stream = $this->parser->getStream();
 32          $name = $this->parser->getExpressionParser()->parseExpression();
 33   
 34          $capture = false;
 35          if ($stream->test(\Twig\Token::OPERATOR_TYPE, '='))
 36          {
 37              $stream->next();
 38              $value = $this->parser->getExpressionParser()->parseExpression();
 39   
 40              if ($value instanceof \Twig\Node\Expression\NameExpression)
 41              {
 42                  // This would happen if someone improperly formed their DEFINE syntax
 43                  // e.g. <!-- DEFINE $VAR = foo -->
 44                  throw new \Twig\Error\SyntaxError('Invalid DEFINE', $token->getLine(), $this->parser->getStream()->getSourceContext()->getPath());
 45              }
 46   
 47              $stream->expect(\Twig\Token::BLOCK_END_TYPE);
 48          }
 49          else
 50          {
 51              $capture = true;
 52   
 53              $stream->expect(\Twig\Token::BLOCK_END_TYPE);
 54   
 55              $value = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
 56              $stream->expect(\Twig\Token::BLOCK_END_TYPE);
 57          }
 58   
 59          return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag());
 60      }
 61   
 62      public function decideBlockEnd(\Twig\Token $token)
 63      {
 64          return $token->test('ENDDEFINE');
 65      }
 66   
 67      /**
 68      * Gets the tag name associated with this token parser.
 69      *
 70      * @return string The tag name
 71      */
 72      public function getTag()
 73      {
 74          return 'DEFINE';
 75      }
 76  }
 77