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