aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template/twig/tokenparser/php.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-07-13 09:36:24 -0400
committerJoas Schilling <nickvergessen@gmx.de>2013-07-13 09:36:24 -0400
commit8352a7cadab7e16eb8eac29d869e06864acb1a93 (patch)
treee78344d1237c9ca6e2d3004e4c6d2916c6514750 /phpBB/includes/template/twig/tokenparser/php.php
parent28e3341fcde976754f122a9c540b20aa705658fc (diff)
parentb5651c0289054f2f4453806200506968241f9a82 (diff)
downloadforums-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/tokenparser/php.php')
-rw-r--r--phpBB/includes/template/twig/tokenparser/php.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/phpBB/includes/template/twig/tokenparser/php.php b/phpBB/includes/template/twig/tokenparser/php.php
new file mode 100644
index 0000000000..197980a59a
--- /dev/null
+++ b/phpBB/includes/template/twig/tokenparser/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_tokenparser_php extends Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param Twig_Token $token A Twig_Token instance
+ *
+ * @return Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(Twig_Token $token)
+ {
+ $stream = $this->parser->getStream();
+
+ $stream->expect(Twig_Token::BLOCK_END_TYPE);
+
+ $body = $this->parser->subparse(array($this, 'decideEnd'), true);
+
+ $stream->expect(Twig_Token::BLOCK_END_TYPE);
+
+ return new phpbb_template_twig_node_php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ }
+
+ public function decideEnd(Twig_Token $token)
+ {
+ return $token->test('ENDPHP');
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'PHP';
+ }
+}