diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-13 09:36:24 -0400 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-13 09:36:24 -0400 |
commit | 8352a7cadab7e16eb8eac29d869e06864acb1a93 (patch) | |
tree | e78344d1237c9ca6e2d3004e4c6d2916c6514750 /phpBB/includes/template/twig/node/php.php | |
parent | 28e3341fcde976754f122a9c540b20aa705658fc (diff) | |
parent | b5651c0289054f2f4453806200506968241f9a82 (diff) | |
download | forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar.gz forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar.bz2 forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar.xz forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.zip |
Merge remote-tracking branch 'phpbb/develop' into ticket/9657
* phpbb/develop: (216 commits)
[ticket/11626] Remove last reference to template in ldap
[ticket/11626] Remove LDAP dependency on template
[develop-olympus] Increment version number to 3.0.13-dev.
[develop-olympus] Add changelog for 3.0.12 release.
[develop-olympus] Bump version numbers for 3.0.12-RC1 release.
[develop-olympus] Bumping version numbers to final for 3.0.12 releases.
[ticket/11669] Fix PHP bug #55124 (recursive mkdir on /./)
[ticket/11668] Run lint test at the end of the test suite
[ticket/11548] Fix test errors in groups test on develop
[ticket/11548] Check upload avatar URL the same way as in phpBB 3.0
[ticket/11548] Fix incorrect usage of array_map on acp groups page
[ticket/11665] Fix test class name
[ticket/11664] Stop creating php.html file in root path in tests
[ticket/11665] Can't change file names already sent to set_filenames
[ticket/11662] Typos: occured -> occurred
[ticket/11662] Typos: occured -> occurred
[ticket/11660] Fix bugs from bugs in #11651 (missing vars, db->sql_connect)
[feature/auth-refactor] Add parent::setUp() in setUp()
[feature/auth-refactor] Changes
[feature/auth-refactor] DataProvider for acp_board test
...
Diffstat (limited to 'phpBB/includes/template/twig/node/php.php')
-rw-r--r-- | phpBB/includes/template/twig/node/php.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/phpBB/includes/template/twig/node/php.php b/phpBB/includes/template/twig/node/php.php new file mode 100644 index 0000000000..c11539ea7f --- /dev/null +++ b/phpBB/includes/template/twig/node/php.php @@ -0,0 +1,55 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + + +class phpbb_template_twig_node_php extends Twig_Node +{ + /** @var Twig_Environment */ + protected $environment; + + public function __construct(Twig_Node_Text $text, phpbb_template_twig_environment $environment, $lineno, $tag = null) + { + $this->environment = $environment; + + parent::__construct(array('text' => $text), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $config = $this->environment->get_phpbb_config(); + + if (!$config['tpl_allow_php']) + { + $compiler + ->write("// PHP Disabled\n") + ; + + return; + } + + $compiler + ->raw($this->getNode('text')->getAttribute('data')) + ; + } +} |