|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Twig_NodeVisitor_Optimizer tries to optimizes the AST. More...
Inheritance diagram for Twig_NodeVisitor_Optimizer:
Collaboration diagram for Twig_NodeVisitor_Optimizer:Public Member Functions | |
| __construct ($optimizers=-1) | |
| getPriority () | |
| Returns the priority for this visitor. More... | |
Public Member Functions inherited from Twig_BaseNodeVisitor | |
| enterNode (Twig_NodeInterface $node, Twig_Environment $env) | |
| Called before child nodes are visited. More... | |
| leaveNode (Twig_NodeInterface $node, Twig_Environment $env) | |
| Called after child nodes are visited. More... | |
| enterNode (Twig_NodeInterface $node, Twig_Environment $env) | |
| Called before child nodes are visited. More... | |
| leaveNode (Twig_NodeInterface $node, Twig_Environment $env) | |
| Called after child nodes are visited. More... | |
| getPriority () | |
| Returns the priority for this visitor. More... | |
Data Fields | |
| const | OPTIMIZE_ALL = -1 |
| const | OPTIMIZE_NONE = 0 |
| const | OPTIMIZE_FOR = 2 |
| const | OPTIMIZE_RAW_FILTER = 4 |
| const | OPTIMIZE_VAR_ACCESS = 8 |
Protected Member Functions | |
| doEnterNode (Twig_Node $node, Twig_Environment $env) | |
| Called before child nodes are visited. More... | |
| doLeaveNode (Twig_Node $node, Twig_Environment $env) | |
| Called after child nodes are visited. More... | |
| optimizeVariables (Twig_NodeInterface $node, Twig_Environment $env) | |
| optimizePrintNode (Twig_NodeInterface $node, Twig_Environment $env) | |
| Optimizes print nodes. More... | |
| optimizeRawFilter (Twig_NodeInterface $node, Twig_Environment $env) | |
| Removes "raw" filters. More... | |
| enterOptimizeFor (Twig_NodeInterface $node, Twig_Environment $env) | |
| Optimizes "for" tag by removing the "loop" variable creation whenever possible. More... | |
| leaveOptimizeFor (Twig_NodeInterface $node, Twig_Environment $env) | |
| Optimizes "for" tag by removing the "loop" variable creation whenever possible. More... | |
| addLoopToCurrent () | |
| addLoopToAll () | |
| doEnterNode (Twig_Node $node, Twig_Environment $env) | |
| Called before child nodes are visited. More... | |
| doLeaveNode (Twig_Node $node, Twig_Environment $env) | |
| Called after child nodes are visited. More... | |
Protected Attributes | |
| $loops = array() | |
| $loopsTargets = array() | |
| $optimizers | |
| $prependedNodes = array() | |
| $inABody = false | |
Twig_NodeVisitor_Optimizer tries to optimizes the AST.
This visitor is always the last registered one.
You can configure which optimizations you want to activate via the optimizer mode.
@final
Definition at line 24 of file Optimizer.php.
| Twig_NodeVisitor_Optimizer::__construct | ( | $optimizers = -1 | ) |
| int | $optimizers | The optimizer mode |
Definition at line 41 of file Optimizer.php.
References $optimizers.
|
protected |
Definition at line 240 of file Optimizer.php.
Referenced by enterOptimizeFor().
Here is the caller graph for this function:
|
protected |
Definition at line 235 of file Optimizer.php.
Referenced by enterOptimizeFor().
Here is the caller graph for this function:
|
protected |
Called before child nodes are visited.
Reimplemented from Twig_BaseNodeVisitor.
Definition at line 50 of file Optimizer.php.
References $env, enterOptimizeFor(), and optimizeVariables().
Here is the call graph for this function:
|
protected |
Called after child nodes are visited.
Reimplemented from Twig_BaseNodeVisitor.
Definition at line 73 of file Optimizer.php.
References $env, $name, $nodes, $prependedNodes, Twig_Node\getTemplateLine(), leaveOptimizeFor(), optimizePrintNode(), and optimizeRawFilter().
Here is the call graph for this function:
|
protected |
Optimizes "for" tag by removing the "loop" variable creation whenever possible.
Definition at line 162 of file Optimizer.php.
References addLoopToAll(), and addLoopToCurrent().
Referenced by doEnterNode().
Here is the call graph for this function:
Here is the caller graph for this function:| Twig_NodeVisitor_Optimizer::getPriority | ( | ) |
Returns the priority for this visitor.
Priority should be between -10 and 10 (0 is the default).
Implements Twig_NodeVisitorInterface.
Definition at line 247 of file Optimizer.php.
|
protected |
Optimizes "for" tag by removing the "loop" variable creation whenever possible.
Definition at line 226 of file Optimizer.php.
Referenced by doLeaveNode().
Here is the caller graph for this function:
|
protected |
Optimizes print nodes.
It replaces:
Definition at line 126 of file Optimizer.php.
Referenced by doLeaveNode().
Here is the caller graph for this function:
|
protected |
Removes "raw" filters.
Definition at line 150 of file Optimizer.php.
Referenced by doLeaveNode().
Here is the caller graph for this function:
|
protected |
Definition at line 106 of file Optimizer.php.
Referenced by doEnterNode().
Here is the caller graph for this function:
|
protected |
Definition at line 36 of file Optimizer.php.
|
protected |
Definition at line 32 of file Optimizer.php.
|
protected |
Definition at line 33 of file Optimizer.php.
|
protected |
Definition at line 34 of file Optimizer.php.
Referenced by __construct().
|
protected |
Definition at line 35 of file Optimizer.php.
Referenced by doLeaveNode().
| const Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL = -1 |
Definition at line 26 of file Optimizer.php.
| const Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR = 2 |
Definition at line 28 of file Optimizer.php.
| const Twig_NodeVisitor_Optimizer::OPTIMIZE_NONE = 0 |
Definition at line 27 of file Optimizer.php.
| const Twig_NodeVisitor_Optimizer::OPTIMIZE_RAW_FILTER = 4 |
Definition at line 29 of file Optimizer.php.
| const Twig_NodeVisitor_Optimizer::OPTIMIZE_VAR_ACCESS = 8 |
Definition at line 30 of file Optimizer.php.