Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Public Attributes | List of all members
eZTemplateCompiler Class Reference

Creates compiled PHP code from templates to speed up template usage. More...

## Static Public Member Functions
static | TemplatePrefix ()
static | setSettings ( $settingsMap)
static | isCompilationEnabled ()
static | isCommentsEnabled ()
static | isDevelopmentModeEnabled ()
static | isAccumulatorsEnabled ()
static | isTimingPointsEnabled ()
static | isFallbackResourceCodeEnabled ()
static | isNodePlacementEnabled ()
static | isExecutionEnabled ()
static | alwaysGenerate ()
static | isTreeEnabled ( $treeName)
static | compilationDirectory ()
static | compilationFilename ( $key, $resourceData)
static | hasCompiledTemplate ( $key, $timestamp, &$resourceData)
static | executeCompilation ( $tpl, &$textElements, $key, &$resourceData, $rootNamespace, $currentNamespace)
static | executeCompilationHelper ( $phpScript, &$text, $tpl, $key, &$resourceData, $rootNamespace, $currentNamespace)
static | compileTemplate ( $tpl, $key, &$resourceData)
static | processNodeCombining ( $useComments, $php, $tpl, &$node, &$resourceData, &$newNode)
static | processNodeCombiningChildren ( $useComments, $php, $tpl, &$nodeChildren, &$resourceData, &$parentNode)
static | combineStaticNodes ( $tpl, &$resourceData, &$lastNode, &$newNode)
static | staticNodeData ( $node)
static | processStaticOptimizations ( $useComments, $php, $tpl, &$node, &$resourceData, &$newNode)
static | processNodeTransformation ( $useComments, $php, $tpl, &$node, &$resourceData, &$newNode)
static | processNodeTransformationNodes ( $tpl, &$node, &$nodes, &$privateData)
static | processNodeTransformationChildren ( $useComments, $php, $tpl, &$node, &$children, &$resourceData)
static | processNodeTransformationRoot ( $useComments, $php, $tpl, &$node, &$resourceData)
static | processNodeTransformationChild ( $useComments, $php, $tpl, &$node, &$resourceData)
static | processElementTransformationList ( $tpl, &$node, $elements, &$privateData)
static | processElementTransformationChild ( $useComments, $php, $tpl, &$node, $elementTree, $elementList, &$resourceData)
static | processRemoveNodePlacement (&$node)
static | inspectVariableData ( $tpl, $variableData, $variablePlacement, &$resourceData)
static | operatorHint ( $tpl, $operatorName)
static | operatorStaticData ( $tpl, $operatorName)
static | createStaticVariableData ( $tpl, $staticData, $variableItemPlacement)
static | fetchTemplatePiece ( $placementData)
static | createCommonCompileTemplate ()
static | currentTextName ( $parameters)
static | boundVariableName ( $variableID, $parameters)
static | generatePHPCode ( $useComments, $php, $tpl, &$node, &$resourceData)
static | generatePHPCodeChildren ( $useComments, $php, $tpl, &$nodeChildren, &$resourceData, &$parameters, $currentParameters)
static | generateMergeNamespaceCode ( $php, $tpl, $namespace, $namespaceScope, $parameters=array(), $skipSimpleAssignment=false)
static | generateVariableCode ( $php, $tpl, $node, &$knownTypes, $dataInspection, $parameters, &$resourceData)
static | generateVariableDataCode ( $php, $tpl, $variableData, &$knownTypes, $dataInspection, &$persistence, $parameters, &$resourceData)

## Public Attributes
const | CODE_DATE = 1074699607

## Detailed Description

Creates compiled PHP code from templates to speed up template usage.

Various optimizations that can be done are:

Data:

- Is constant, generate static data
- Is variable, generate direct variable extraction
- Has operators
- Has attributes

Attributes:

- Is constant, generate static data

Operators:

- Supports input
- Supports output
- Supports parameters
- Generates static data (true, false)
- Custom PHP code
- Modifies template variables, if possible name which ones. Allows for caching of variables in the script.

Functions:

- Supports parameters
- Supports children (set? no, section? yes)
- Generates static data (ldelim,rdelim)
- Children usage, no result(set-block) | copy(let,default) | dynamic(conditional, repeated etc.)
- Children tree, requires original tree | allows custom processing
- Custom PHP code
- Deflate/transform tree, create new non-nested tree (let, default)
- Modifies template variables, if possible name which ones. Allows for caching of variables in the script.

