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)
holds an instance of this class, used by getInstance when you don't provide a custom compiler in order to save resources
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.
defines whether the nested comments should be parsed as nested or not
defaults to false (classic block comment parsing as in all languages)
defines whether the compiler will automatically html-escape variables or not
default is false
current block at the top of the block plugins stack, accessible through getCurrentBlock
stores the custom plugins registered with this compiler
stores the data within which the scope moves
boolean flag to enable or disable debugging output
left script delimiter
left script delimiter with escaped regex meta characters
stores the current line count inside the template for debugging purposes
stores the current pointer position inside the template
stores the pre- and post-processors callbacks
right script delimiter
right script delimiter with escaped regex meta characters
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)
variable scope tree, that allows to rebuild the current scope if required, i.e. when going to a parent level
security policy object
block plugins stack, accessible through some methods
stores the template undergoing compilation
stores the template plugins registered with this compiler
stores the current template source while compiling it
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
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
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
adds a block to the top of the block stack
adds a custom block to the top of the block stack
adds a postprocessor to the compiler, it will be called before the template is compiled
adds a preprocessor to the compiler, it will be called before the template is compiled
adds a template plugin, this is reserved for use by the {function} 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
compiles the provided string down to php code
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
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
returns the auto escape setting
default setting is disabled/false
returns the compiled parameters (for example a variable's compiled parameter will be "$this->scope['key']") out of the given parameter array
returns a reference to the current block array
returns the dwoo object that initiated this template compilation, only available during compilation of a template
returns the current line number, only available during compilation of a template
returns the tag openings handling strictness setting
returns the nested comments handling setting
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 "*"
returns the plugin type of a plugin and adds it to the used plugins array if required
returns the current pointer position, only available during compilation of a template
returns the real parameters (for example a variable's real parameter will be its key, etc) out of the given parameter array
returns the current security policy object or null by default
returns the template that is being compiled
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
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)
internal function to autoload processors at runtime if required
maps the parameters received from the template onto the parameters required by the given callback
entry point of the parser, it redirects calls to other parse* functions
parses a constant
parses a constant
parses a function call
parses any number of chained method calls/property reads
parses various constants, operators or non-quoted strings
parses a string
parses a variable
parses a constant variable (a variable that doesn't contain another variable) and preprocesses it to save runtime processing time
runs htmlentities over the matched <?php ?> blocks when the security policy enforces that
adds compiled content to the current block
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
removes the closest-to-top block of the given type and all other blocks encountered while going down the block stack
removes a postprocessor from the compiler
removes a preprocessor from the compiler
removes the block at the top of the stack and calls its postProcessing() method
replaces the modifiers applied to a string or a variable
replaces variables within a parsed string
helper function that parses a variable
checks what sub-templates are used in every sub-template so that we're sure they are all compiled
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
adds the custom plugins loaded into Dwoo to the compiler so it can load them
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.
sets the line number
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.
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
sets the pointer position
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']
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
overwrites the template that is being compiled
marks a template plugin as being called, which means its source must be included in the compiled template
Documentation generated on Sat, 18 Jul 2009 21:04:45 +0200 by phpDocumentor 1.4.0