diff --git a/config/cache.php b/config/cache.php index 0b13c94a1..67d1929ef 100644 --- a/config/cache.php +++ b/config/cache.php @@ -78,6 +78,20 @@ return [ 'prefix' => 'october', + /* + |-------------------------------------------------------------------------- + | Cache Key for the CMS' PHP code parser cache + |-------------------------------------------------------------------------- + | + | This option controls the cache key used by the CMS when storing generated + | PHP from the theme PHP sections. Recommended to change this when multiple + | servers running OctoberCMS are connected to the same cache server to + | prevent conflicts. + | + */ + + 'codeParserDataCacheKey' => 'cms-php-file-data', + /* |-------------------------------------------------------------------------- | Disable Request Cache @@ -90,5 +104,4 @@ return [ */ 'disableRequestCache' => false, - ]; diff --git a/modules/cms/classes/CodeParser.php b/modules/cms/classes/CodeParser.php index 81b9bb13a..b4a57564c 100644 --- a/modules/cms/classes/CodeParser.php +++ b/modules/cms/classes/CodeParser.php @@ -32,7 +32,7 @@ class CodeParser /** * @var string Key for the parsed PHP file information cache. */ - protected $dataCacheKey = 'cms-php-file-data'; + protected $dataCacheKey = ''; /** * Creates the class instance @@ -42,6 +42,7 @@ class CodeParser { $this->object = $object; $this->filePath = $object->getFilePath(); + $this->dataCacheKey = Config::get('cache.codeParserDataCacheKey', 'cms-php-file-data'); } /**