Definition at line 47 of file eztemplatecompiler.php.

## Member Function Documentation

## ◆ alwaysGenerate()

static eZTemplateCompiler::alwaysGenerate | ( |  | ) |
| static

Returns
  true if template compilation should always be run even if a sufficient compilation already exists.

Definition at line 249 of file eztemplatecompiler.php.

Referenced by hasCompiledTemplate().

## ◆ boundVariableName()

static eZTemplateCompiler::boundVariableName | ( |  | $variableID,
|  |  | $parameters
| ) |  |
| static

Definition at line 1779 of file eztemplatecompiler.php.

## ◆ combineStaticNodes()

static eZTemplateCompiler::combineStaticNodes | ( |  | $tpl,
|  | & | $resourceData,
|  | & | $lastNode,
|  | & | $newNode
| ) |  |
| static

Tries to combine the node $lastNode and the node $newNode into one new text node. If possible the new node is created in $newNode and $lastNode will be set to `false`. Combining nodes only works for text nodes and variable nodes without variable lookup, attributes and operators.

Definition at line 760 of file eztemplatecompiler.php.

References inspectVariableData(), eZTemplate\NODE_TEXT, eZTemplate\NODE_VARIABLE, and staticNodeData().

Referenced by processNodeCombiningChildren().

## ◆ compilationDirectory()

static eZTemplateCompiler::compilationDirectory | ( |  | ) |
| static

Returns
  the directory for compiled templates.

Definition at line 277 of file eztemplatecompiler.php.

References eZSys\cacheDirectory(), and eZDir\path().

Referenced by eZCache\clearTemplateCompileCache(), compileTemplate(), createCommonCompileTemplate(), executeCompilation(), generatePHPCodeChildren(), and hasCompiledTemplate().

## ◆ compilationFilename()

static eZTemplateCompiler::compilationFilename | ( |  | $key,
|  |  | $resourceData
| ) |  |
| static

Creates the name for the compiled template and returns it. The name conists of original filename with the md5 of the key and charset appended.

Definition at line 310 of file eztemplatecompiler.php.

References eZSys\indexFile(), eZLocale\instance(), eZHTTPTool\instance(), and eZTextCodec\internalCharset().

Referenced by compileTemplate(), executeCompilation(), generatePHPCodeChildren(), and hasCompiledTemplate().

## ◆ compileTemplate()

static eZTemplateCompiler::compileTemplate | ( |  | $tpl,
|  |  | $key,
|  | & | $resourceData
| ) |  |
| static

Generates the cache which will be used for handling optimized processing using the key $key.

Note
  Each call to this will set the PHP time limit to 30

Returns
  false if the cache does not exist.

Definition at line 465 of file eztemplatecompiler.php.

References CODE_DATE, compilationDirectory(), compilationFilename(), createCommonCompileTemplate(), currentTextName(), eZTemplateOptimizer\fetchClassDeclaration(), generatePHPCode(), isAccumulatorsEnabled(), isCommentsEnabled(), isCompilationEnabled(), isNodePlacementEnabled(), isTimingPointsEnabled(), isTreeEnabled(), eZTemplateOptimizer\optimize(), processNodeCombining(), processNodeTransformation(), processRemoveNodePlacement(), processStaticOptimizations(), and TemplatePrefix().

Referenced by eZTemplateFileResource\compileTemplate(), and eZTemplate\compileTemplateFile().

## ◆ createCommonCompileTemplate()

static eZTemplateCompiler::createCommonCompileTemplate | ( |  | ) |
| static

Creates the common.php file which has common functions for compiled templates. If the file already exists if will not create it.

Definition at line 1678 of file eztemplatecompiler.php.

References compilationDirectory(), and TemplatePrefix().

Referenced by compileTemplate().

## ◆ createStaticVariableData()

static eZTemplateCompiler::createStaticVariableData | ( |  | $tpl,
|  |  | $staticData,
|  |  | $variableItemPlacement
| ) |  |
| static

Creates a variable data element for the data $staticData and returns it. The type of element depends on the type of the data, strings and booleans are returned as eZTemplate::TYPE_STRING and eZTemplate::TYPE_NUMERIC while other types are turned into text and returned as eZTemplate::TYPE_STRING.

Definition at line 1616 of file eztemplatecompiler.php.

