Class Dwoo_Compiler

Description

Implements interfaces:

default dwoo compiler class, compiles dwoo templates into php

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Located in /Dwoo/Compiler.php (line 19)


	
			
Class Constant Summary
 PHP_CLOSE = "?>"
 PHP_OPEN = "<?php "
Variable Summary
Method Summary
static string implode_r ( $params, [bool $recursiveCall = false])
Dwoo_Compiler __construct ()
string addBlock (string $type,  $params, int $paramtype)
string addCustomBlock (string $type,  $params, int $paramtype)
void addPostProcessor (mixed $callback, [bool $autoload = false])
void addPreProcessor (mixed $callback, [bool $autoload = false])
void addTemplatePlugin (string $name,  $params, string $uuid, [string $body = null])
void addUsedPlugin (string $name, int $type)
string compile (Dwoo $dwoo, Dwoo_ITemplate $template, string $tpl)
&array &findBlock (string $type, [bool $closeAlong = false])
string flattenVarTree ( $tree, [bool $recursed = false])
bool getAutoEscape ()
array getCompiledParams ( $params)
&array &getCurrentBlock ()
array getDelimiters ()
int getLine ()
array getParamMap (callback $callback)
int getPluginType (string $name)
int getPointer ()
array getRealParams ( $params)
string getTemplateSource ([mixed $fromPointer = false])
array getUsedPlugins ()
void injectBlock (string $type,  $params)
void loadPlugin (string $name)
void loadProcessor (string $class, string $name)
array mapParams ( $params, callback $callback, [int $callType = 2], [array $map = null])
string parse (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
string parseConst (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
string parseConstKey (string $key, string $curBlock)
string parseFunction (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
string parseMethodCall (string $output, string $methodCall, string $curBlock,  &$pointer, int $pointer)
string parseOthers (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
string parseString (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
string parseVar (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
string parseVarKey (string $key, string $curBlock)
string phpTagEncodingHelper (array $match)
void push (string $content, [int $lineCount = null])
void recompile ()
string removeBlock (string $type)
void removePostProcessor (mixed $callback)
void removePreProcessor (mixed $callback)
string removeTopBlock ()
string replaceModifiers ( $m, [string $curBlock = null], [ &$pointer = null])
string replaceStringVars (string $string, string $first, [string $curBlock = ''])
string replaceVarKeyHelper (array $match)
void resolveSubTemplateDependencies (string $function)
void setAutoEscape (bool $enabled)
void setCustomPlugins ( $customPlugins)
void setDelimiters (string $left, string $right)
void setLine (int $number, [bool $isOffset = false])
void setLooseOpeningHandling ([bool $allow = false])
void setNestedCommentsHandling ([bool $allow = true])
void setPointer (int $position, [bool $isOffset = false])
array setScope (mixed $scope, [bool $absolute = false])
void setSecurityPolicy ([Dwoo_Security_Policy $policy = null])
string setTemplateSource (string $newSource, [bool $fromPointer = false])
void useTemplatePlugin (string $name)
Variables
static Dwoo_Compiler $instance (line 232)

holds an instance of this class, used by getInstance when you don't provide a custom compiler in order to save resources

  • access: protected
bool $allowLooseOpenings = false (line 92)

defines whether opening and closing tags can contain spaces before valid data or not

turn to true if you want to be sloppy with the syntax, but when set to false it allows to skip javascript and css tags as long as they are in the form "{ something", which is nice. default is false.

  • access: protected
bool $allowNestedComments = false (line 81)

defines whether the nested comments should be parsed as nested or not

defaults to false (classic block comment parsing as in all languages)

  • access: protected
bool $autoEscape = false (line 101)

defines whether the compiler will automatically html-escape variables or not

default is false

  • access: protected
Dwoo_Block_Plugin $curBlock (line 217)

current block at the top of the block plugins stack, accessible through getCurrentBlock

array $customPlugins = array() (line 115)

stores the custom plugins registered with this compiler

  • access: protected
array $data (line 175)

stores the data within which the scope moves

  • access: protected
bool $debug = false (line 44)

boolean flag to enable or disable debugging output

  • access: public
Dwoo $dwoo (line 224)

current dwoo object that uses this compiler, or null

  • access: protected
string $ld = '{' (line 51)

left script delimiter

  • access: protected
string $ldr = '\\{' (line 58)

left script delimiter with escaped regex meta characters

  • access: protected
int $line (line 161)

stores the current line count inside the template for debugging purposes

  • access: protected
int $pointer (line 154)

stores the current pointer position inside the template

  • access: protected
array $processors = array('pre'=>array(),'post'=>array()) (line 129)

stores the pre- and post-processors callbacks

  • access: protected
string $rd = '}' (line 65)

right script delimiter

  • access: protected
string $rdr = '\\}' (line 72)

right script delimiter with escaped regex meta characters

  • access: protected
mixed $scope (line 184)

variable scope of the compiler, set to null if it can not be resolved to a static string (i.e. if some plugin defines a new scope based on a variable array key)

  • access: protected
array $scopeTree (line 192)

variable scope tree, that allows to rebuild the current scope if required, i.e. when going to a parent level

  • access: protected
Dwoo_Security_Policy $securityPolicy (line 108)

security policy object

  • access: protected
array $stack = array() (line 207)

block plugins stack, accessible through some methods

string $template (line 147)

stores the template undergoing compilation

  • access: protected
array $templatePlugins = array() (line 122)

stores the template plugins registered with this compiler

  • access: protected
string $templateSource (line 168)

stores the current template source while compiling it

  • access: protected
array $usedPlugins (line 140)

stores a list of plugins that are used in the currently compiled template, and that are not compilable. these plugins will be loaded during the template's runtime if required.

it is a 1D array formatted as key:pluginName value:pluginType

  • access: protected
Methods
static compilerFactory (line 3079)

returns a default instance of this compiler, used by default by all Dwoo templates that do not have a specific compiler assigned and when you do not override the default compiler factory function

static Dwoo_Compiler compilerFactory ()
static implode_r (line 2841)

recursively implodes an array in a similar manner as var_export() does but with some tweaks to handle pre-compiled values and the fact that we do not need to enclose everything with "array" and do not require top-level keys to be displayed

  • return: the imploded array
  • access: public
static string implode_r ( $params, [bool $recursiveCall = false])
  • array $params: the array to implode
  • bool $recursiveCall: if set to true, the function outputs key names for the top level
Constructor __construct (line 239)

constructor

saves the created instance so that child templates get the same one

  • access: public
Dwoo_Compiler __construct ()
addBlock (line 1014)

adds a block to the top of the block stack

  • return: the preProcessing() method's output
  • access: public
string addBlock (string $type,  $params, int $paramtype)
  • string $type: block type (name)
  • array $params: the parameters array
  • int $paramtype: the parameters type (see mapParams), 0, 1 or 2
addCustomBlock (line 1036)

adds a custom block to the top of the block stack

  • return: the preProcessing() method's output
  • access: public
string addCustomBlock (string $type,  $params, int $paramtype)
  • string $type: block type (name)
  • array $params: the parameters array
  • int $paramtype: the parameters type (see mapParams), 0, 1 or 2
addPostProcessor (line 404)

adds a postprocessor to the compiler, it will be called before the template is compiled

  • access: public
void addPostProcessor (mixed $callback, [bool $autoload = false])
  • mixed $callback: either a valid callback to the postprocessor or a simple name if the autoload is set to true
  • bool $autoload: if set to true, the postprocessor is auto-loaded from one of the plugin directories, else you must provide a valid callback
addPreProcessor (line 355)

adds a preprocessor to the compiler, it will be called before the template is compiled

  • access: public
void addPreProcessor (mixed $callback, [bool $autoload = false])
  • mixed $callback: either a valid callback to the preprocessor or a simple name if the autoload is set to true
  • bool $autoload: if set to true, the preprocessor is auto-loaded from one of the plugin directories, else you must provide a valid callback
addTemplatePlugin (line 512)

adds a template plugin, this is reserved for use by the {template} plugin

this is required because the template functions are not declared yet during compilation, so we must have a way of validating their argument signature without using the reflection api

  • private:
  • access: public
void addTemplatePlugin (string $name,  $params, string $uuid, [string $body = null])
  • string $name: function name
  • array $params: parameter array to help validate the function call
  • string $uuid: unique id of the function
  • string $body: function php code
addUsedPlugin (line 483)

adds an used plugin, this is reserved for use by the {template} plugin

this is required so that plugin loading bubbles up from loaded template files to the current one

  • private:
  • access: public
void addUsedPlugin (string $name, int $type)
  • string $name: function name
  • int $type: plugin type (Dwoo::*_PLUGIN)
compile (line 682)

compiles the provided string down to php code

  • return: a compiled php string
  • access: public
string compile (Dwoo $dwoo, Dwoo_ITemplate $template, string $tpl)

Implementation of:
Dwoo_ICompiler::compile()
compiles the provided string down to php code
findBlock (line 1125)

returns a reference to the first block of the given type encountered and optionally closes all blocks until it finds it

this is mainly used by {else} plugins to close everything that was opened between their parent and themselves

  • return: the array is as such: array('type'=>pluginName, 'params'=>parameter array, 'custom'=>bool defining whether it's a custom plugin or not, for internal use)
  • access: public
&array &findBlock (string $type, [bool $closeAlong = false])
  • string $type: the block type (name)
  • bool $closeAlong: whether to close all blocks encountered while going down the block stack or not
flattenVarTree (line 2382)

flattens a variable tree, this helps in parsing very complex variables such as $var.foo[$foo.bar->baz].baz, it computes the contents of the brackets first and works out from there

  • return: flattened tree
  • access: protected
string flattenVarTree ( $tree, [bool $recursed = false])
  • array $tree: the variable tree parsed by he parseVar() method that must be flattened
  • bool $recursed: leave that to false by default, it is only for internal use
getAutoEscape (line 343)

returns the auto escape setting

default setting is disabled/false

  • access: public
bool getAutoEscape ()
getCompiledParams (line 1186)

returns the compiled parameters (for example a variable's compiled parameter will be "$this->scope['key']") out of the given parameter array

  • return: filtered parameters
  • access: public
array getCompiledParams ( $params)
  • array $params: parameter array
getCurrentBlock (line 1153)

returns a reference to the current block array

  • return: the array is as such: array('type'=>pluginName, 'params'=>parameter array, 'custom'=>bool defining whether it's a custom plugin or not, for internal use)
  • access: public
&array &getCurrentBlock ()
getDelimiters (line 266)

returns the left and right template delimiters

  • return: containing the left and the right delimiters
  • access: public
array getDelimiters ()
getDwoo (line 627)

returns the dwoo object that initiated this template compilation, only available during compilation of a template

  • access: public
Dwoo getDwoo ()
getLine (line 617)

returns the current line number, only available during compilation of a template

  • access: public
int getLine ()
getLooseOpeningHandling (line 315)

returns the tag openings handling strictness setting

bool getLooseOpeningHandling ()
getNestedCommentsHandling (line 290)

returns the nested comments handling setting

bool getNestedCommentsHandling ()
getParamMap (line 3044)

returns the parameter map of the given callback, it filters out entries typed as Dwoo and Dwoo_Compiler and turns the rest parameter into a "*"

  • return: processed parameter map
  • access: protected
array getParamMap (callback $callback)
  • callback $callback: the function/method to reflect on
getPluginType (line 2866)

returns the plugin type of a plugin and adds it to the used plugins array if required

  • return: type as a multi bit flag composed of the Dwoo plugin types constants
  • access: protected
int getPluginType (string $name)
  • string $name: plugin name, as found in the template
getPointer (line 592)

returns the current pointer position, only available during compilation of a template

  • access: public
int getPointer ()
getRealParams (line 1202)

returns the real parameters (for example a variable's real parameter will be its key, etc) out of the given parameter array

  • return: filtered parameters
  • access: public
array getRealParams ( $params)
  • array $params: parameter array
getSecurityPolicy (line 567)

returns the current security policy object or null by default

  • return: the security policy object if any
  • access: public
Dwoo_Security_Policy|null getSecurityPolicy ()
getTemplatePlugins (line 523)

returns all the parsed sub-templates

  • return: the parsed sub-templates
  • private:
  • access: public
array getTemplatePlugins ()
getTemplateSource (line 655)

returns the template that is being compiled

  • return: the template or partial template
  • access: public
string getTemplateSource ([mixed $fromPointer = false])
  • mixed $fromPointer: if set to true, only the source from the current pointer position is returned, if a number is given it overrides the current pointer
getUsedPlugins (line 494)

returns all the plugins this template uses

  • return: the list of used plugins in the parsed template
  • private:
  • access: public
array getUsedPlugins ()
injectBlock (line 1060)

injects a block at the top of the plugin stack without calling its preProcessing method

used by {else} blocks to re-add themselves after having closed everything up to their parent

  • access: public
void injectBlock (string $type,  $params)
  • string $type: block type (name)
  • array $params: parameters array
loadPlugin (line 2936)

allows a plugin to load another one at compile time, this will also mark

it as used by this template so it will be loaded at runtime (which can be useful for compiled plugins that rely on another plugin when their compiled code runs)

  • access: public
void loadPlugin (string $name)
  • string $name: the plugin name
loadProcessor (line 452)

internal function to autoload processors at runtime if required

  • access: protected
void loadProcessor (string $class, string $name)
  • string $class: the class/function name
  • string $name: the plugin name (without Dwoo_Plugin_ prefix)
mapParams (line 2960)

maps the parameters received from the template onto the parameters required by the given callback

  • return: parameters sorted in the correct order with missing optional parameters filled
  • access: protected
array mapParams ( $params, callback $callback, [int $callType = 2], [array $map = null])
  • array $params: the array of parameters
  • callback $callback: the function or method to reflect on to find out the required parameters
  • int $callType: the type of call in the template, 0 = no params, 1 = php-style call, 2 = named parameters call
  • array $map: the parameter map to use, if not provided it will be built from the callback
parse (line 1223)

entry point of the parser, it redirects calls to other parse* functions

  • return: parsed values
  • access: protected
string parse (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
  • string $in: the string within which we must parse something
  • int $from: the starting offset of the parsed area
  • int $to: the ending offset of the parsed area
  • mixed $parsingParams: must be an array if we are parsing a function or modifier's parameters, or false by default
  • string $curBlock: the current parser-block being processed
  • mixed $pointer: a reference to a pointer that will be increased by the amount of characters parsed, or null by default
  • &$pointer
parseConst (line 1950)

parses a constant

  • return: parsed values
  • access: protected
string parseConst (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
  • string $in: the string within which we must parse something
  • int $from: the starting offset of the parsed area
  • int $to: the ending offset of the parsed area
  • mixed $parsingParams: must be an array if we are parsing a function or modifier's parameters, or false by default
  • string $curBlock: the current parser-block being processed
  • mixed $pointer: a reference to a pointer that will be increased by the amount of characters parsed, or null by default
  • &$pointer
parseConstKey (line 1985)

parses a constant

  • return: parsed constant
  • access: protected
string parseConstKey (string $key, string $curBlock)
  • string $key: the constant to parse
  • string $curBlock: the current parser-block being processed
parseFunction (line 1534)

parses a function call

  • return: parsed values
  • access: protected
string parseFunction (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
  • string $in: the string within which we must parse something
  • int $from: the starting offset of the parsed area
  • int $to: the ending offset of the parsed area
  • mixed $parsingParams: must be an array if we are parsing a function or modifier's parameters, or false by default
  • string $curBlock: the current parser-block being processed
  • mixed $pointer: a reference to a pointer that will be increased by the amount of characters parsed, or null by default
  • &$pointer
parseMethodCall (line 2217)

parses any number of chained method calls/property reads

  • return: parsed call(s)/read(s)
  • access: protected
string parseMethodCall (string $output, string $methodCall, string $curBlock,  &$pointer, int $pointer)
  • string $output: the variable or whatever upon which the method are called
  • string $methodCall: method call source, starting at "->"
  • string $curBlock: the current parser-block being processed
  • int $pointer: a reference to a pointer that will be increased by the amount of characters parsed
  • &$pointer
parseOthers (line 2455)

parses various constants, operators or non-quoted strings

  • return: parsed values
  • access: protected
string parseOthers (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
  • string $in: the string within which we must parse something
  • int $from: the starting offset of the parsed area
  • int $to: the ending offset of the parsed area
  • mixed $parsingParams: must be an array if we are parsing a function or modifier's parameters, or false by default
  • string $curBlock: the current parser-block being processed
  • mixed $pointer: a reference to a pointer that will be increased by the amount of characters parsed, or null by default
  • &$pointer
parseString (line 1883)

parses a string

  • return: parsed values
  • access: protected
string parseString (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
  • string $in: the string within which we must parse something
  • int $from: the starting offset of the parsed area
  • int $to: the ending offset of the parsed area
  • mixed $parsingParams: must be an array if we are parsing a function or modifier's parameters, or false by default
  • string $curBlock: the current parser-block being processed
  • mixed $pointer: a reference to a pointer that will be increased by the amount of characters parsed, or null by default
  • &$pointer
parseVar (line 2011)

parses a variable

  • return: parsed values
  • access: protected
string parseVar (string $in, int $from, int $to, [mixed $parsingParams = false], [string $curBlock = ''], [ &$pointer = null], mixed $pointer)
  • string $in: the string within which we must parse something
  • int $from: the starting offset of the parsed area
  • int $to: the ending offset of the parsed area
  • mixed $parsingParams: must be an array if we are parsing a function or modifier's parameters, or false by default
  • string $curBlock: the current parser-block being processed
  • mixed $pointer: a reference to a pointer that will be increased by the amount of characters parsed, or null by default
  • &$pointer
parseVarKey (line 2271)

parses a constant variable (a variable that doesn't contain another variable) and preprocesses it to save runtime processing time

  • return: parsed variable
  • access: protected
string parseVarKey (string $key, string $curBlock)
  • string $key: the variable to parse
  • string $curBlock: the current parser-block being processed
phpTagEncodingHelper (line 2946)

runs htmlentities over the matched <?php ?> blocks when the security policy enforces that

  • return: the htmlentities-converted string
  • access: protected
string phpTagEncodingHelper (array $match)
  • array $match: matched php block
push (line 934)

adds compiled content to the current block

  • access: public
void push (string $content, [int $lineCount = null])
  • string $content: the content to push
  • int $lineCount: newlines count in content, optional
recompile (line 671)

resets the compilation pointer, effectively restarting the compilation process

this is useful if a plugin modifies the template source since it might need to be recompiled

  • access: public
void recompile ()
removeBlock (line 1077)

removes the closest-to-top block of the given type and all other blocks encountered while going down the block stack

  • return: the output of all postProcessing() method's return values of the closed blocks
  • access: public
string removeBlock (string $type)
  • string $type: block type (name)
removePostProcessor (line 429)

removes a postprocessor from the compiler

  • access: public
void removePostProcessor (mixed $callback)
  • mixed $callback: either a valid callback to the postprocessor or a simple name if it was autoloaded
removePreProcessor (line 380)

removes a preprocessor from the compiler

  • access: public
void removePreProcessor (mixed $callback)
  • mixed $callback: either a valid callback to the preprocessor or a simple name if it was autoloaded
removeTopBlock (line 1163)

removes the block at the top of the stack and calls its postProcessing() method

  • return: the postProcessing() method's output
  • access: public
string removeTopBlock ()
replaceModifiers (line 2589)

replaces the modifiers applied to a string or a variable

  • return: the input enclosed with various function calls according to the modifiers found
  • access: protected
string replaceModifiers ( $m, [string $curBlock = null], [ &$pointer = null])
  • array $m: the regex matches that must be array(1=>"double or single quotes enclosing a string, when applicable", 2=>"the string or var", 3=>"the modifiers matched")
  • string $curBlock: the current parser-block being processed
  • &$pointer
replaceStringVars (line 2545)

replaces variables within a parsed string

  • return: the original string with variables replaced
  • access: protected
string replaceStringVars (string $string, string $first, [string $curBlock = ''])
  • string $string: the parsed string
  • string $first: the first character parsed in the string, which is the string delimiter (' or ")
  • string $curBlock: the current parser-block being processed
replaceVarKeyHelper (line 2439)

helper function that parses a variable

  • return: parsed variable
  • access: protected
string replaceVarKeyHelper (array $match)
  • array $match: the matched variable, array(1=>"string match")
resolveSubTemplateDependencies (line 916)

checks what sub-templates are used in every sub-template so that we're sure they are all compiled

  • access: protected
void resolveSubTemplateDependencies (string $function)
  • string $function: the sub-template name
setAutoEscape (line 331)

changes the auto escape setting

if enabled, the compiler will automatically html-escape variables, unless they are passed through the safe function such as {$var|safe} or {safe $var}

default setting is disabled/false

  • access: public
void setAutoEscape (bool $enabled)
  • bool $enabled: set to true to enable, false to disable
setCustomPlugins (line 544)

adds the custom plugins loaded into Dwoo to the compiler so it can load them

  • see: Dwoo::addPlugin
  • access: public
void setCustomPlugins ( $customPlugins)
  • array $customPlugins: an array of custom plugins

Implementation of:
Dwoo_ICompiler::setCustomPlugins()
adds the custom plugins loaded into Dwoo to the compiler so it can load them
setDelimiters (line 253)

sets the delimiters to use in the templates

delimiters can be multi-character strings but should not be one of those as they will make it very hard to work with templates or might even break the compiler entirely : "\", "$", "|", ":" and finally "#" only if you intend to use config-vars with the #var# syntax.

  • access: public
void setDelimiters (string $left, string $right)
  • string $left: left delimiter
  • string $right: right delimiter
setLine (line 603)

sets the line number

  • access: public
void setLine (int $number, [bool $isOffset = false])
  • int $number: the new line number
  • bool $isOffset: if set to true, the position acts as an offset and not an absolute position
setLooseOpeningHandling (line 304)

sets the tag openings handling strictness, if set to true, template tags can contain spaces before the first function/string/variable such as { $foo} is valid.

if set to false (default setting), { $foo} is invalid but that is however a good thing as it allows css (i.e. #foo { color:red; }) to be parsed silently without triggering an error, same goes for javascript.

  • access: public
void setLooseOpeningHandling ([bool $allow = false])
  • bool $allow: true to allow loose handling, false to restore default setting
setNestedCommentsHandling (line 280)

sets the way to handle nested comments, if set to true {* foo {* some other *} comment *} will be stripped correctly.

if false it will remove {* foo {* some other *} and leave "comment *}" alone, this is the default behavior

  • access: public
void setNestedCommentsHandling ([bool $allow = true])
  • bool $allow: allow nested comments or not, defaults to true (but the default internal value is false)
setPointer (line 578)

sets the pointer position

  • access: public
void setPointer (int $position, [bool $isOffset = false])
  • int $position: the new pointer position
  • bool $isOffset: if set to true, the position acts as an offset and not an absolute position
setScope (line 964)

sets the scope

set to null if the scope becomes "unstable" (i.e. too variable or unknown) so that variables are compiled in a more evaluative way than just $this->scope['key']

  • return: the current scope tree
  • access: public
array setScope (mixed $scope, [bool $absolute = false])
  • mixed $scope: a string i.e. "level1.level2" or an array i.e. array("level1", "level2")
  • bool $absolute: if true, the scope is set from the top level scope and not from the current scope
setSecurityPolicy (line 557)

sets the security policy object to enforce some php security settings

use this if untrusted persons can modify templates, set it on the Dwoo object as it will be passed onto the compiler automatically

  • access: public
void setSecurityPolicy ([Dwoo_Security_Policy $policy = null])

Implementation of:
Dwoo_ICompiler::setSecurityPolicy()
sets the security policy object to enforce some php security settings
setTemplateSource (line 639)

overwrites the template that is being compiled

  • return: the template or partial template
  • access: public
string setTemplateSource (string $newSource, [bool $fromPointer = false])
  • string $newSource: the template source that must replace the current one
  • bool $fromPointer: if set to true, only the source from the current pointer position is replaced
useTemplatePlugin (line 533)

marks a template plugin as being called, which means its source must be included in the compiled template

  • access: public
void useTemplatePlugin (string $name)
  • string $name: function name
Class Constants
PHP_CLOSE = "?>" (line 37)

constant that represents a php closing tag

use it in case it needs to be adjusted

PHP_OPEN = "<?php " (line 28)

constant that represents a php opening tag

use it in case it needs to be adjusted

Documentation generated on Sun, 07 Feb 2010 17:53:29 +0000 by phpDocumentor 1.4.0