Make code parser data cache key configurable (#3373)

Credit to @whsol
This commit is contained in:
whsol 2018-06-05 19:10:35 +03:00 committed by Luke Towers
parent 749cbace1b
commit 15cdf6e71f
2 changed files with 16 additions and 2 deletions

View File

@ -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,
];

View File

@ -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');
}
/**