References eZTemplate\TYPE_ARRAY, eZTemplate\TYPE_BOOLEAN, eZTemplate\TYPE_NUMERIC, and eZTemplate\TYPE_STRING.

Referenced by inspectVariableData().

## ◆ currentTextName()

static eZTemplateCompiler::currentTextName | ( |  | $parameters | ) |
| static

Figures out the current text name to use in compiled template code and return it. The names will be text, text1, text2 etc.

Definition at line 1767 of file eztemplatecompiler.php.

Referenced by compileTemplate(), and generatePHPCodeChildren().

## ◆ executeCompilation()

static eZTemplateCompiler::executeCompilation | ( |  | $tpl,
|  | & | $textElements,
|  |  | $key,
|  | & | $resourceData,
|  |  | $rootNamespace,
|  |  | $currentNamespace
| ) |  |
| static

Tries to execute the compiled template. Returns true if successful, returns false if the compilation is disabled or the compiled template does not exist.

Parameters

  eZTemplate | $tpl |
  array | $textElements |
  string | $key |
  array | $resourceData |
  | $rootNamespace |
  | $currentNamespace |

Exceptions

  eZTemplateFailedExecutingCompiledTemplate | if the compiled template could not be executed

Returns
  bool

Definition at line 387 of file eztemplatecompiler.php.

References compilationDirectory(), compilationFilename(), executeCompilationHelper(), isCommentsEnabled(), isCompilationEnabled(), isExecutionEnabled(), eZDir\path(), and eZDebug\writeError().

Referenced by eZTemplateFileResource\executeCompiledTemplate().

## ◆ executeCompilationHelper()

static eZTemplateCompiler::executeCompilationHelper | ( |  | $phpScript,
|  | & | $text,
|  |  | $tpl,
|  |  | $key,
|  | & | $resourceData,
|  |  | $rootNamespace,
|  |  | $currentNamespace
| ) |  |
| static

Helper function for executeCompilation. Will execute the script $phpScript and set the result text in $text. The parameters $tpl, $resourceData, $rootNamespace and $currentNamespace are passed to the executed template compilation script.

Returns
  true if a text result was created.

Definition at line 435 of file eztemplatecompiler.php.

References TemplatePrefix().

Referenced by executeCompilation().

## ◆ fetchTemplatePiece()

static eZTemplateCompiler::fetchTemplatePiece | ( |  | $placementData | ) |
| static

Opens the template files specified in $placementData and fetches the text portion defined by the start and end position. The text is returned or `null` if the text could not be fetched.

Definition at line 1646 of file eztemplatecompiler.php.

Referenced by generatePHPCodeChildren().

## ◆ generateMergeNamespaceCode()

static eZTemplateCompiler::generateMergeNamespaceCode | ( |  | $php,
|  |  | $tpl,
|  |  | $namespace,
|  |  | $namespaceScope,
|  |  | $parameters = `array()`,
|  |  | $skipSimpleAssignment = `false`
| ) |  |
| static

Generates PHP code which will do namespace merging. The namespace to merge with is specified in $namespace and the scope of the merging is defined by $namespaceScope.

Definition at line 2668 of file eztemplatecompiler.php.

Referenced by generatePHPCodeChildren(), and generateVariableDataCode().

## ◆ generatePHPCode()

static eZTemplateCompiler::generatePHPCode | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $resourceData
| ) |  |
| static

Generates the PHP code defined in the template node tree $node. The code is generated using the php creator specified in $php.

Definition at line 1791 of file eztemplatecompiler.php.

References generatePHPCodeChildren(), and eZTemplate\NODE_ROOT.

Referenced by compileTemplate().

## ◆ generatePHPCodeChildren()

static eZTemplateCompiler::generatePHPCodeChildren | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $nodeChildren,
|  | & | $resourceData,
|  | & | $parameters,
|  |  | $currentParameters
| ) |  |
| static

Generates the PHP code for all node children specified in $nodeChildren.

See also
  generatePHPCode

Definition at line 1813 of file eztemplatecompiler.php.

