1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * interface that represents a dwoo compiler |
---|
5 | * |
---|
6 | * while implementing this is enough to interact with Dwoo/Dwoo_Templates, it is not |
---|
7 | * sufficient to interact with Dwoo_Plugins, however the main purpose of creating a |
---|
8 | * new compiler would be to interact with other/different plugins, that is why this |
---|
9 | * interface has been left with the minimum requirements. |
---|
10 | * |
---|
11 | * This software is provided 'as-is', without any express or implied warranty. |
---|
12 | * In no event will the authors be held liable for any damages arising from the use of this software. |
---|
13 | * |
---|
14 | * @author Jordi Boggiano <j.boggiano@seld.be> |
---|
15 | * @copyright Copyright (c) 2008, Jordi Boggiano |
---|
16 | * @license http://dwoo.org/LICENSE Modified BSD License |
---|
17 | * @link http://dwoo.org/ |
---|
18 | * @version 1.0.0 |
---|
19 | * @date 2008-10-23 |
---|
20 | * @package Dwoo |
---|
21 | */ |
---|
22 | interface Dwoo_ICompiler |
---|
23 | { |
---|
24 | /** |
---|
25 | * compiles the provided string down to php code |
---|
26 | * |
---|
27 | * @param string $templateStr the template to compile |
---|
28 | * @return string a compiled php code string |
---|
29 | */ |
---|
30 | public function compile(Dwoo_Core $dwoo, Dwoo_ITemplate $template); |
---|
31 | |
---|
32 | /** |
---|
33 | * adds the custom plugins loaded into Dwoo to the compiler so it can load them |
---|
34 | * |
---|
35 | * @see Dwoo_Core::addPlugin |
---|
36 | * @param array $customPlugins an array of custom plugins |
---|
37 | */ |
---|
38 | public function setCustomPlugins(array $customPlugins); |
---|
39 | |
---|
40 | /** |
---|
41 | * sets the security policy object to enforce some php security settings |
---|
42 | * |
---|
43 | * use this if untrusted persons can modify templates, |
---|
44 | * set it on the Dwoo object as it will be passed onto the compiler automatically |
---|
45 | * |
---|
46 | * @param Dwoo_Security_Policy $policy the security policy object |
---|
47 | */ |
---|
48 | public function setSecurityPolicy(Dwoo_Security_Policy $policy = null); |
---|
49 | } |
---|