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