Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
43 * @param \Memcached $memcached A \Memcached instance | 43 * @param \Memcached $memcached A \Memcached instance |
44 * @param array $options An associative array of Memcached options | 44 * @param array $options An associative array of Memcached options |
45 * | 45 * |
46 * @throws \InvalidArgumentException When unsupported options are passed | 46 * @throws \InvalidArgumentException When unsupported options are passed |
47 */ | 47 */ |
48 public function __construct(\Memcached $memcached, array $options = array()) | 48 public function __construct(\Memcached $memcached, array $options = []) |
49 { | 49 { |
50 $this->memcached = $memcached; | 50 $this->memcached = $memcached; |
51 | 51 |
52 if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { | 52 if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime'])) { |
53 throw new \InvalidArgumentException(sprintf( | 53 throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff))); |
54 'The following options are not supported "%s"', implode(', ', $diff) | |
55 )); | |
56 } | 54 } |
57 | 55 |
58 $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; | 56 $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; |
59 $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; | 57 $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; |
60 } | 58 } |
62 /** | 60 /** |
63 * {@inheritdoc} | 61 * {@inheritdoc} |
64 */ | 62 */ |
65 public function close() | 63 public function close() |
66 { | 64 { |
67 return true; | 65 return $this->memcached->quit(); |
68 } | 66 } |
69 | 67 |
70 /** | 68 /** |
71 * {@inheritdoc} | 69 * {@inheritdoc} |
72 */ | 70 */ |