mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Set disable-segmentation for SSViewer cache
Cleanup
This commit is contained in:
parent
05a519ecc5
commit
779a4e2443
@ -110,7 +110,7 @@ class SS_ConfigManifest {
|
||||
|
||||
/**
|
||||
* Provides a hook for mock unit tests despite no DI
|
||||
* @return Zend_Cache_Frontend
|
||||
* @return Zend_Cache_Core
|
||||
*/
|
||||
protected function getCache()
|
||||
{
|
||||
|
@ -83,7 +83,11 @@ class SilverStripeVersionProvider
|
||||
|
||||
$lockData = array();
|
||||
if ($cache) {
|
||||
$cache = SS_Cache::factory('SilverStripeVersionProvider_composerlock', 'Output', array('disable-segmentation' => true));
|
||||
$cache = SS_Cache::factory(
|
||||
'SilverStripeVersionProvider_composerlock',
|
||||
'Output',
|
||||
array('disable-segmentation' => true)
|
||||
);
|
||||
$cacheKey = filemtime($composerLockPath);
|
||||
if ($versions = $cache->load($cacheKey)) {
|
||||
$lockData = json_decode($versions, true);
|
||||
|
@ -118,7 +118,7 @@ class i18n extends SS_Object implements TemplateGlobalProvider, Flushable {
|
||||
|
||||
/**
|
||||
* Return an instance of the cache used for i18n data.
|
||||
* @return Zend_Cache
|
||||
* @return Zend_Cache_Core
|
||||
*/
|
||||
public static function get_cache() {
|
||||
return SS_Cache::factory(
|
||||
|
@ -1016,6 +1016,14 @@ class SSViewer implements Flushable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Cache_Core
|
||||
*/
|
||||
protected static function defaultPartialCacheStore()
|
||||
{
|
||||
return SS_Cache::factory('cacheblock', 'Output', array('disable-segmentation' => true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to disable rewriting of <a href="#xxx"> links. This is useful in Ajax applications.
|
||||
* It returns the SSViewer objects, so that you can call new SSViewer("X")->dontRewriteHashlinks()->process();
|
||||
@ -1082,7 +1090,7 @@ class SSViewer implements Flushable {
|
||||
*/
|
||||
public static function flush_cacheblock_cache($force = false) {
|
||||
if (!self::$cacheblock_cache_flushed || $force) {
|
||||
$cache = SS_Cache::factory('cacheblock');
|
||||
$cache = self::defaultPartialCacheStore();
|
||||
$backend = $cache->getBackend();
|
||||
|
||||
if(
|
||||
@ -1120,7 +1128,7 @@ class SSViewer implements Flushable {
|
||||
* @return Zend_Cache_Core
|
||||
*/
|
||||
public function getPartialCacheStore() {
|
||||
return $this->partialCacheStore ? $this->partialCacheStore : SS_Cache::factory('cacheblock');
|
||||
return $this->partialCacheStore ? $this->partialCacheStore : self::defaultPartialCacheStore();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user