Skip to content

Commit 502820c

Browse files
authored
AbstractTag: add cached instance of the config, to improve performance (#220)
1 parent 3a472d5 commit 502820c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Liquid/AbstractTag.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ abstract class AbstractTag
3737
*/
3838
protected $attributes = array();
3939

40+
/**
41+
* A cached instance of the config array, for performance reasons.
42+
*
43+
* @var array
44+
*/
45+
protected $config = array();
46+
4047
/**
4148
* Constructor.
4249
*
@@ -48,6 +55,8 @@ public function __construct($markup, array &$tokens, FileSystem $fileSystem = nu
4855
{
4956
$this->markup = $markup;
5057
$this->fileSystem = $fileSystem;
58+
$this->config = &Liquid::$config;
59+
5160
$this->parse($tokens);
5261
}
5362

0 commit comments

Comments
 (0)