References compilationDirectory(), compilationFilename(), currentTextName(), fetchTemplatePiece(), generateMergeNamespaceCode(), isCommentsEnabled(), isDevelopmentModeEnabled(), eZTemplate\NODE_INTERNAL, eZTemplate\NODE_INTERNAL_CODE_PIECE, eZTemplate\NODE_INTERNAL_ERROR, eZTemplate\NODE_INTERNAL_NAMESPACE_CHANGE, eZTemplate\NODE_INTERNAL_OUTPUT_ASSIGN, eZTemplate\NODE_INTERNAL_OUTPUT_DECREASE, eZTemplate\NODE_INTERNAL_OUTPUT_INCREASE, eZTemplate\NODE_INTERNAL_OUTPUT_READ, eZTemplate\NODE_INTERNAL_OUTPUT_SPACING_INCREASE, eZTemplate\NODE_INTERNAL_RESOURCE_ACQUISITION, eZTemplate\NODE_INTERNAL_SPACING_DECREASE, eZTemplate\NODE_INTERNAL_VARIABLE_SET, eZTemplate\NODE_INTERNAL_VARIABLE_UNSET, eZTemplate\NODE_INTERNAL_WARNING, eZTemplate\NODE_OPTIMIZED_RESOURCE_ACQUISITION, eZTemplate\NODE_ROOT, eZTemplate\NODE_USER_CUSTOM, eZDir\path(), and TemplatePrefix().

Referenced by generatePHPCode().

## ◆ generateVariableCode()

static eZTemplateCompiler::generateVariableCode | ( |  | $php,
|  |  | $tpl,
|  |  | $node,
|  | & | $knownTypes,
|  |  | $dataInspection,
|  |  | $parameters,
|  | & | $resourceData
| ) |  |
| static

Generates PHP code for the variable node $node. Use generateVariableDataCode if you want to create code for arbitrary variable data structures.

Definition at line 2723 of file eztemplatecompiler.php.

## ◆ generateVariableDataCode()

static eZTemplateCompiler::generateVariableDataCode | ( |  | $php,
|  |  | $tpl,
|  |  | $variableData,
|  | & | $knownTypes,
|  |  | $dataInspection,
|  | & | $persistence,
|  |  | $parameters,
|  | & | $resourceData
| ) |  |
| static

Generates PHP code for the variable tree structure in $variableData. The code will contain string, numeric and identifier assignment, variable lookup, attribute lookup and operator execution. Use generateVariableCode if you want to create code for a variable tree node.

Definition at line 2736 of file eztemplatecompiler.php.

References eZTemplateNodeTool\elementConstantValue(), generateMergeNamespaceCode(), eZTemplateNodeTool\isConstantElement(), operatorHint(), eZTemplate\TYPE_ARRAY, eZTemplate\TYPE_ATTRIBUTE, eZTemplate\TYPE_BOOLEAN, eZTemplate\TYPE_DYNAMIC_ARRAY, eZTemplate\TYPE_IDENTIFIER, eZTemplate\TYPE_NUMERIC, eZTemplate\TYPE_OPERATOR, eZTemplate\TYPE_OPTIMIZED_ARRAY_LOOKUP, eZTemplate\TYPE_OPTIMIZED_ATTRIBUTE_LOOKUP, eZTemplate\TYPE_OPTIMIZED_CONTENT_CALL, eZTemplate\TYPE_OPTIMIZED_NODE, eZTemplate\TYPE_PHP_VARIABLE, eZTemplate\TYPE_STRING, eZTemplate\TYPE_VARIABLE, and eZTemplate\TYPE_VOID.

## ◆ hasCompiledTemplate()

static eZTemplateCompiler::hasCompiledTemplate | ( |  | $key,
|  |  | $timestamp,
|  | & | $resourceData
| ) |  |
| static

Returns
  true if the compiled template with the key $key exists. A compiled template is found usable when it exists and has a timestamp higher or equal to $timestamp.

Definition at line 352 of file eztemplatecompiler.php.

References alwaysGenerate(), compilationDirectory(), compilationFilename(), isCompilationEnabled(), TemplatePrefix(), and eZDebugSetting\writeDebug().

Referenced by eZTemplateFileResource\hasCompiledTemplate().

## ◆ inspectVariableData()

static eZTemplateCompiler::inspectVariableData | ( |  | $tpl,
|  |  | $variableData,
|  |  | $variablePlacement,
|  | & | $resourceData
| ) |  |
| static

Looks over the variable data $variableData and returns an array with information on the structure. The following entries are generated.

- is-constant - true if the variable data contains constant data like text and numerics
- is-variable - true if the variable data is a variable lookup
- has-operators - true if operators are present
- has-attributes - true if attributes are used

