Skip to content
Snippets Groups Projects
Commit b7656b98 authored by Samuli Sillanpää's avatar Samuli Sillanpää Committed by Robert Lange
Browse files

Add support for prefixing Solr tree data cache filenames.

- Makes subclassing possible without cache collisions.
parent 06c55105
No related merge requests found
......@@ -80,6 +80,13 @@ class Solr extends AbstractBase
*/
protected $batchSize = 1000;
/**
* Hierarchy cache file prefix.
*
* @var string
*/
protected $cachePrefix = null;
/**
* Constructor.
*
......@@ -265,7 +272,9 @@ class Solr extends AbstractBase
$cacheTemplate = 'tree_%s'
) {
$cacheFile = (null !== $this->cacheDir)
? $this->cacheDir . '/' . sprintf($cacheTemplate, urlencode($id))
? $this->cacheDir . '/'
. ($this->cachePrefix ? "{$this->cachePrefix}_" : '')
. sprintf($cacheTemplate, urlencode($id))
: false;
$useCache = isset($options['refresh']) ? !$options['refresh'] : true;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment