Total Complexity | 110 |
Total Lines | 1098 |
Duplicated Lines | 0 % |
Changes | 6 | ||
Bugs | 1 | Features | 1 |
Complex classes like SiteConfiguration often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use SiteConfiguration, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
18 | class SiteConfiguration |
||
19 | { |
||
20 | private $baseUrl = 'https://accounts.wmflabs.org'; |
||
21 | private $filePath = __DIR__ . '/..'; |
||
22 | private $schemaVersion = 49; |
||
23 | private $debuggingTraceEnabled = false; |
||
24 | private $debuggingCssBreakpointsEnabled = false; |
||
25 | private $dataClearIp = '127.0.0.1'; |
||
26 | private $dataClearEmail = '[email protected]'; |
||
27 | private $dataClearInterval = '15 DAY'; |
||
28 | private $forceIdentification = true; |
||
29 | private $identificationCacheExpiry = '1 DAY'; |
||
30 | private $metaWikimediaWebServiceEndpoint = 'https://meta.wikimedia.org/w/api.php'; |
||
31 | private $enforceOAuth = false; |
||
32 | private $emailConfirmationEnabled = true; |
||
33 | private $emailConfirmationExpiryDays = 7; |
||
34 | private $miserModeLimit = 25; |
||
35 | private $squidList = array(); |
||
36 | private $useStrictTransportSecurity = false; |
||
37 | private $userAgent = 'Wikipedia-ACC Tool/0.1 (+https://accounts.wmflabs.org/internal.php/team)'; |
||
38 | private $curlDisableVerifyPeer = false; |
||
39 | private $useOAuthSignup = true; |
||
40 | private $oauthConsumerToken; |
||
41 | /** @var array */ |
||
42 | private $oauthLegacyConsumerTokens; |
||
43 | private $oauthConsumerSecret; |
||
44 | private $oauthIdentityGraceTime = '24 hours'; |
||
45 | private $oauthMediaWikiCanonicalServer = 'https://en.wikipedia.org'; |
||
46 | private $xffTrustedHostsFile = '../TrustedXFF/trusted-hosts.txt'; |
||
47 | private $crossOriginResourceSharingHosts = array( |
||
48 | "https://en.wikipedia.org", |
||
49 | "https://meta.wikimedia.org", |
||
50 | ); |
||
51 | private $ircNotificationsEnabled = true; |
||
52 | private $ircNotificationsInstance = 'Development'; |
||
53 | private $errorLog = 'errorlog'; |
||
54 | private $titleBlacklistEnabled = false; |
||
55 | /** @var null|string $locationProviderApiKey */ |
||
56 | private $locationProviderApiKey = null; |
||
57 | private $torExitPaths = array(); |
||
58 | private $creationBotUsername = ''; |
||
59 | private $creationBotPassword = ''; |
||
60 | private $curlCookieJar = __DIR__ . '/../../cookies.txt'; |
||
61 | private $yubicoApiId = 0; |
||
62 | private $yubicoApiKey = ""; |
||
63 | private $totpEncryptionKey = "1234"; |
||
64 | private $identificationNoticeboardPage = 'Access to nonpublic personal data policy/Noticeboard'; |
||
65 | private $identificationNoticeboardWebserviceEndpoint = 'https://meta.wikimedia.org/w/api.php'; |
||
66 | private $registrationAllowed = true; |
||
67 | private $cspReportUri = null; |
||
68 | private $resourceCacheEpoch = 1; |
||
69 | private $commonEmailDomains = ['gmail.com', 'hotmail.com', 'outlook.com']; |
||
70 | private $banMaxIpBlockRange = [4 => 20, 6 => 48]; |
||
71 | private $banMaxIpRange = [4 => 16, 6 => 32]; |
||
72 | private $jobQueueBatchSize = 10; |
||
73 | private $amqpConfiguration = ['host' => 'localhost', 'port' => 5672, 'user' => 'guest', 'password' => 'guest', 'vhost' => '/', 'exchange' => '', 'tls' => false]; |
||
74 | private $emailSender = '[email protected]'; |
||
75 | private $acceptClientHints = []; |
||
76 | private string $cookiePath = '/'; |
||
77 | private string $cookieSessionName = 'ACC'; |
||
78 | private array $offline = ['offline' => false, 'reason' => '', 'culprit' => '']; |
||
79 | private array $databaseConfig = [ |
||
80 | 'datasource' => 'mysql:host=localhost;dbname=waca', |
||
81 | 'username' => 'waca', |
||
82 | 'password' => 'waca' |
||
83 | ]; |
||
84 | |||
85 | /** |
||
86 | * Gets the base URL of the tool |
||
87 | * |
||
88 | * If the internal page of the tool is at http://localhost/path/internal.php, this would be set to |
||
89 | * http://localhost/path |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getBaseUrl() |
||
93 | { |
||
94 | return $this->baseUrl; |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * @param string $baseUrl |
||
99 | * |
||
100 | * @return SiteConfiguration |
||
101 | */ |
||
102 | public function setBaseUrl($baseUrl) |
||
103 | { |
||
104 | $this->baseUrl = $baseUrl; |
||
105 | |||
106 | return $this; |
||
107 | } |
||
108 | |||
109 | /** |
||
110 | * Path on disk to the directory containing the tool's code |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getFilePath() |
||
114 | { |
||
115 | return $this->filePath; |
||
116 | } |
||
117 | |||
118 | /** |
||
119 | * @param string $filePath |
||
120 | * |
||
121 | * @return SiteConfiguration |
||
122 | */ |
||
123 | public function setFilePath($filePath) |
||
124 | { |
||
125 | $this->filePath = $filePath; |
||
126 | |||
127 | return $this; |
||
128 | } |
||
129 | |||
130 | /** |
||
131 | * @return int |
||
132 | */ |
||
133 | public function getSchemaVersion() |
||
134 | { |
||
135 | return $this->schemaVersion; |
||
136 | } |
||
137 | |||
138 | /** |
||
139 | * @param int $schemaVersion |
||
140 | * |
||
141 | * @return SiteConfiguration |
||
142 | */ |
||
143 | public function setSchemaVersion($schemaVersion) |
||
144 | { |
||
145 | $this->schemaVersion = $schemaVersion; |
||
146 | |||
147 | return $this; |
||
148 | } |
||
149 | |||
150 | /** |
||
151 | * @return mixed |
||
152 | */ |
||
153 | public function getDebuggingTraceEnabled() |
||
154 | { |
||
155 | return $this->debuggingTraceEnabled; |
||
156 | } |
||
157 | |||
158 | /** |
||
159 | * @param mixed $debuggingTraceEnabled |
||
160 | * |
||
161 | * @return SiteConfiguration |
||
162 | */ |
||
163 | public function setDebuggingTraceEnabled($debuggingTraceEnabled) |
||
164 | { |
||
165 | $this->debuggingTraceEnabled = $debuggingTraceEnabled; |
||
166 | |||
167 | return $this; |
||
168 | } |
||
169 | |||
170 | public function getDebuggingCssBreakpointsEnabled() : bool |
||
171 | { |
||
172 | return $this->debuggingCssBreakpointsEnabled; |
||
173 | } |
||
174 | |||
175 | public function setDebuggingCssBreakpointsEnabled(bool $debuggingCssBreakpointsEnabled) : SiteConfiguration |
||
176 | { |
||
177 | $this->debuggingCssBreakpointsEnabled = $debuggingCssBreakpointsEnabled; |
||
178 | |||
179 | return $this; |
||
180 | } |
||
181 | |||
182 | /** |
||
183 | * @return string |
||
184 | */ |
||
185 | public function getDataClearIp() |
||
186 | { |
||
187 | return $this->dataClearIp; |
||
188 | } |
||
189 | |||
190 | /** |
||
191 | * @param string $dataClearIp |
||
192 | * |
||
193 | * @return SiteConfiguration |
||
194 | */ |
||
195 | public function setDataClearIp($dataClearIp) |
||
196 | { |
||
197 | $this->dataClearIp = $dataClearIp; |
||
198 | |||
199 | return $this; |
||
200 | } |
||
201 | |||
202 | /** |
||
203 | * @return string |
||
204 | */ |
||
205 | public function getDataClearEmail() |
||
206 | { |
||
207 | return $this->dataClearEmail; |
||
208 | } |
||
209 | |||
210 | /** |
||
211 | * @param string $dataClearEmail |
||
212 | * |
||
213 | * @return SiteConfiguration |
||
214 | */ |
||
215 | public function setDataClearEmail($dataClearEmail) |
||
216 | { |
||
217 | $this->dataClearEmail = $dataClearEmail; |
||
218 | |||
219 | return $this; |
||
220 | } |
||
221 | |||
222 | /** |
||
223 | * @return boolean |
||
224 | */ |
||
225 | public function getForceIdentification() |
||
226 | { |
||
227 | return $this->forceIdentification; |
||
228 | } |
||
229 | |||
230 | /** |
||
231 | * @param boolean $forceIdentification |
||
232 | * |
||
233 | * @return SiteConfiguration |
||
234 | */ |
||
235 | public function setForceIdentification($forceIdentification) |
||
236 | { |
||
237 | $this->forceIdentification = $forceIdentification; |
||
238 | |||
239 | return $this; |
||
240 | } |
||
241 | |||
242 | /** |
||
243 | * @return string |
||
244 | */ |
||
245 | public function getIdentificationCacheExpiry() |
||
246 | { |
||
247 | return $this->identificationCacheExpiry; |
||
248 | } |
||
249 | |||
250 | /** |
||
251 | * @param string $identificationCacheExpiry |
||
252 | * |
||
253 | * @return SiteConfiguration |
||
254 | */ |
||
255 | public function setIdentificationCacheExpiry($identificationCacheExpiry) |
||
256 | { |
||
257 | $this->identificationCacheExpiry = $identificationCacheExpiry; |
||
258 | |||
259 | return $this; |
||
260 | } |
||
261 | |||
262 | /** |
||
263 | * @return string |
||
264 | */ |
||
265 | public function getMetaWikimediaWebServiceEndpoint() |
||
268 | } |
||
269 | |||
270 | /** |
||
271 | * @param string $metaWikimediaWebServiceEndpoint |
||
272 | * |
||
273 | * @return SiteConfiguration |
||
274 | */ |
||
275 | public function setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint) |
||
276 | { |
||
277 | $this->metaWikimediaWebServiceEndpoint = $metaWikimediaWebServiceEndpoint; |
||
278 | |||
279 | return $this; |
||
280 | } |
||
281 | |||
282 | /** |
||
283 | * @return boolean |
||
284 | */ |
||
285 | public function getEnforceOAuth() |
||
286 | { |
||
287 | return $this->enforceOAuth; |
||
288 | } |
||
289 | |||
290 | /** |
||
291 | * @param boolean $enforceOAuth |
||
292 | * |
||
293 | * @return SiteConfiguration |
||
294 | */ |
||
295 | public function setEnforceOAuth($enforceOAuth) |
||
296 | { |
||
297 | $this->enforceOAuth = $enforceOAuth; |
||
298 | |||
299 | return $this; |
||
300 | } |
||
301 | |||
302 | /** |
||
303 | * @return boolean |
||
304 | */ |
||
305 | public function getEmailConfirmationEnabled() |
||
306 | { |
||
307 | return $this->emailConfirmationEnabled; |
||
308 | } |
||
309 | |||
310 | /** |
||
311 | * @param boolean $emailConfirmationEnabled |
||
312 | * |
||
313 | * @return $this |
||
314 | */ |
||
315 | public function setEmailConfirmationEnabled($emailConfirmationEnabled) |
||
316 | { |
||
317 | $this->emailConfirmationEnabled = $emailConfirmationEnabled; |
||
318 | |||
319 | return $this; |
||
320 | } |
||
321 | |||
322 | /** |
||
323 | * @return int |
||
324 | */ |
||
325 | public function getMiserModeLimit() |
||
328 | } |
||
329 | |||
330 | /** |
||
331 | * @param int $miserModeLimit |
||
332 | * |
||
333 | * @return SiteConfiguration |
||
334 | */ |
||
335 | public function setMiserModeLimit($miserModeLimit) |
||
336 | { |
||
337 | $this->miserModeLimit = $miserModeLimit; |
||
338 | |||
339 | return $this; |
||
340 | } |
||
341 | |||
342 | /** |
||
343 | * @return array |
||
344 | */ |
||
345 | public function getSquidList() |
||
346 | { |
||
347 | return $this->squidList; |
||
348 | } |
||
349 | |||
350 | /** |
||
351 | * @param array $squidList |
||
352 | * |
||
353 | * @return SiteConfiguration |
||
354 | */ |
||
355 | public function setSquidList($squidList) |
||
356 | { |
||
357 | $this->squidList = $squidList; |
||
358 | |||
359 | return $this; |
||
360 | } |
||
361 | |||
362 | /** |
||
363 | * @return boolean |
||
364 | */ |
||
365 | public function getUseStrictTransportSecurity() |
||
366 | { |
||
367 | return $this->useStrictTransportSecurity; |
||
368 | } |
||
369 | |||
370 | /** |
||
371 | * @param boolean $useStrictTransportSecurity |
||
372 | * |
||
373 | * @return SiteConfiguration |
||
374 | */ |
||
375 | public function setUseStrictTransportSecurity($useStrictTransportSecurity) |
||
376 | { |
||
377 | $this->useStrictTransportSecurity = $useStrictTransportSecurity; |
||
378 | |||
379 | return $this; |
||
380 | } |
||
381 | |||
382 | /** |
||
383 | * @return string |
||
384 | */ |
||
385 | public function getUserAgent() |
||
386 | { |
||
387 | return $this->userAgent; |
||
388 | } |
||
389 | |||
390 | /** |
||
391 | * @param string $userAgent |
||
392 | * |
||
393 | * @return SiteConfiguration |
||
394 | */ |
||
395 | public function setUserAgent($userAgent) |
||
396 | { |
||
397 | $this->userAgent = $userAgent; |
||
398 | |||
399 | return $this; |
||
400 | } |
||
401 | |||
402 | /** |
||
403 | * @return boolean |
||
404 | */ |
||
405 | public function getCurlDisableVerifyPeer() |
||
406 | { |
||
407 | return $this->curlDisableVerifyPeer; |
||
408 | } |
||
409 | |||
410 | /** |
||
411 | * @param boolean $curlDisableVerifyPeer |
||
412 | * |
||
413 | * @return SiteConfiguration |
||
414 | */ |
||
415 | public function setCurlDisableVerifyPeer($curlDisableVerifyPeer) |
||
416 | { |
||
417 | $this->curlDisableVerifyPeer = $curlDisableVerifyPeer; |
||
418 | |||
419 | return $this; |
||
420 | } |
||
421 | |||
422 | /** |
||
423 | * @return boolean |
||
424 | */ |
||
425 | public function getUseOAuthSignup() |
||
426 | { |
||
427 | return $this->useOAuthSignup; |
||
428 | } |
||
429 | |||
430 | /** |
||
431 | * @param boolean $useOAuthSignup |
||
432 | * |
||
433 | * @return SiteConfiguration |
||
434 | */ |
||
435 | public function setUseOAuthSignup($useOAuthSignup) |
||
436 | { |
||
437 | $this->useOAuthSignup = $useOAuthSignup; |
||
438 | |||
439 | return $this; |
||
440 | } |
||
441 | |||
442 | /** |
||
443 | * @return mixed |
||
444 | */ |
||
445 | public function getOAuthConsumerToken() |
||
446 | { |
||
447 | return $this->oauthConsumerToken; |
||
448 | } |
||
449 | |||
450 | /** |
||
451 | * @param mixed $oauthConsumerToken |
||
452 | * |
||
453 | * @return SiteConfiguration |
||
454 | */ |
||
455 | public function setOAuthConsumerToken($oauthConsumerToken) |
||
456 | { |
||
457 | $this->oauthConsumerToken = $oauthConsumerToken; |
||
458 | |||
459 | return $this; |
||
460 | } |
||
461 | |||
462 | /** |
||
463 | * @return mixed |
||
464 | */ |
||
465 | public function getOAuthConsumerSecret() |
||
466 | { |
||
467 | return $this->oauthConsumerSecret; |
||
468 | } |
||
469 | |||
470 | /** |
||
471 | * @param mixed $oauthConsumerSecret |
||
472 | * |
||
473 | * @return SiteConfiguration |
||
474 | */ |
||
475 | public function setOAuthConsumerSecret($oauthConsumerSecret) |
||
476 | { |
||
477 | $this->oauthConsumerSecret = $oauthConsumerSecret; |
||
478 | |||
479 | return $this; |
||
480 | } |
||
481 | |||
482 | /** |
||
483 | * @return string |
||
484 | */ |
||
485 | public function getDataClearInterval() |
||
486 | { |
||
487 | return $this->dataClearInterval; |
||
488 | } |
||
489 | |||
490 | /** |
||
491 | * @param string $dataClearInterval |
||
492 | * |
||
493 | * @return SiteConfiguration |
||
494 | */ |
||
495 | public function setDataClearInterval($dataClearInterval) |
||
496 | { |
||
497 | $this->dataClearInterval = $dataClearInterval; |
||
498 | |||
499 | return $this; |
||
500 | } |
||
501 | |||
502 | /** |
||
503 | * @return string |
||
504 | */ |
||
505 | public function getXffTrustedHostsFile() |
||
506 | { |
||
507 | return $this->xffTrustedHostsFile; |
||
508 | } |
||
509 | |||
510 | /** |
||
511 | * @param string $xffTrustedHostsFile |
||
512 | * |
||
513 | * @return SiteConfiguration |
||
514 | */ |
||
515 | public function setXffTrustedHostsFile($xffTrustedHostsFile) |
||
516 | { |
||
517 | $this->xffTrustedHostsFile = $xffTrustedHostsFile; |
||
518 | |||
519 | return $this; |
||
520 | } |
||
521 | |||
522 | /** |
||
523 | * @return array |
||
524 | */ |
||
525 | public function getCrossOriginResourceSharingHosts() |
||
526 | { |
||
527 | return $this->crossOriginResourceSharingHosts; |
||
528 | } |
||
529 | |||
530 | /** |
||
531 | * @param array $crossOriginResourceSharingHosts |
||
532 | * |
||
533 | * @return SiteConfiguration |
||
534 | */ |
||
535 | public function setCrossOriginResourceSharingHosts($crossOriginResourceSharingHosts) |
||
536 | { |
||
537 | $this->crossOriginResourceSharingHosts = $crossOriginResourceSharingHosts; |
||
538 | |||
539 | return $this; |
||
540 | } |
||
541 | |||
542 | /** |
||
543 | * @return boolean |
||
544 | */ |
||
545 | public function getIrcNotificationsEnabled() |
||
546 | { |
||
547 | return $this->ircNotificationsEnabled; |
||
548 | } |
||
549 | |||
550 | /** |
||
551 | * @param boolean $ircNotificationsEnabled |
||
552 | * |
||
553 | * @return SiteConfiguration |
||
554 | */ |
||
555 | public function setIrcNotificationsEnabled($ircNotificationsEnabled) |
||
556 | { |
||
557 | $this->ircNotificationsEnabled = $ircNotificationsEnabled; |
||
558 | |||
559 | return $this; |
||
560 | } |
||
561 | |||
562 | /** |
||
563 | * @param string $errorLog |
||
564 | * |
||
565 | * @return SiteConfiguration |
||
566 | */ |
||
567 | public function setErrorLog($errorLog) |
||
568 | { |
||
569 | $this->errorLog = $errorLog; |
||
570 | |||
571 | return $this; |
||
572 | } |
||
573 | |||
574 | /** |
||
575 | * @return string |
||
576 | */ |
||
577 | public function getErrorLog() |
||
578 | { |
||
579 | return $this->errorLog; |
||
580 | } |
||
581 | |||
582 | /** |
||
583 | * @param int $emailConfirmationExpiryDays |
||
584 | * |
||
585 | * @return SiteConfiguration |
||
586 | */ |
||
587 | public function setEmailConfirmationExpiryDays($emailConfirmationExpiryDays) |
||
588 | { |
||
589 | $this->emailConfirmationExpiryDays = $emailConfirmationExpiryDays; |
||
590 | |||
591 | return $this; |
||
592 | } |
||
593 | |||
594 | /** |
||
595 | * @return int |
||
596 | */ |
||
597 | public function getEmailConfirmationExpiryDays() |
||
598 | { |
||
599 | return $this->emailConfirmationExpiryDays; |
||
600 | } |
||
601 | |||
602 | /** |
||
603 | * @param string $ircNotificationsInstance |
||
604 | * |
||
605 | * @return SiteConfiguration |
||
606 | */ |
||
607 | public function setIrcNotificationsInstance($ircNotificationsInstance) |
||
608 | { |
||
609 | $this->ircNotificationsInstance = $ircNotificationsInstance; |
||
610 | |||
611 | return $this; |
||
612 | } |
||
613 | |||
614 | /** |
||
615 | * @return string |
||
616 | */ |
||
617 | public function getIrcNotificationsInstance() |
||
618 | { |
||
619 | return $this->ircNotificationsInstance; |
||
620 | } |
||
621 | |||
622 | /** |
||
623 | * @param boolean $titleBlacklistEnabled |
||
624 | * |
||
625 | * @return SiteConfiguration |
||
626 | */ |
||
627 | public function setTitleBlacklistEnabled($titleBlacklistEnabled) |
||
628 | { |
||
629 | $this->titleBlacklistEnabled = $titleBlacklistEnabled; |
||
630 | |||
631 | return $this; |
||
632 | } |
||
633 | |||
634 | /** |
||
635 | * @return boolean |
||
636 | */ |
||
637 | public function getTitleBlacklistEnabled() |
||
638 | { |
||
639 | return $this->titleBlacklistEnabled; |
||
640 | } |
||
641 | |||
642 | /** |
||
643 | * @param string|null $locationProviderApiKey |
||
644 | * |
||
645 | * @return SiteConfiguration |
||
646 | */ |
||
647 | public function setLocationProviderApiKey($locationProviderApiKey) |
||
648 | { |
||
649 | $this->locationProviderApiKey = $locationProviderApiKey; |
||
650 | |||
651 | return $this; |
||
652 | } |
||
653 | |||
654 | /** |
||
655 | * @return null|string |
||
656 | */ |
||
657 | public function getLocationProviderApiKey() |
||
658 | { |
||
659 | return $this->locationProviderApiKey; |
||
660 | } |
||
661 | |||
662 | /** |
||
663 | * @param array $torExitPaths |
||
664 | * |
||
665 | * @return SiteConfiguration |
||
666 | */ |
||
667 | public function setTorExitPaths($torExitPaths) |
||
668 | { |
||
669 | $this->torExitPaths = $torExitPaths; |
||
670 | |||
671 | return $this; |
||
672 | } |
||
673 | |||
674 | /** |
||
675 | * @return array |
||
676 | */ |
||
677 | public function getTorExitPaths() |
||
678 | { |
||
679 | return $this->torExitPaths; |
||
680 | } |
||
681 | |||
682 | /** |
||
683 | * @param string $oauthIdentityGraceTime |
||
684 | * |
||
685 | * @return SiteConfiguration |
||
686 | */ |
||
687 | public function setOauthIdentityGraceTime($oauthIdentityGraceTime) |
||
688 | { |
||
689 | $this->oauthIdentityGraceTime = $oauthIdentityGraceTime; |
||
690 | |||
691 | return $this; |
||
692 | } |
||
693 | |||
694 | /** |
||
695 | * @return string |
||
696 | */ |
||
697 | public function getOauthIdentityGraceTime() |
||
698 | { |
||
699 | return $this->oauthIdentityGraceTime; |
||
700 | } |
||
701 | |||
702 | /** |
||
703 | * @param string $oauthMediaWikiCanonicalServer |
||
704 | * |
||
705 | * @return SiteConfiguration |
||
706 | */ |
||
707 | public function setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer) |
||
708 | { |
||
709 | $this->oauthMediaWikiCanonicalServer = $oauthMediaWikiCanonicalServer; |
||
710 | |||
711 | return $this; |
||
712 | } |
||
713 | |||
714 | /** |
||
715 | * @return string |
||
716 | */ |
||
717 | public function getOauthMediaWikiCanonicalServer() |
||
718 | { |
||
719 | return $this->oauthMediaWikiCanonicalServer; |
||
720 | } |
||
721 | |||
722 | /** |
||
723 | * @param string $creationBotUsername |
||
724 | * |
||
725 | * @return SiteConfiguration |
||
726 | */ |
||
727 | public function setCreationBotUsername($creationBotUsername) |
||
728 | { |
||
729 | $this->creationBotUsername = $creationBotUsername; |
||
730 | |||
731 | return $this; |
||
732 | } |
||
733 | |||
734 | /** |
||
735 | * @return string |
||
736 | */ |
||
737 | public function getCreationBotUsername() |
||
738 | { |
||
739 | return $this->creationBotUsername; |
||
740 | } |
||
741 | |||
742 | /** |
||
743 | * @param string $creationBotPassword |
||
744 | * |
||
745 | * @return SiteConfiguration |
||
746 | */ |
||
747 | public function setCreationBotPassword($creationBotPassword) |
||
748 | { |
||
749 | $this->creationBotPassword = $creationBotPassword; |
||
750 | |||
751 | return $this; |
||
752 | } |
||
753 | |||
754 | /** |
||
755 | * @return string |
||
756 | */ |
||
757 | public function getCreationBotPassword() |
||
758 | { |
||
759 | return $this->creationBotPassword; |
||
760 | } |
||
761 | |||
762 | /** |
||
763 | * @param string|null $curlCookieJar |
||
764 | * |
||
765 | * @return SiteConfiguration |
||
766 | */ |
||
767 | public function setCurlCookieJar($curlCookieJar) |
||
768 | { |
||
769 | $this->curlCookieJar = $curlCookieJar; |
||
770 | |||
771 | return $this; |
||
772 | } |
||
773 | |||
774 | /** |
||
775 | * @return string|null |
||
776 | */ |
||
777 | public function getCurlCookieJar() |
||
778 | { |
||
779 | return $this->curlCookieJar; |
||
780 | } |
||
781 | |||
782 | public function getYubicoApiId() |
||
783 | { |
||
784 | return $this->yubicoApiId; |
||
785 | } |
||
786 | |||
787 | public function setYubicoApiId($id) |
||
788 | { |
||
789 | $this->yubicoApiId = $id; |
||
790 | |||
791 | return $this; |
||
792 | } |
||
793 | |||
794 | public function getYubicoApiKey() |
||
795 | { |
||
796 | return $this->yubicoApiKey; |
||
797 | } |
||
798 | |||
799 | public function setYubicoApiKey($key) |
||
800 | { |
||
801 | $this->yubicoApiKey = $key; |
||
802 | |||
803 | return $this; |
||
804 | } |
||
805 | |||
806 | /** |
||
807 | * @return string |
||
808 | */ |
||
809 | public function getTotpEncryptionKey() |
||
810 | { |
||
811 | return $this->totpEncryptionKey; |
||
812 | } |
||
813 | |||
814 | /** |
||
815 | * @param string $totpEncryptionKey |
||
816 | * |
||
817 | * @return SiteConfiguration |
||
818 | */ |
||
819 | public function setTotpEncryptionKey($totpEncryptionKey) |
||
820 | { |
||
821 | $this->totpEncryptionKey = $totpEncryptionKey; |
||
822 | |||
823 | return $this; |
||
824 | } |
||
825 | |||
826 | /** |
||
827 | * @return string |
||
828 | */ |
||
829 | public function getIdentificationNoticeboardPage() |
||
830 | { |
||
831 | return $this->identificationNoticeboardPage; |
||
832 | } |
||
833 | |||
834 | /** |
||
835 | * @param string $identificationNoticeboardPage |
||
836 | * |
||
837 | * @return SiteConfiguration |
||
838 | */ |
||
839 | public function setIdentificationNoticeboardPage($identificationNoticeboardPage) |
||
840 | { |
||
841 | $this->identificationNoticeboardPage = $identificationNoticeboardPage; |
||
842 | |||
843 | return $this; |
||
844 | } |
||
845 | |||
846 | public function setIdentificationNoticeboardWebserviceEndpoint(string $identificationNoticeboardWebserviceEndpoint |
||
847 | ): SiteConfiguration { |
||
848 | $this->identificationNoticeboardWebserviceEndpoint = $identificationNoticeboardWebserviceEndpoint; |
||
849 | |||
850 | return $this; |
||
851 | } |
||
852 | |||
853 | public function getIdentificationNoticeboardWebserviceEndpoint(): string |
||
854 | { |
||
855 | return $this->identificationNoticeboardWebserviceEndpoint; |
||
856 | } |
||
857 | |||
858 | public function isRegistrationAllowed(): bool |
||
859 | { |
||
860 | return $this->registrationAllowed; |
||
861 | } |
||
862 | |||
863 | public function setRegistrationAllowed(bool $registrationAllowed): SiteConfiguration |
||
864 | { |
||
865 | $this->registrationAllowed = $registrationAllowed; |
||
866 | |||
867 | return $this; |
||
868 | } |
||
869 | |||
870 | /** |
||
871 | * @return string|null |
||
872 | */ |
||
873 | public function getCspReportUri() |
||
874 | { |
||
875 | return $this->cspReportUri; |
||
876 | } |
||
877 | |||
878 | /** |
||
879 | * @param string|null $cspReportUri |
||
880 | * |
||
881 | * @return SiteConfiguration |
||
882 | */ |
||
883 | public function setCspReportUri($cspReportUri) |
||
884 | { |
||
885 | $this->cspReportUri = $cspReportUri; |
||
886 | |||
887 | return $this; |
||
888 | } |
||
889 | |||
890 | /** |
||
891 | * @return int |
||
892 | */ |
||
893 | public function getResourceCacheEpoch(): int |
||
894 | { |
||
895 | return $this->resourceCacheEpoch; |
||
896 | } |
||
897 | |||
898 | /** |
||
899 | * @param int $resourceCacheEpoch |
||
900 | * |
||
901 | * @return SiteConfiguration |
||
902 | */ |
||
903 | public function setResourceCacheEpoch(int $resourceCacheEpoch): SiteConfiguration |
||
904 | { |
||
905 | $this->resourceCacheEpoch = $resourceCacheEpoch; |
||
906 | |||
907 | return $this; |
||
908 | } |
||
909 | |||
910 | /** |
||
911 | * @return array |
||
912 | */ |
||
913 | public function getCommonEmailDomains(): array |
||
914 | { |
||
915 | return $this->commonEmailDomains; |
||
916 | } |
||
917 | |||
918 | /** |
||
919 | * @param array $commonEmailDomains |
||
920 | * |
||
921 | * @return SiteConfiguration |
||
922 | */ |
||
923 | public function setCommonEmailDomains(array $commonEmailDomains): SiteConfiguration |
||
924 | { |
||
925 | $this->commonEmailDomains = $commonEmailDomains; |
||
926 | |||
927 | return $this; |
||
928 | } |
||
929 | |||
930 | /** |
||
931 | * @param int[] $banMaxIpBlockRange |
||
932 | * |
||
933 | * @return SiteConfiguration |
||
934 | */ |
||
935 | public function setBanMaxIpBlockRange(array $banMaxIpBlockRange): SiteConfiguration |
||
936 | { |
||
937 | $this->banMaxIpBlockRange = $banMaxIpBlockRange; |
||
938 | |||
939 | return $this; |
||
940 | } |
||
941 | |||
942 | /** |
||
943 | * @return int[] |
||
944 | */ |
||
945 | public function getBanMaxIpBlockRange(): array |
||
946 | { |
||
947 | return $this->banMaxIpBlockRange; |
||
948 | } |
||
949 | |||
950 | /** |
||
951 | * @param int[] $banMaxIpRange |
||
952 | * |
||
953 | * @return SiteConfiguration |
||
954 | */ |
||
955 | public function setBanMaxIpRange(array $banMaxIpRange): SiteConfiguration |
||
956 | { |
||
957 | $this->banMaxIpRange = $banMaxIpRange; |
||
958 | |||
959 | return $this; |
||
960 | } |
||
961 | |||
962 | /** |
||
963 | * @return int[] |
||
964 | */ |
||
965 | public function getBanMaxIpRange(): array |
||
966 | { |
||
967 | return $this->banMaxIpRange; |
||
968 | } |
||
969 | |||
970 | /** |
||
971 | * @param array $oauthLegacyConsumerTokens |
||
972 | * |
||
973 | * @return SiteConfiguration |
||
974 | */ |
||
975 | public function setOauthLegacyConsumerTokens(array $oauthLegacyConsumerTokens): SiteConfiguration |
||
976 | { |
||
977 | $this->oauthLegacyConsumerTokens = $oauthLegacyConsumerTokens; |
||
978 | |||
979 | return $this; |
||
980 | } |
||
981 | |||
982 | /** |
||
983 | * @return array |
||
984 | */ |
||
985 | public function getOauthLegacyConsumerTokens(): array |
||
988 | } |
||
989 | |||
990 | /** |
||
991 | * @return int |
||
992 | */ |
||
993 | public function getJobQueueBatchSize(): int |
||
994 | { |
||
995 | return $this->jobQueueBatchSize; |
||
996 | } |
||
997 | |||
998 | /** |
||
999 | * @param int $jobQueueBatchSize |
||
1000 | * |
||
1001 | * @return SiteConfiguration |
||
1002 | */ |
||
1003 | public function setJobQueueBatchSize(int $jobQueueBatchSize): SiteConfiguration |
||
1004 | { |
||
1005 | $this->jobQueueBatchSize = $jobQueueBatchSize; |
||
1006 | |||
1007 | return $this; |
||
1008 | } |
||
1009 | |||
1010 | /** |
||
1011 | * @return array |
||
1012 | */ |
||
1013 | public function getAmqpConfiguration(): array |
||
1014 | { |
||
1015 | return $this->amqpConfiguration; |
||
1016 | } |
||
1017 | |||
1018 | /** |
||
1019 | * @param array $amqpConfiguration |
||
1020 | * |
||
1021 | * @return SiteConfiguration |
||
1022 | */ |
||
1023 | public function setAmqpConfiguration(array $amqpConfiguration): SiteConfiguration |
||
1024 | { |
||
1025 | $this->amqpConfiguration = $amqpConfiguration; |
||
1026 | |||
1027 | return $this; |
||
1028 | } |
||
1029 | |||
1030 | /** |
||
1031 | * @return string |
||
1032 | */ |
||
1033 | public function getEmailSender(): string |
||
1036 | } |
||
1037 | |||
1038 | /** |
||
1039 | * @param string $emailSender |
||
1040 | * |
||
1041 | * @return SiteConfiguration |
||
1042 | */ |
||
1043 | public function setEmailSender(string $emailSender): SiteConfiguration |
||
1044 | { |
||
1045 | $this->emailSender = $emailSender; |
||
1046 | |||
1047 | return $this; |
||
1048 | } |
||
1049 | |||
1050 | /** |
||
1051 | * @param array $acceptClientHints |
||
1052 | * |
||
1053 | * @return SiteConfiguration |
||
1054 | */ |
||
1055 | public function setAcceptClientHints(array $acceptClientHints): SiteConfiguration |
||
1056 | { |
||
1057 | $this->acceptClientHints = $acceptClientHints; |
||
1058 | |||
1059 | return $this; |
||
1060 | } |
||
1061 | |||
1062 | /** |
||
1063 | * @return array |
||
1064 | */ |
||
1065 | public function getAcceptClientHints(): array |
||
1066 | { |
||
1067 | return $this->acceptClientHints; |
||
1068 | } |
||
1069 | |||
1070 | public function setCookiePath(string $cookiePath): SiteConfiguration |
||
1071 | { |
||
1072 | $this->cookiePath = $cookiePath; |
||
1073 | |||
1074 | return $this; |
||
1075 | } |
||
1076 | |||
1077 | public function getCookiePath(): string |
||
1078 | { |
||
1079 | return $this->cookiePath; |
||
1080 | } |
||
1081 | |||
1082 | public function setCookieSessionName(string $cookieSessionName): SiteConfiguration |
||
1083 | { |
||
1084 | $this->cookieSessionName = $cookieSessionName; |
||
1085 | |||
1086 | return $this; |
||
1087 | } |
||
1088 | |||
1089 | public function getCookieSessionName(): string |
||
1090 | { |
||
1091 | return $this->cookieSessionName; |
||
1092 | } |
||
1093 | |||
1094 | public function setOffline(array $offline): SiteConfiguration |
||
1095 | { |
||
1096 | $this->offline = $offline; |
||
1097 | |||
1098 | return $this; |
||
1099 | } |
||
1100 | |||
1101 | public function getOffline(): array |
||
1104 | } |
||
1105 | |||
1106 | public function setDatabaseConfig(array $databaseConfig): SiteConfiguration |
||
1107 | { |
||
1108 | $this->databaseConfig = $databaseConfig; |
||
1109 | |||
1110 | return $this; |
||
1111 | } |
||
1112 | |||
1113 | public function getDatabaseConfig(): array |
||
1114 | { |
||
1115 | return $this->databaseConfig; |
||
1116 | } |
||
1117 | } |
||
1118 |