Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / memcache / src / DrupalMemcacheConfig.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\memcache\DrupalMemcacheConfig.
6  */
7
8 namespace Drupal\memcache;
9
10 use Drupal\Core\Site\Settings;
11
12 /**
13  * Class for holding Memcache related config
14  */
15 class DrupalMemcacheConfig {
16
17   /**
18    * Array with the settings.
19    *
20    * @var array
21    */
22   protected $settings = [];
23
24   /**
25    * Constructor.
26    *
27    * @param \Drupal\Core\Site\Settings $settings
28    *   The site settings instance.
29    */
30   public function __construct(Settings $settings) {
31     $this->settings = $settings->get('memcache', []);
32   }
33
34   /**
35    * Returns a memcache setting.
36    *
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
40    * specific.
41    *
42    * @param string $name
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.
46    *
47    * @return mixed
48    *   The value of the setting, the provided default if not set.
49    */
50   public function get($name, $default = NULL) {
51     return isset($this->settings[$name]) ? $this->settings[$name] : $default;
52   }
53
54   /**
55    * Returns all Memcache settings.
56    *
57    * @return array
58    *   All settings.
59    */
60   public function getAll() {
61     return $this->settings;
62   }
63 }