class CacheFactoryDefault in Drupal driver for SQL Server and SQL Azure 8.2
Hierarchy
- class \Drupal\Driver\Database\sqlsrv\Component\CacheFactoryDefault implements CacheFactoryInterface
Expanded class hierarchy of CacheFactoryDefault
1 file declares its use of CacheFactoryDefault
- Connection.php in drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ PDO/ Connection.php
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Component/ CacheFactoryDefault.php, line 5
Namespace
Drupal\Driver\Database\sqlsrv\ComponentView source
class CacheFactoryDefault implements CacheFactoryInterface {
/**
* Unique prefix for this site/database
*
* @param string $prefix
* Unique prefix for this site/database
*/
public function __construct($prefix) {
$this->prefix = $prefix;
}
/**
* Unique prefix for this database
*
* @var string
*/
protected $prefix;
/**
* List of already loaded cache binaries.
*
* @var CacheInterface[]
*/
protected $binaries = [];
/**
* {@inhertidoc}
*/
public function get($bin) {
$name = $this->prefix . ':' . $bin;
if (!isset($this->binaries[$name])) {
if (extension_loaded('wincache')) {
$this->binaries[$name] = new CacheWincache($name);
}
elseif (function_exists("apcu_get")) {
$this->binaries[$name] = new CacheApcu($name);
}
else {
$this->binaries[$name] = new CacheStub($name);
}
}
return $this->binaries[$name];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheFactoryDefault:: |
protected | property | List of already loaded cache binaries. | |
CacheFactoryDefault:: |
protected | property | Unique prefix for this database | |
CacheFactoryDefault:: |
public | function |
{@inhertidoc} Overrides CacheFactoryInterface:: |
|
CacheFactoryDefault:: |
public | function | Unique prefix for this site/database |