You are here

public function MemcacheSettings::get in Memcache API and Integration 8.2

Returns a memcache setting.

Settings can be set in settings.php in the $settings['memcache'] array and requested by this function. Settings should be used over configuration for read-only, possibly low bootstrap configuration that is environment specific.

Parameters

string $name: The name of the setting to return.

mixed $default: (optional) The default value to use if this setting is not set.

Return value

mixed The value of the setting, the provided default if not set.

File

src/MemcacheSettings.php, line 45

Class

MemcacheSettings
Class for holding Memcache related config.

Namespace

Drupal\memcache

Code

public function get($name, $default = NULL) {
  return isset($this->settings[$name]) ? $this->settings[$name] : $default;
}