From b0536cf443c6c1685bcd7ff7ba522415079ae3f3 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Mon, 7 Oct 2024 07:57:57 +0900 Subject: [PATCH] AbstractTag: add cached instance of the config, to improve performance --- src/Liquid/AbstractTag.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Liquid/AbstractTag.php b/src/Liquid/AbstractTag.php index 6b382672..af20bcba 100644 --- a/src/Liquid/AbstractTag.php +++ b/src/Liquid/AbstractTag.php @@ -37,6 +37,13 @@ abstract class AbstractTag */ protected $attributes = array(); + /** + * A cached instance of the config array, for performance reasons. + * + * @var array + */ + protected $config = array(); + /** * Constructor. * @@ -48,6 +55,8 @@ public function __construct($markup, array &$tokens, FileSystem $fileSystem = nu { $this->markup = $markup; $this->fileSystem = $fileSystem; + $this->config = &Liquid::$config; + $this->parse($tokens); }