Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/Config/EnvParametersResource.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 |
---|---|
52 /** | 52 /** |
53 * @return array An array with two keys: 'prefix' for the prefix used and 'variables' containing all the variables watched by this resource | 53 * @return array An array with two keys: 'prefix' for the prefix used and 'variables' containing all the variables watched by this resource |
54 */ | 54 */ |
55 public function getResource() | 55 public function getResource() |
56 { | 56 { |
57 return array('prefix' => $this->prefix, 'variables' => $this->variables); | 57 return ['prefix' => $this->prefix, 'variables' => $this->variables]; |
58 } | 58 } |
59 | 59 |
60 /** | 60 /** |
61 * {@inheritdoc} | 61 * {@inheritdoc} |
62 */ | 62 */ |
63 public function isFresh($timestamp) | 63 public function isFresh($timestamp) |
64 { | 64 { |
65 return $this->findVariables() === $this->variables; | 65 return $this->findVariables() === $this->variables; |
66 } | 66 } |
67 | 67 |
68 /** | |
69 * @internal | |
70 */ | |
68 public function serialize() | 71 public function serialize() |
69 { | 72 { |
70 return serialize(array('prefix' => $this->prefix, 'variables' => $this->variables)); | 73 return serialize(['prefix' => $this->prefix, 'variables' => $this->variables]); |
71 } | 74 } |
72 | 75 |
76 /** | |
77 * @internal | |
78 */ | |
73 public function unserialize($serialized) | 79 public function unserialize($serialized) |
74 { | 80 { |
75 if (\PHP_VERSION_ID >= 70000) { | 81 if (\PHP_VERSION_ID >= 70000) { |
76 $unserialized = unserialize($serialized, array('allowed_classes' => false)); | 82 $unserialized = unserialize($serialized, ['allowed_classes' => false]); |
77 } else { | 83 } else { |
78 $unserialized = unserialize($serialized); | 84 $unserialized = unserialize($serialized); |
79 } | 85 } |
80 | 86 |
81 $this->prefix = $unserialized['prefix']; | 87 $this->prefix = $unserialized['prefix']; |
82 $this->variables = $unserialized['variables']; | 88 $this->variables = $unserialized['variables']; |
83 } | 89 } |
84 | 90 |
85 private function findVariables() | 91 private function findVariables() |
86 { | 92 { |
87 $variables = array(); | 93 $variables = []; |
88 | 94 |
89 foreach ($_SERVER as $key => $value) { | 95 foreach ($_SERVER as $key => $value) { |
90 if (0 === strpos($key, $this->prefix)) { | 96 if (0 === strpos($key, $this->prefix)) { |
91 $variables[$key] = $value; | 97 $variables[$key] = $value; |
92 } | 98 } |