1 | <?php |
||
17 | class Memcache extends BaseControl { |
||
18 | const EXTENSION = 'memcached'; |
||
19 | |||
20 | /** |
||
21 | * The subset of $conf possibly relevant to Memcache. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | const MEMCACHE_KEYS = [ |
||
26 | 'cache_backends', |
||
27 | 'cache_class_cache_form', |
||
28 | 'cache_default_class', |
||
29 | 'lock_inc', |
||
30 | 'memcache_bins', |
||
31 | 'memcache_extension', |
||
32 | 'memcache_key_prefix', |
||
33 | 'memcache_servers', |
||
34 | 'memcache_stampede_protection', |
||
35 | 'memcache_stampede_semaphore', |
||
36 | 'memcache_stampede_wait_limit', |
||
37 | 'memcache_stampede_wait_time', |
||
38 | 'page_cache_invoke_hooks', |
||
39 | 'page_cache_without_database', |
||
40 | ]; |
||
41 | |||
42 | protected $settings; |
||
43 | |||
44 | /** |
||
45 | * The Memcache plugin constructor. |
||
46 | */ |
||
47 | public function __construct() { |
||
54 | |||
55 | /** |
||
56 | * Initializer: must be implemented in concrete classes. |
||
57 | * |
||
58 | * Assignment to $this->package_name cannot be factored because it uses a |
||
59 | * per-class magic constant. |
||
60 | */ |
||
61 | public function init() { |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public static function getDependencies() { |
||
75 | |||
76 | /** |
||
77 | * Check connectivity to a given Drupal cache bin in Memcached. |
||
78 | * |
||
79 | * @param string $bin |
||
80 | * The bin to check. |
||
81 | * @param string $cluster |
||
82 | * The name of the cluster to which the bin belongs. |
||
83 | * |
||
84 | * @return array |
||
85 | * A "check" array (name, status, result) |
||
86 | */ |
||
87 | protected function checkBin(string $bin, string $cluster): array { |
||
121 | |||
122 | /** |
||
123 | * Check the configured bins. |
||
124 | * |
||
125 | * @param \Drupal\qa\Pass $pass |
||
126 | * The current control pass. |
||
127 | * |
||
128 | * @return \Drupal\qa\Pass |
||
129 | * The updated control pass. |
||
130 | */ |
||
131 | protected function checkBins(Pass $pass): Pass { |
||
141 | |||
142 | /** |
||
143 | * Accumulate and format the results of the control pass. |
||
144 | * |
||
145 | * @param \Drupal\qa\Pass $pass |
||
146 | * The current control pass. |
||
147 | * |
||
148 | * @return \Drupal\qa\Pass |
||
149 | * The updated control pass. |
||
150 | * |
||
151 | * @throws \Exception |
||
152 | */ |
||
153 | protected function finalizeBins(Pass $pass): Pass { |
||
172 | |||
173 | /** |
||
174 | * Format the results of a pre-control requirements check. |
||
175 | * |
||
176 | * @param \Drupal\qa\Pass $pass |
||
177 | * The current control pass. |
||
178 | * |
||
179 | * @return \Drupal\qa\Pass |
||
180 | * The updated control pass. |
||
181 | */ |
||
182 | protected function finalizeRequirements(Pass $pass): Pass { |
||
188 | |||
189 | /** |
||
190 | * {@inheritdoc} |
||
191 | */ |
||
192 | public function run(): Pass { |
||
219 | |||
220 | } |
||
221 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.