1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of the Twig Bufferized Template package, an RunOpenCode project. |
4
|
|
|
* |
5
|
|
|
* (c) 2017 RunOpenCode |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
namespace RunOpenCode\Twig\BufferizedTemplate\Tag\TemplateBuffer; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Class AbstractBufferNode |
14
|
|
|
* |
15
|
|
|
* Base buffer node containing base methods and settings. |
16
|
|
|
* |
17
|
|
|
* @package RunOpenCode\Twig\BufferizedTemplate\Tag\TemplateBuffer |
18
|
|
|
* |
19
|
|
|
* @internal |
20
|
|
|
*/ |
21
|
|
|
abstract class AbstractBufferNode extends \Twig_Node |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* Default execution priority |
25
|
|
|
* |
26
|
|
|
* @var int |
27
|
|
|
*/ |
28
|
|
|
private $defaultExecutionPriority; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* AbstractBufferNode constructor. |
32
|
|
|
* |
33
|
|
|
* @param int $defaultExecutionPriority |
34
|
|
|
* @param array $nodes |
35
|
|
|
* @param array $attributes |
36
|
|
|
* @param int $lineno |
37
|
|
|
* @param null|string $tag |
38
|
|
|
*/ |
39
|
3 |
|
public function __construct($defaultExecutionPriority, array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) |
40
|
|
|
{ |
41
|
3 |
|
$this->defaultExecutionPriority = $defaultExecutionPriority; |
42
|
3 |
|
parent::__construct($nodes, $attributes, $lineno, $tag); |
43
|
3 |
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Get context random variable name. |
47
|
|
|
* |
48
|
|
|
* @return string |
49
|
|
|
*/ |
50
|
2 |
|
public function getContextVariableName() |
51
|
|
|
{ |
52
|
2 |
|
return '$_________runopencode_twig_bufferized_template_environment_variable_______iByUtNtcGcwrjomGoxjFQNuKmmOSVpZjLuKersvpdImnPTfXsCrfWXNrkpTV'; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Get execution priority. |
57
|
|
|
* |
58
|
|
|
* @return int |
59
|
|
|
*/ |
60
|
2 |
|
public function getExecutionPriority() |
61
|
|
|
{ |
62
|
2 |
|
if ($this->hasAttribute('bufferized_execution_priority')) { |
63
|
2 |
|
return $this->getAttribute('bufferized_execution_priority'); |
64
|
|
|
} |
65
|
|
|
|
66
|
2 |
|
return $this->defaultExecutionPriority; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|