@@ -12,44 +12,44 @@ |
||
| 12 | 12 | |
| 13 | 13 | class PageTeam extends InternalPageBase |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * Main function for this page, when no specific actions are called. |
|
| 17 | - * @return void |
|
| 18 | - */ |
|
| 19 | - protected function main() |
|
| 20 | - { |
|
| 21 | - $path = $this->getSiteConfiguration()->getFilePath() . '/team.json'; |
|
| 22 | - $json = file_get_contents($path); |
|
| 23 | - |
|
| 24 | - $teamData = json_decode($json, true); |
|
| 25 | - |
|
| 26 | - $active = array(); |
|
| 27 | - $inactive = array(); |
|
| 28 | - |
|
| 29 | - foreach ($teamData as $name => $item) { |
|
| 30 | - if (count($item['Role']) == 0) { |
|
| 31 | - $inactive[$name] = $item; |
|
| 32 | - } |
|
| 33 | - else { |
|
| 34 | - $active[$name] = $item; |
|
| 35 | - } |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - $this->assign('developer', $this->assocArrayShuffle($active)); |
|
| 39 | - $this->assign('inactiveDeveloper', $this->assocArrayShuffle($inactive)); |
|
| 40 | - $this->setTemplate('team/team.tpl'); |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - private function assocArrayShuffle($array) |
|
| 44 | - { |
|
| 45 | - $arrayKeys = array_keys($array); |
|
| 46 | - shuffle($arrayKeys); |
|
| 47 | - |
|
| 48 | - $sorted = []; |
|
| 49 | - foreach ($arrayKeys as $k) { |
|
| 50 | - $sorted[$k] = $array[$k]; |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - return $sorted; |
|
| 54 | - } |
|
| 15 | + /** |
|
| 16 | + * Main function for this page, when no specific actions are called. |
|
| 17 | + * @return void |
|
| 18 | + */ |
|
| 19 | + protected function main() |
|
| 20 | + { |
|
| 21 | + $path = $this->getSiteConfiguration()->getFilePath() . '/team.json'; |
|
| 22 | + $json = file_get_contents($path); |
|
| 23 | + |
|
| 24 | + $teamData = json_decode($json, true); |
|
| 25 | + |
|
| 26 | + $active = array(); |
|
| 27 | + $inactive = array(); |
|
| 28 | + |
|
| 29 | + foreach ($teamData as $name => $item) { |
|
| 30 | + if (count($item['Role']) == 0) { |
|
| 31 | + $inactive[$name] = $item; |
|
| 32 | + } |
|
| 33 | + else { |
|
| 34 | + $active[$name] = $item; |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + $this->assign('developer', $this->assocArrayShuffle($active)); |
|
| 39 | + $this->assign('inactiveDeveloper', $this->assocArrayShuffle($inactive)); |
|
| 40 | + $this->setTemplate('team/team.tpl'); |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + private function assocArrayShuffle($array) |
|
| 44 | + { |
|
| 45 | + $arrayKeys = array_keys($array); |
|
| 46 | + shuffle($arrayKeys); |
|
| 47 | + |
|
| 48 | + $sorted = []; |
|
| 49 | + foreach ($arrayKeys as $k) { |
|
| 50 | + $sorted[$k] = $array[$k]; |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + return $sorted; |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class Offline |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Determines if the tool is offline |
|
| 22 | - * @return bool |
|
| 23 | - */ |
|
| 24 | - public static function isOffline() |
|
| 25 | - { |
|
| 26 | - global $dontUseDb; |
|
| 20 | + /** |
|
| 21 | + * Determines if the tool is offline |
|
| 22 | + * @return bool |
|
| 23 | + */ |
|
| 24 | + public static function isOffline() |
|
| 25 | + { |
|
| 26 | + global $dontUseDb; |
|
| 27 | 27 | |
| 28 | - return (bool)$dontUseDb; |
|
| 29 | - } |
|
| 28 | + return (bool)$dontUseDb; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Gets the offline message |
@@ -37,39 +37,39 @@ discard block |
||
| 37 | 37 | * @return string |
| 38 | 38 | * @throws SmartyException |
| 39 | 39 | */ |
| 40 | - public static function getOfflineMessage($external, $message = null) |
|
| 41 | - { |
|
| 42 | - global $dontUseDbCulprit, $dontUseDbReason, $baseurl; |
|
| 40 | + public static function getOfflineMessage($external, $message = null) |
|
| 41 | + { |
|
| 42 | + global $dontUseDbCulprit, $dontUseDbReason, $baseurl; |
|
| 43 | 43 | |
| 44 | - $smarty = new Smarty(); |
|
| 45 | - $smarty->assign("baseurl", $baseurl); |
|
| 46 | - $smarty->assign("resourceCacheEpoch", 0); |
|
| 47 | - $smarty->assign("alerts", []); |
|
| 48 | - $smarty->assign("toolversion", Environment::getToolVersion()); |
|
| 44 | + $smarty = new Smarty(); |
|
| 45 | + $smarty->assign("baseurl", $baseurl); |
|
| 46 | + $smarty->assign("resourceCacheEpoch", 0); |
|
| 47 | + $smarty->assign("alerts", []); |
|
| 48 | + $smarty->assign("toolversion", Environment::getToolVersion()); |
|
| 49 | 49 | |
| 50 | - if (!headers_sent()) { |
|
| 51 | - header("HTTP/1.1 503 Service Unavailable"); |
|
| 52 | - } |
|
| 50 | + if (!headers_sent()) { |
|
| 51 | + header("HTTP/1.1 503 Service Unavailable"); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - if ($external) { |
|
| 55 | - return $smarty->fetch("offline/external.tpl"); |
|
| 56 | - } |
|
| 57 | - else { |
|
| 58 | - $hideCulprit = true; |
|
| 54 | + if ($external) { |
|
| 55 | + return $smarty->fetch("offline/external.tpl"); |
|
| 56 | + } |
|
| 57 | + else { |
|
| 58 | + $hideCulprit = true; |
|
| 59 | 59 | |
| 60 | - // Use the provided message if possible |
|
| 61 | - if ($message === null) { |
|
| 62 | - $hideCulprit = false; |
|
| 63 | - $message = $dontUseDbReason; |
|
| 64 | - } |
|
| 60 | + // Use the provided message if possible |
|
| 61 | + if ($message === null) { |
|
| 62 | + $hideCulprit = false; |
|
| 63 | + $message = $dontUseDbReason; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - $smarty->assign("hideCulprit", $hideCulprit); |
|
| 67 | - $smarty->assign("dontUseDbCulprit", $dontUseDbCulprit); |
|
| 68 | - $smarty->assign("dontUseDbReason", $message); |
|
| 69 | - $smarty->assign("alerts", array()); |
|
| 70 | - $smarty->assign('currentUser', User::getCommunity()); |
|
| 66 | + $smarty->assign("hideCulprit", $hideCulprit); |
|
| 67 | + $smarty->assign("dontUseDbCulprit", $dontUseDbCulprit); |
|
| 68 | + $smarty->assign("dontUseDbReason", $message); |
|
| 69 | + $smarty->assign("alerts", array()); |
|
| 70 | + $smarty->assign('currentUser', User::getCommunity()); |
|
| 71 | 71 | |
| 72 | - return $smarty->fetch("offline/internal.tpl"); |
|
| 73 | - } |
|
| 74 | - } |
|
| 72 | + return $smarty->fetch("offline/internal.tpl"); |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | 75 | } |
@@ -15,96 +15,96 @@ |
||
| 15 | 15 | |
| 16 | 16 | trait TemplateOutput |
| 17 | 17 | { |
| 18 | - /** @var Smarty */ |
|
| 19 | - private $smarty; |
|
| 20 | - /** @var string Extra JavaScript to include at the end of the page's execution */ |
|
| 21 | - private $tailScript; |
|
| 22 | - /** @var string */ |
|
| 23 | - private $tailScriptNonce; |
|
| 18 | + /** @var Smarty */ |
|
| 19 | + private $smarty; |
|
| 20 | + /** @var string Extra JavaScript to include at the end of the page's execution */ |
|
| 21 | + private $tailScript; |
|
| 22 | + /** @var string */ |
|
| 23 | + private $tailScriptNonce; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * @return SiteConfiguration |
|
| 27 | - */ |
|
| 28 | - protected abstract function getSiteConfiguration(); |
|
| 25 | + /** |
|
| 26 | + * @return SiteConfiguration |
|
| 27 | + */ |
|
| 28 | + protected abstract function getSiteConfiguration(); |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Include extra JavaScript at the end of the page's execution |
|
| 32 | - * |
|
| 33 | - * @param $nonce string CSP Nonce generated by ContentSecurityPolicyManager::getNonce() |
|
| 34 | - * @param $script string JavaScript to include at the end of the page |
|
| 35 | - */ |
|
| 36 | - final protected function setTailScript($nonce, $script) |
|
| 37 | - { |
|
| 38 | - $this->tailScriptNonce = $nonce; |
|
| 39 | - $this->tailScript = $script; |
|
| 40 | - } |
|
| 30 | + /** |
|
| 31 | + * Include extra JavaScript at the end of the page's execution |
|
| 32 | + * |
|
| 33 | + * @param $nonce string CSP Nonce generated by ContentSecurityPolicyManager::getNonce() |
|
| 34 | + * @param $script string JavaScript to include at the end of the page |
|
| 35 | + */ |
|
| 36 | + final protected function setTailScript($nonce, $script) |
|
| 37 | + { |
|
| 38 | + $this->tailScriptNonce = $nonce; |
|
| 39 | + $this->tailScript = $script; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Assigns a Smarty variable |
|
| 44 | - * |
|
| 45 | - * @param array|string $name the template variable name(s) |
|
| 46 | - * @param mixed $value the value to assign |
|
| 47 | - */ |
|
| 48 | - final protected function assign($name, $value) |
|
| 49 | - { |
|
| 50 | - $this->smarty->assign($name, $value); |
|
| 51 | - } |
|
| 42 | + /** |
|
| 43 | + * Assigns a Smarty variable |
|
| 44 | + * |
|
| 45 | + * @param array|string $name the template variable name(s) |
|
| 46 | + * @param mixed $value the value to assign |
|
| 47 | + */ |
|
| 48 | + final protected function assign($name, $value) |
|
| 49 | + { |
|
| 50 | + $this->smarty->assign($name, $value); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Sets up the variables used by the main Smarty base template. |
|
| 55 | - * |
|
| 56 | - * This list is getting kinda long. |
|
| 57 | - */ |
|
| 58 | - final protected function setUpSmarty() |
|
| 59 | - { |
|
| 60 | - $this->smarty = new Smarty(); |
|
| 61 | - $this->smarty->addPluginsDir($this->getSiteConfiguration()->getFilePath() . '/smarty-plugins'); |
|
| 53 | + /** |
|
| 54 | + * Sets up the variables used by the main Smarty base template. |
|
| 55 | + * |
|
| 56 | + * This list is getting kinda long. |
|
| 57 | + */ |
|
| 58 | + final protected function setUpSmarty() |
|
| 59 | + { |
|
| 60 | + $this->smarty = new Smarty(); |
|
| 61 | + $this->smarty->addPluginsDir($this->getSiteConfiguration()->getFilePath() . '/smarty-plugins'); |
|
| 62 | 62 | |
| 63 | - $this->assign('currentUser', User::getCommunity()); |
|
| 64 | - $this->assign('loggedIn', false); |
|
| 65 | - $this->assign('baseurl', $this->getSiteConfiguration()->getBaseUrl()); |
|
| 66 | - $this->assign('mediawikiScriptPath', $this->getSiteConfiguration()->getMediawikiScriptPath()); |
|
| 67 | - $this->assign('resourceCacheEpoch', $this->getSiteConfiguration()->getResourceCacheEpoch()); |
|
| 63 | + $this->assign('currentUser', User::getCommunity()); |
|
| 64 | + $this->assign('loggedIn', false); |
|
| 65 | + $this->assign('baseurl', $this->getSiteConfiguration()->getBaseUrl()); |
|
| 66 | + $this->assign('mediawikiScriptPath', $this->getSiteConfiguration()->getMediawikiScriptPath()); |
|
| 67 | + $this->assign('resourceCacheEpoch', $this->getSiteConfiguration()->getResourceCacheEpoch()); |
|
| 68 | 68 | |
| 69 | - $this->assign('siteNoticeText', ''); |
|
| 70 | - $this->assign('siteNoticeVersion', 0); |
|
| 71 | - $this->assign('siteNoticeState', 'd-none'); |
|
| 72 | - $this->assign('toolversion', Environment::getToolVersion()); |
|
| 69 | + $this->assign('siteNoticeText', ''); |
|
| 70 | + $this->assign('siteNoticeVersion', 0); |
|
| 71 | + $this->assign('siteNoticeState', 'd-none'); |
|
| 72 | + $this->assign('toolversion', Environment::getToolVersion()); |
|
| 73 | 73 | |
| 74 | - // default these |
|
| 75 | - $this->assign('onlineusers', array()); |
|
| 76 | - $this->assign('typeAheadBlock', ''); |
|
| 77 | - $this->assign('extraJs', array()); |
|
| 74 | + // default these |
|
| 75 | + $this->assign('onlineusers', array()); |
|
| 76 | + $this->assign('typeAheadBlock', ''); |
|
| 77 | + $this->assign('extraJs', array()); |
|
| 78 | 78 | |
| 79 | - // nav menu access control |
|
| 80 | - $this->assign('nav__canRequests', false); |
|
| 81 | - $this->assign('nav__canLogs', false); |
|
| 82 | - $this->assign('nav__canUsers', false); |
|
| 83 | - $this->assign('nav__canSearch', false); |
|
| 84 | - $this->assign('nav__canStats', false); |
|
| 85 | - $this->assign('nav__canBan', false); |
|
| 86 | - $this->assign('nav__canEmailMgmt', false); |
|
| 87 | - $this->assign('nav__canWelcomeMgmt', false); |
|
| 88 | - $this->assign('nav__canSiteNoticeMgmt', false); |
|
| 89 | - $this->assign('nav__canUserMgmt', false); |
|
| 90 | - $this->assign('nav__canViewRequest', false); |
|
| 91 | - $this->assign('nav__canJobQueue', false); |
|
| 79 | + // nav menu access control |
|
| 80 | + $this->assign('nav__canRequests', false); |
|
| 81 | + $this->assign('nav__canLogs', false); |
|
| 82 | + $this->assign('nav__canUsers', false); |
|
| 83 | + $this->assign('nav__canSearch', false); |
|
| 84 | + $this->assign('nav__canStats', false); |
|
| 85 | + $this->assign('nav__canBan', false); |
|
| 86 | + $this->assign('nav__canEmailMgmt', false); |
|
| 87 | + $this->assign('nav__canWelcomeMgmt', false); |
|
| 88 | + $this->assign('nav__canSiteNoticeMgmt', false); |
|
| 89 | + $this->assign('nav__canUserMgmt', false); |
|
| 90 | + $this->assign('nav__canViewRequest', false); |
|
| 91 | + $this->assign('nav__canJobQueue', false); |
|
| 92 | 92 | |
| 93 | - $this->assign('page', $this); |
|
| 94 | - } |
|
| 93 | + $this->assign('page', $this); |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Fetches a rendered Smarty template |
|
| 98 | - * |
|
| 99 | - * @param $template string Template file path, relative to /templates/ |
|
| 100 | - * |
|
| 101 | - * @return string Templated HTML |
|
| 102 | - */ |
|
| 103 | - final protected function fetchTemplate($template) |
|
| 104 | - { |
|
| 105 | - $this->assign('tailScript', $this->tailScript); |
|
| 106 | - $this->assign('tailScriptNonce', $this->tailScriptNonce); |
|
| 96 | + /** |
|
| 97 | + * Fetches a rendered Smarty template |
|
| 98 | + * |
|
| 99 | + * @param $template string Template file path, relative to /templates/ |
|
| 100 | + * |
|
| 101 | + * @return string Templated HTML |
|
| 102 | + */ |
|
| 103 | + final protected function fetchTemplate($template) |
|
| 104 | + { |
|
| 105 | + $this->assign('tailScript', $this->tailScript); |
|
| 106 | + $this->assign('tailScriptNonce', $this->tailScriptNonce); |
|
| 107 | 107 | |
| 108 | - return $this->smarty->fetch($template); |
|
| 109 | - } |
|
| 108 | + return $this->smarty->fetch($template); |
|
| 109 | + } |
|
| 110 | 110 | } |
@@ -189,27 +189,27 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | // request states |
| 191 | 191 | $availableRequestStates = array( |
| 192 | - 'Open' => array( |
|
| 193 | - 'defertolog' => 'users', // don't change or you'll break old logs |
|
| 194 | - 'deferto' => 'users', |
|
| 195 | - 'header' => 'Open requests', |
|
| 196 | - 'api' => "open", |
|
| 197 | - 'queuehelp' => null |
|
| 198 | - ), |
|
| 199 | - 'Flagged users' => array( |
|
| 200 | - 'defertolog' => 'flagged users', // don't change or you'll break old logs |
|
| 201 | - 'deferto' => 'flagged users', |
|
| 202 | - 'header' => 'Flagged user needed', |
|
| 203 | - 'api' => "admin", |
|
| 204 | - 'queuehelp' => 'This queue lists the requests which require a user with the <code>accountcreator</code> flag to create.<br />If creation is determined to be the correct course of action, requests here will require the overriding the AntiSpoof checks or the title blacklist in order to create. It is recommended to try to create the account <em>without</em> checking the flags to validate the results of the AntiSpoof and/or title blacklist hits.' |
|
| 205 | - ), |
|
| 206 | - 'Checkuser' => array( |
|
| 207 | - 'defertolog' => 'checkusers', // don't change or you'll break old logs |
|
| 208 | - 'deferto' => 'checkusers', |
|
| 209 | - 'header' => 'Checkuser needed', |
|
| 210 | - 'api' => "checkuser", |
|
| 211 | - 'queuehelp' => null |
|
| 212 | - ), |
|
| 192 | + 'Open' => array( |
|
| 193 | + 'defertolog' => 'users', // don't change or you'll break old logs |
|
| 194 | + 'deferto' => 'users', |
|
| 195 | + 'header' => 'Open requests', |
|
| 196 | + 'api' => "open", |
|
| 197 | + 'queuehelp' => null |
|
| 198 | + ), |
|
| 199 | + 'Flagged users' => array( |
|
| 200 | + 'defertolog' => 'flagged users', // don't change or you'll break old logs |
|
| 201 | + 'deferto' => 'flagged users', |
|
| 202 | + 'header' => 'Flagged user needed', |
|
| 203 | + 'api' => "admin", |
|
| 204 | + 'queuehelp' => 'This queue lists the requests which require a user with the <code>accountcreator</code> flag to create.<br />If creation is determined to be the correct course of action, requests here will require the overriding the AntiSpoof checks or the title blacklist in order to create. It is recommended to try to create the account <em>without</em> checking the flags to validate the results of the AntiSpoof and/or title blacklist hits.' |
|
| 205 | + ), |
|
| 206 | + 'Checkuser' => array( |
|
| 207 | + 'defertolog' => 'checkusers', // don't change or you'll break old logs |
|
| 208 | + 'deferto' => 'checkusers', |
|
| 209 | + 'header' => 'Checkuser needed', |
|
| 210 | + 'api' => "checkuser", |
|
| 211 | + 'queuehelp' => null |
|
| 212 | + ), |
|
| 213 | 213 | ); |
| 214 | 214 | |
| 215 | 215 | $defaultRequestStateKey = 'Open'; |
@@ -262,24 +262,24 @@ discard block |
||
| 262 | 262 | require_once('config.local.inc.php'); |
| 263 | 263 | |
| 264 | 264 | $cDatabaseConfig = array( |
| 265 | - "acc" => array( |
|
| 266 | - "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database, |
|
| 267 | - "username" => $toolserver_username, |
|
| 268 | - "password" => $toolserver_password, |
|
| 265 | + "acc" => array( |
|
| 266 | + "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database, |
|
| 267 | + "username" => $toolserver_username, |
|
| 268 | + "password" => $toolserver_password, |
|
| 269 | 269 | "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
| 270 | - ), |
|
| 271 | - "wikipedia" => array( |
|
| 272 | - "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |
|
| 273 | - "username" => $toolserver_username, |
|
| 274 | - "password" => $toolserver_password, |
|
| 275 | - "options" => array(), |
|
| 276 | - ), |
|
| 277 | - "notifications" => array( |
|
| 278 | - "dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database, |
|
| 279 | - "username" => $notifications_username, |
|
| 280 | - "password" => $notifications_password, |
|
| 281 | - "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
|
| 282 | - ), |
|
| 270 | + ), |
|
| 271 | + "wikipedia" => array( |
|
| 272 | + "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |
|
| 273 | + "username" => $toolserver_username, |
|
| 274 | + "password" => $toolserver_password, |
|
| 275 | + "options" => array(), |
|
| 276 | + ), |
|
| 277 | + "notifications" => array( |
|
| 278 | + "dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database, |
|
| 279 | + "username" => $notifications_username, |
|
| 280 | + "password" => $notifications_password, |
|
| 281 | + "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
|
| 282 | + ), |
|
| 283 | 283 | ); |
| 284 | 284 | |
| 285 | 285 | // //Keep the included files from being executed. |
@@ -291,18 +291,18 @@ discard block |
||
| 291 | 291 | ini_set('user_agent', $toolUserAgent); |
| 292 | 292 | |
| 293 | 293 | foreach (array( |
| 294 | - "mbstring", // unicode and stuff |
|
| 295 | - "pdo", |
|
| 296 | - "pdo_mysql", // new database module |
|
| 297 | - "session", |
|
| 298 | - "date", |
|
| 299 | - "pcre", // core stuff |
|
| 300 | - "curl", // mediawiki api access etc |
|
| 301 | - "openssl", // token generation |
|
| 294 | + "mbstring", // unicode and stuff |
|
| 295 | + "pdo", |
|
| 296 | + "pdo_mysql", // new database module |
|
| 297 | + "session", |
|
| 298 | + "date", |
|
| 299 | + "pcre", // core stuff |
|
| 300 | + "curl", // mediawiki api access etc |
|
| 301 | + "openssl", // token generation |
|
| 302 | 302 | ) as $x) { |
| 303 | - if (!extension_loaded($x)) { |
|
| 304 | - die("extension $x is required."); |
|
| 305 | - } |
|
| 303 | + if (!extension_loaded($x)) { |
|
| 304 | + die("extension $x is required."); |
|
| 305 | + } |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | // Set up the AutoLoader |
@@ -326,42 +326,42 @@ discard block |
||
| 326 | 326 | $siteConfiguration = new \Waca\SiteConfiguration(); |
| 327 | 327 | |
| 328 | 328 | $siteConfiguration->setBaseUrl($baseurl) |
| 329 | - ->setFilePath(__DIR__) |
|
| 330 | - ->setDebuggingTraceEnabled($enableErrorTrace) |
|
| 331 | - ->setForceIdentification($forceIdentification) |
|
| 332 | - ->setIdentificationCacheExpiry($identificationCacheExpiry) |
|
| 333 | - ->setMediawikiScriptPath($mediawikiScriptPath) |
|
| 334 | - ->setMediawikiWebServiceEndpoint($mediawikiWebServiceEndpoint) |
|
| 335 | - ->setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint) |
|
| 336 | - ->setEnforceOAuth($enforceOAuth) |
|
| 337 | - ->setEmailConfirmationEnabled($enableEmailConfirm == 1) |
|
| 338 | - ->setEmailConfirmationExpiryDays($emailConfirmationExpiryDays) |
|
| 339 | - ->setMiserModeLimit($requestLimitShowOnly) |
|
| 340 | - ->setRequestStates($availableRequestStates) |
|
| 341 | - ->setSquidList($squidIpList) |
|
| 342 | - ->setDefaultCreatedTemplateId($createdid) |
|
| 343 | - ->setDefaultRequestStateKey($defaultRequestStateKey) |
|
| 344 | - ->setUseStrictTransportSecurity($strictTransportSecurityExpiry) |
|
| 345 | - ->setUserAgent($toolUserAgent) |
|
| 346 | - ->setCurlDisableVerifyPeer($curlDisableSSLVerifyPeer) |
|
| 347 | - ->setUseOAuthSignup($useOauthSignup) |
|
| 348 | - ->setOAuthBaseUrl($oauthBaseUrl) |
|
| 349 | - ->setOAuthConsumerToken($oauthConsumerToken) |
|
| 350 | - ->setOAuthConsumerSecret($oauthSecretToken) |
|
| 351 | - ->setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer) |
|
| 352 | - ->setDataClearInterval($dataclear_interval) |
|
| 353 | - ->setXffTrustedHostsFile($xff_trusted_hosts_file) |
|
| 354 | - ->setIrcNotificationsEnabled($ircBotNotificationsEnabled == 1) |
|
| 355 | - ->setIrcNotificationType($ircBotNotificationType) |
|
| 356 | - ->setIrcNotificationsInstance($whichami) |
|
| 357 | - ->setTitleBlacklistEnabled($enableTitleblacklist == 1) |
|
| 358 | - ->setTorExitPaths(array_merge(gethostbynamel('en.wikipedia.org'), gethostbynamel('accounts.wmflabs.org'))) |
|
| 359 | - ->setCreationBotUsername($creationBotUsername) |
|
| 360 | - ->setCreationBotPassword($creationBotPassword) |
|
| 361 | - ->setCurlCookieJar($curlCookieJar) |
|
| 362 | - ->setYubicoApiId($yubicoApiId) |
|
| 363 | - ->setYubicoApiKey($yubicoApiKey) |
|
| 364 | - ->setTotpEncryptionKey($totpEncryptionKey) |
|
| 365 | - ->setRegistrationAllowed($allowRegistration) |
|
| 366 | - ->setCspReportUri($cspReportUri) |
|
| 367 | - ->setResourceCacheEpoch($resourceCacheEpoch); |
|
| 329 | + ->setFilePath(__DIR__) |
|
| 330 | + ->setDebuggingTraceEnabled($enableErrorTrace) |
|
| 331 | + ->setForceIdentification($forceIdentification) |
|
| 332 | + ->setIdentificationCacheExpiry($identificationCacheExpiry) |
|
| 333 | + ->setMediawikiScriptPath($mediawikiScriptPath) |
|
| 334 | + ->setMediawikiWebServiceEndpoint($mediawikiWebServiceEndpoint) |
|
| 335 | + ->setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint) |
|
| 336 | + ->setEnforceOAuth($enforceOAuth) |
|
| 337 | + ->setEmailConfirmationEnabled($enableEmailConfirm == 1) |
|
| 338 | + ->setEmailConfirmationExpiryDays($emailConfirmationExpiryDays) |
|
| 339 | + ->setMiserModeLimit($requestLimitShowOnly) |
|
| 340 | + ->setRequestStates($availableRequestStates) |
|
| 341 | + ->setSquidList($squidIpList) |
|
| 342 | + ->setDefaultCreatedTemplateId($createdid) |
|
| 343 | + ->setDefaultRequestStateKey($defaultRequestStateKey) |
|
| 344 | + ->setUseStrictTransportSecurity($strictTransportSecurityExpiry) |
|
| 345 | + ->setUserAgent($toolUserAgent) |
|
| 346 | + ->setCurlDisableVerifyPeer($curlDisableSSLVerifyPeer) |
|
| 347 | + ->setUseOAuthSignup($useOauthSignup) |
|
| 348 | + ->setOAuthBaseUrl($oauthBaseUrl) |
|
| 349 | + ->setOAuthConsumerToken($oauthConsumerToken) |
|
| 350 | + ->setOAuthConsumerSecret($oauthSecretToken) |
|
| 351 | + ->setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer) |
|
| 352 | + ->setDataClearInterval($dataclear_interval) |
|
| 353 | + ->setXffTrustedHostsFile($xff_trusted_hosts_file) |
|
| 354 | + ->setIrcNotificationsEnabled($ircBotNotificationsEnabled == 1) |
|
| 355 | + ->setIrcNotificationType($ircBotNotificationType) |
|
| 356 | + ->setIrcNotificationsInstance($whichami) |
|
| 357 | + ->setTitleBlacklistEnabled($enableTitleblacklist == 1) |
|
| 358 | + ->setTorExitPaths(array_merge(gethostbynamel('en.wikipedia.org'), gethostbynamel('accounts.wmflabs.org'))) |
|
| 359 | + ->setCreationBotUsername($creationBotUsername) |
|
| 360 | + ->setCreationBotPassword($creationBotPassword) |
|
| 361 | + ->setCurlCookieJar($curlCookieJar) |
|
| 362 | + ->setYubicoApiId($yubicoApiId) |
|
| 363 | + ->setYubicoApiKey($yubicoApiKey) |
|
| 364 | + ->setTotpEncryptionKey($totpEncryptionKey) |
|
| 365 | + ->setRegistrationAllowed($allowRegistration) |
|
| 366 | + ->setCspReportUri($cspReportUri) |
|
| 367 | + ->setResourceCacheEpoch($resourceCacheEpoch); |
|