Definition at line 1417 of file eztemplatecompiler.php.

References createStaticVariableData(), operatorHint(), operatorStaticData(), eZTemplate\TYPE_ARRAY, eZTemplate\TYPE_ATTRIBUTE, eZTemplate\TYPE_BOOLEAN, eZTemplate\TYPE_DYNAMIC_ARRAY, eZTemplate\TYPE_IDENTIFIER, eZTemplate\TYPE_INTERNAL, eZTemplate\TYPE_INTERNAL_STOP, eZTemplate\TYPE_NUMERIC, eZTemplate\TYPE_OPERATOR, eZTemplate\TYPE_STRING, eZTemplate\TYPE_VARIABLE, and eZTemplate\TYPE_VOID.

Referenced by combineStaticNodes(), processNodeCombiningChildren(), and processStaticOptimizations().

## ◆ isAccumulatorsEnabled()

static eZTemplateCompiler::isAccumulatorsEnabled | ( |  | ) |
| static

Returns
  true if template compilation should include debug accumulators.

Definition at line 164 of file eztemplatecompiler.php.

Referenced by compileTemplate().

## ◆ isCommentsEnabled()

static eZTemplateCompiler::isCommentsEnabled | ( |  | ) |
| static

Returns
  true if template compilation should include comments.

Definition at line 124 of file eztemplatecompiler.php.

Referenced by compileTemplate(), executeCompilation(), generatePHPCodeChildren(), eZTemplateIncludeFunction\templateNodeTransformation(), eZTemplateMenuFunction\templateNodeTransformation(), and eZTemplateToolbarFunction\templateNodeTransformation().

## ◆ isCompilationEnabled()

static eZTemplateCompiler::isCompilationEnabled | ( |  | ) |
| static

Returns
  true if template compiling is enabled.

Note
  To change this setting edit settings/site.ini and locate the group TemplateSettings and the entry TemplateCompile.

Definition at line 97 of file eztemplatecompiler.php.

Referenced by eZTemplateFileResource\canCompileTemplate(), compileTemplate(), executeCompilation(), and hasCompiledTemplate().

## ◆ isDevelopmentModeEnabled()

static eZTemplateCompiler::isDevelopmentModeEnabled | ( |  | ) |
| static

Returns
  true if template compilation should run in development mode.

When in development mode the system will perform additional checks, e.g. for modification time of compiled file vs original source file. This mode is quite useful for development since it requires less clear-cache calls but has additional file checks and should be turned off for live sites.

Definition at line 147 of file eztemplatecompiler.php.

Referenced by generatePHPCodeChildren().

## ◆ isExecutionEnabled()

static eZTemplateCompiler::isExecutionEnabled | ( |  | ) |
| static

Returns
  true if the compiled template execution is enabled.

Definition at line 232 of file eztemplatecompiler.php.

Referenced by executeCompilation().

## ◆ isFallbackResourceCodeEnabled()

static eZTemplateCompiler::isFallbackResourceCodeEnabled | ( |  | ) |
| static

Returns
  true if resource fallback code should be included.

Definition at line 198 of file eztemplatecompiler.php.

## ◆ isNodePlacementEnabled()

static eZTemplateCompiler::isNodePlacementEnabled | ( |  | ) |
| static

Returns
  true if template compilation should include comments.

Definition at line 215 of file eztemplatecompiler.php.

Referenced by compileTemplate().

## ◆ isTimingPointsEnabled()

static eZTemplateCompiler::isTimingPointsEnabled | ( |  | ) |
| static

Returns
  true if template compilation should include debug timing points.

Definition at line 181 of file eztemplatecompiler.php.

Referenced by compileTemplate().

## ◆ isTreeEnabled()

static eZTemplateCompiler::isTreeEnabled | ( |  | $treeName | ) |
| static

Returns
  true if template node tree named $treeName should be included the compiled template.

Definition at line 266 of file eztemplatecompiler.php.

Referenced by compileTemplate().

## ◆ operatorHint()

static eZTemplateCompiler::operatorHint | ( |  | $tpl,
|  |  | $operatorName
| ) |  |
| static

Returns
  the operator hint for the operator $operatorName, or `false` if the operator does not exist or has no hints.

Definition at line 1553 of file eztemplatecompiler.php.

Referenced by generateVariableDataCode(), and inspectVariableData().

