public function ChainedFastRawBackendFactory::__construct in Supercache 8
Same name and namespace in other branches
- 2.0.x src/Cache/ChainedFastRawBackendFactory.php \Drupal\supercache\Cache\ChainedFastRawBackendFactory::__construct()
Constructs ChainedFastBackendFactory object.
Parameters
Settings|NULL $settings: (optional) The settings object.
string|NULL $consistent_service_name: (optional) The service name of the consistent backend factory. Defaults to:
- $settings->get('cache')['default'] (if specified)
- 'cache.backend.database' (if the above isn't specified)
string|NULL $fast_service_name: (optional) The service name of the fast backend factory. Defaults to:
- 'cache.backend.apcu' (if the PHP process has APCu enabled)
- NULL (if the PHP process doesn't have APCu enabled)
File
- src/
Cache/ ChainedFastRawBackendFactory.php, line 71 - Contains \Drupal\supercache\Cache\ChainedFastBackendFactory.
Class
- ChainedFastRawBackendFactory
- Defines the chained fast cache backend factory.
Namespace
Drupal\supercache\CacheCode
public function __construct(Settings $settings = NULL, $consistent_service_name = NULL, $fast_service_name = NULL) {
// Default the consistent backend to the site's default backend.
if (!isset($consistent_service_name)) {
$cache_settings = isset($settings) ? $settings
->get('rawcache') : array();
$consistent_service_name = isset($cache_settings['default']) ? $cache_settings['default'] : 'cache.rawbackend.database';
}
// Default the fast backend to APCu if it's available.
if (!isset($fast_service_name) && function_exists('apcu_fetch')) {
$fast_service_name = 'cache.rawbackend.apcu';
}
$this->consistentServiceName = $consistent_service_name;
$this->fastServiceName = $fast_service_name;
$this->caches = [];
$this->kernel_terminated = FALSE;
}