[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/template/twig/node/ -> php.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\template\twig\node;
  15  
  16  class php extends \Twig_Node
  17  {
  18      /** @var \Twig_Environment */
  19      protected $environment;
  20  
  21  	public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
  22      {
  23          $this->environment = $environment;
  24  
  25          parent::__construct(array('text' => $text), array(), $lineno, $tag);
  26      }
  27  
  28      /**
  29      * Compiles the node to PHP.
  30      *
  31      * @param \Twig_Compiler A Twig_Compiler instance
  32      */
  33  	public function compile(\Twig_Compiler $compiler)
  34      {
  35          $compiler->addDebugInfo($this);
  36  
  37          $config = $this->environment->get_phpbb_config();
  38  
  39          if (!$config['tpl_allow_php'])
  40          {
  41              $compiler
  42                  ->write("// PHP Disabled\n")
  43              ;
  44  
  45              return;
  46          }
  47  
  48          $compiler
  49              ->raw($this->getNode('text')->getAttribute('data'))
  50          ;
  51      }
  52  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1