## ◆ operatorStaticData()

static eZTemplateCompiler::operatorStaticData | ( |  | $tpl,
|  |  | $operatorName
| ) |  |
| static

Returns
  static data from operators which support returning static data, or `null` if no static data could be extracted. The operator is specified in $operatorName.

Definition at line 1587 of file eztemplatecompiler.php.

Referenced by inspectVariableData().

## ◆ processElementTransformationChild()

static eZTemplateCompiler::processElementTransformationChild | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  |  | $elementTree,
|  |  | $elementList,
|  | & | $resourceData
| ) |  |
| static

Iterates over the children of the function node $node and transforms the tree. If the node is not a function it will return `false`.

See also
  processNodeTransformationRoot, processNodeTransformationChild

Definition at line 1229 of file eztemplatecompiler.php.

References eZTemplate\TYPE_OPERATOR.

Referenced by processElementTransformationList(), and processNodeTransformationChild().

## ◆ processElementTransformationList()

static eZTemplateCompiler::processElementTransformationList | ( |  | $tpl,
|  | & | $node,
|  |  | $elements,
|  | & | $privateData
| ) |  |
| static

Iterates over the element list $elements and transforms them.

See also
  processElementTransformationChild

Definition at line 1211 of file eztemplatecompiler.php.

References processElementTransformationChild().

Referenced by eZTemplateCompiledLoop\processChildren(), eZTemplateSwitchFunction\templateNodeCaseTransformation(), eZTemplateIfFunction\templateNodeTransformation(), and eZTemplateSectionFunction\templateNodeTransformation().

## ◆ processNodeCombining()

static eZTemplateCompiler::processNodeCombining | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $resourceData,
|  | & | $newNode
| ) |  |
| static

Iterates over the template node tree and tries to combine multiple static siblings into one element. The original tree is specified in $node and the new combined tree will be present in $newNode.

See also
  processNodeCombiningChildren

Definition at line 647 of file eztemplatecompiler.php.

References eZTemplate\NODE_ROOT, and processNodeCombiningChildren().

Referenced by compileTemplate().

## ◆ processNodeCombiningChildren()

static eZTemplateCompiler::processNodeCombiningChildren | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $nodeChildren,
|  | & | $resourceData,
|  | & | $parentNode
| ) |  |
| static

Does node combining on the children $nodeChildren.

See also
  processNodeCombining

Definition at line 668 of file eztemplatecompiler.php.

References combineStaticNodes(), inspectVariableData(), eZTemplate\NODE_FUNCTION, eZTemplate\NODE_ROOT, eZTemplate\NODE_TEXT, and eZTemplate\NODE_VARIABLE.

Referenced by processNodeCombining().

## ◆ processNodeTransformation()

static eZTemplateCompiler::processNodeTransformation | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $resourceData,
|  | & | $newNode
| ) |  |
| static

Iterates over the template node tree $node and returns a new transformed tree in $newNode.

See also
  processNodeTransformationRoot, processNodeTransformationChild

Definition at line 1002 of file eztemplatecompiler.php.

References processNodeTransformationRoot().

Referenced by compileTemplate().

## ◆ processNodeTransformationChild()

static eZTemplateCompiler::processNodeTransformationChild | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $resourceData
| ) |  |
| static

Iterates over the children of the function node $node and transforms the tree. If the node is not a function it will return `false`.

See also
  processNodeTransformationRoot, processNodeTransformationChild

Definition at line 1081 of file eztemplatecompiler.php.

References eZTemplate\NODE_FUNCTION, eZTemplate\NODE_ROOT, eZTemplate\NODE_VARIABLE, processElementTransformationChild(), and processNodeTransformationRoot().

Referenced by processNodeTransformationChildren(), and processNodeTransformationRoot().

## ◆ processNodeTransformationChildren()

static eZTemplateCompiler::processNodeTransformationChildren | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $children,
|  | & | $resourceData
| ) |  |
| static

Iterates over the children $children and does transformation on them.

See also
  processNodeTransformation, processNodeTransformationChild

Definition at line 1024 of file eztemplatecompiler.php.

References processNodeTransformationChild().

Referenced by processNodeTransformationNodes().

## ◆ processNodeTransformationNodes()

static eZTemplateCompiler::processNodeTransformationNodes | ( |  | $tpl,
|  | & | $node,
|  | & | $nodes,
|  | & | $privateData
| ) |  |
| static

