aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template_executor_eval.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/template_executor_eval.php')
-rw-r--r--phpBB/includes/template_executor_eval.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/template_executor_eval.php b/phpBB/includes/template_executor_eval.php
new file mode 100644
index 0000000000..27bdf95b52
--- /dev/null
+++ b/phpBB/includes/template_executor_eval.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+* Template executor that stores compiled template's php code and
+* evaluates it via eval.
+*/
+class phpbb_template_executor_eval implements phpbb_template_executor
+{
+ /**
+ * Template code to be eval'ed.
+ */
+ private $code;
+
+ /**
+ * Constructor. Stores provided code for future evaluation.
+ *
+ * @param string $code php code of the template
+ */
+ public function __construct($code)
+ {
+ $this->code = $code;
+ }
+
+ /**
+ * Executes the template managed by this executor by eval'ing php code
+ * of the template.
+ */
+ public function execute()
+ {
+ eval($this->code);
+ }
+}