5 * Contains \Drupal\memcache\DrupalMemcacheConfig.
8 namespace Drupal\memcache;
10 use Drupal\Core\Site\Settings;
13 * Class for holding Memcache related config
15 class DrupalMemcacheConfig {
18 * Array with the settings.
22 protected $settings = [];
27 * @param \Drupal\Core\Site\Settings $settings
28 * The site settings instance.
30 public function __construct(Settings $settings) {
31 $this->settings = $settings->get('memcache', []);
35 * Returns a memcache setting.
37 * Settings can be set in settings.php in the $settings['memcache'] array and
38 * requested by this function. Settings should be used over configuration for
39 * read-only, possibly low bootstrap configuration that is environment
43 * The name of the setting to return.
44 * @param mixed $default
45 * (optional) The default value to use if this setting is not set.
48 * The value of the setting, the provided default if not set.
50 public function get($name, $default = NULL) {
51 return isset($this->settings[$name]) ? $this->settings[$name] : $default;
55 * Returns all Memcache settings.
60 public function getAll() {
61 return $this->settings;