Iterates over the nodes $nodes and does transformation on them.

See also
  processNodeTransformationChildren

Note
  This method can be called from operator and functions as long as they have the $privateData parameter.

Definition at line 1012 of file eztemplatecompiler.php.

References processNodeTransformationChildren().

Referenced by eZTemplateCompiledLoop\processChildren(), eZTemplateSwitchFunction\templateNodeCaseTransformation(), and eZTemplateSectionFunction\templateNodeTransformation().

## ◆ processNodeTransformationRoot()

static eZTemplateCompiler::processNodeTransformationRoot | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $resourceData
| ) |  |
| static

Iterates over the children of the root node $node and does transformation on them.

See also
  processNodeTransformation, processNodeTransformationChild

Definition at line 1047 of file eztemplatecompiler.php.

References eZTemplate\NODE_ROOT, and processNodeTransformationChild().

Referenced by processNodeTransformation(), and processNodeTransformationChild().

## ◆ processRemoveNodePlacement()

static eZTemplateCompiler::processRemoveNodePlacement | ( | & | $node | ) |
| static

Iterates over the node tree and removes all placement information.

Definition at line 1370 of file eztemplatecompiler.php.

References eZTemplate\NODE_FUNCTION, eZTemplate\NODE_OPERATOR, eZTemplate\NODE_ROOT, eZTemplate\NODE_TEXT, and eZTemplate\NODE_VARIABLE.

Referenced by compileTemplate().

## ◆ processStaticOptimizations()

static eZTemplateCompiler::processStaticOptimizations | ( |  | $useComments,
|  |  | $php,
|  |  | $tpl,
|  | & | $node,
|  | & | $resourceData,
|  | & | $newNode
| ) |  |
| static

Iterates over the items in the tree $node and tries to extract static data from operators which supports it.

Definition at line 899 of file eztemplatecompiler.php.

References inspectVariableData(), eZTemplate\NODE_FUNCTION, eZTemplate\NODE_ROOT, eZTemplate\NODE_TEXT, and eZTemplate\NODE_VARIABLE.

Referenced by compileTemplate().

## ◆ setSettings()

static eZTemplateCompiler::setSettings | ( |  | $settingsMap | ) |
| static

Sets/unsets various compiler settings. To set a setting add a key in the $settingsMap with the wanted value, to unset it use `null` as the value.

The following values can be set.

- compile - boolean, whether to compile templates or not
- comments - boolean, whether to include comments in templates
- accumulators - boolean, whether to include debug accumulators in templates
- timingpoints - boolean, whether to include debug timingpoints in templates
- fallbackresource - boolean, whether to include the fallback resource code
- nodeplacement - boolean, whether to include information on placement of all nodes
- execution - boolean, whether to execute the compiled templates or not
- generate - boolean, whether to always generate the compiled files, or only when template is changed
- compilation-directory - string, where to place compiled files, the path will be relative from the eZ Publish directory and not the var/cache directory.

Definition at line 82 of file eztemplatecompiler.php.

## ◆ staticNodeData()

static eZTemplateCompiler::staticNodeData | ( |  | $node | ) |
| static

Returns
  the static data for the node $node or `false` if no data could be fetched. Will only return data from text nodes and variables nodes without variable lookup, attribute lookup or operators.

Definition at line 868 of file eztemplatecompiler.php.

References eZTemplate\NODE_TEXT, eZTemplate\NODE_VARIABLE, eZTemplate\TYPE_ARRAY, eZTemplate\TYPE_BOOLEAN, eZTemplate\TYPE_IDENTIFIER, eZTemplate\TYPE_NUMERIC, and eZTemplate\TYPE_STRING.

Referenced by combineStaticNodes().

## ◆ TemplatePrefix()

static eZTemplateCompiler::TemplatePrefix | ( |  | ) |
| static

Returns the prefix for file names

Definition at line 55 of file eztemplatecompiler.php.

Referenced by compileTemplate(), createCommonCompileTemplate(), executeCompilationHelper(), generatePHPCodeChildren(), and hasCompiledTemplate().

## Member Data Documentation

## ◆ CODE_DATE

const eZTemplateCompiler::CODE_DATE = 1074699607

Definition at line 49 of file eztemplatecompiler.php.

Referenced by compileTemplate().

The documentation for this class was generated from the following file:

- eztemplatecompiler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.