Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php |
— | — | @@ -0,0 +1,2418 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +# WARNING: This file is publically viewable on the web. Do not put private data here. |
| 5 | + |
| 6 | +# Godforsaken hack to work around problems with the Squid caching changes... |
| 7 | +# |
| 8 | +# To minimize damage on fatal PHP errors, output a default no-cache header |
| 9 | +# It will be overridden in cases where we actually specify caching behavior. |
| 10 | +# |
| 11 | +# More modern PHP versions will send a 500 result code on fatal erorr, |
| 12 | +# at least sometimes, but what we're running will send a 200. |
| 13 | +header( "Cache-control: no-cache" ); |
| 14 | + |
| 15 | + |
| 16 | +# Try to control stuff: |
| 17 | +#define( 'DEBUG_LOG', true ); |
| 18 | + |
| 19 | + |
| 20 | +# useful tokens to search for: |
| 21 | + |
| 22 | +# :SEARCH: - search settings |
| 23 | +# :SLAVES: - database slaves |
| 24 | +# :PROFILING: |
| 25 | + |
| 26 | +# header("HTTP/1.0 500 Internal server error" ); |
| 27 | +# die("Wikipedia and its sister projects are experiencing technical problems. Please try again later. We apologise for the inconvenience, and thank you for your patience while developers are working to resolve the issue as soon as possible."); # temp to reduce load --brion |
| 28 | + |
| 29 | +# ----------------- |
| 30 | + |
| 31 | +if( php_sapi_name() == 'cli' ) { |
| 32 | + # Override for sanity's sake. |
| 33 | + ini_set( 'display_errors', 1 ); |
| 34 | + #error_reporting(E_ALL); |
| 35 | +} |
| 36 | +if( isset( $_SERVER['SERVER_ADDR'] ) ) { |
| 37 | + ini_set( 'error_append_string', ' (' . $_SERVER['SERVER_ADDR'] . ')' ); |
| 38 | +} |
| 39 | + |
| 40 | +# Protection for unusual entry points |
| 41 | +if ( !function_exists( 'wfProfileIn' ) ) { |
| 42 | + require( './includes/ProfilerStub.php' ); |
| 43 | +} |
| 44 | +$fname = 'CommonSettings.php'; |
| 45 | +wfProfileIn( $fname ); |
| 46 | +wfProfileIn( "$fname-init" ); |
| 47 | + |
| 48 | +#---------------------------------------------------------------------- |
| 49 | +# Initialisation |
| 50 | + |
| 51 | +if ( defined( 'TESTWIKI' ) ) { |
| 52 | + $IP = "/home/wikipedia/common/php-1.17"; |
| 53 | +} else { |
| 54 | + $IP = "/usr/local/apache/common/php-1.17"; |
| 55 | +} |
| 56 | +//ini_set( "include_path", "$IP:$IP/includes:$IP/languages:$IP/templates:$IP/lib:$IP/extensions/wikihiero:/usr/local/lib/php:/usr/share/php" ); |
| 57 | +// Modernized BV -- 2009-7-14 |
| 58 | +set_include_path( "$IP:$IP/lib:/usr/local/lib/php:/usr/share/php" ); |
| 59 | + |
| 60 | +if( getenv( 'WIKIBACKUP' ) ) { |
| 61 | + // hack while normal ext is not enabled sitewide |
| 62 | + if( !function_exists( 'utf8_normalize' ) ) { |
| 63 | + dl('php_utfnormal.so'); |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +/* |
| 68 | +$cluster = @file_get_contents( '/etc/cluster' ); |
| 69 | +if ( !$cluster ) { |
| 70 | + # Let's be nice until we're sure things are set up properly |
| 71 | + # die( "Invalid or missing /etc/cluster file on host {$_ENV['HOSTNAME']}\n" ); |
| 72 | + $cluster = 'pmtpa'; |
| 73 | +} |
| 74 | +$cluster = trim( $cluster ); |
| 75 | + */ |
| 76 | +$cluster = 'pmtpa'; |
| 77 | + |
| 78 | +# Load site configuration |
| 79 | +include( "$IP/includes/DefaultSettings.php" ); |
| 80 | + |
| 81 | +# Safari bug with URLs ending in ".gz" and gzip encoding |
| 82 | +# http://bugzilla.wikimedia.org/show_bug.cgi?id=4635 |
| 83 | +$hatesSafari = isset( $_SERVER['PATH_INFO'] ) && |
| 84 | + strtolower( substr( $_SERVER['PATH_INFO'], -3 ) ) == '.gz'; |
| 85 | +if ( $hatesSafari ) { |
| 86 | + $wgDisableOutputCompression = true; |
| 87 | +} |
| 88 | +/* |
| 89 | +if ( !$wgCommandLineMode && !defined( 'MW_NO_OUTPUT_BUFFER' ) && !$hatesSafari ) { |
| 90 | + ob_start("ob_gzhandler"); |
| 91 | +}*/ |
| 92 | + |
| 93 | +ini_set( 'memory_limit', 120 * 1024 * 1024 ); |
| 94 | + |
| 95 | +$DP = $IP; |
| 96 | + |
| 97 | +wfProfileOut( "$fname-init" ); |
| 98 | +wfProfileIn( "$fname-host" ); |
| 99 | + |
| 100 | +# Determine domain and language |
| 101 | +$secure = getenv( 'MW_SECURE_HOST' ); |
| 102 | +if ( (@$_SERVER['SCRIPT_NAME']) == '/w/thumb.php' && (@$_SERVER['SERVER_NAME']) == 'upload.wikimedia.org' ) { |
| 103 | + $pathBits = explode( '/', $_SERVER['PATH_INFO'] ); |
| 104 | + $site = $pathBits[1]; |
| 105 | + $lang = $pathBits[2]; |
| 106 | +} elseif (php_sapi_name() == 'cgi-fcgi') { |
| 107 | + if (!preg_match('/^([^.]+).([^.]+).*$/', $_SERVER['SERVER_NAME'], $m)) |
| 108 | + die("invalid hostname"); |
| 109 | + |
| 110 | + $lang = $m[1]; |
| 111 | + $site = $m[2]; |
| 112 | + |
| 113 | + if (in_array($lang, array("commons", "grants", "sources", "wikimania", "wikimania2006", "foundation", "meta"))) |
| 114 | + $site = "wikipedia"; |
| 115 | +} elseif( $secure ) { |
| 116 | + if (!preg_match('/^([^.]+).([^.]+).*$/', $secure, $m)) |
| 117 | + die("invalid hostname"); |
| 118 | + |
| 119 | + $lang = $m[1]; |
| 120 | + $site = $m[2]; |
| 121 | + |
| 122 | + if (in_array($lang, array("commons", "grants", "sources", "wikimania", "wikimania2006", "foundation", "meta"))) |
| 123 | + $site = "wikipedia"; |
| 124 | +} else { |
| 125 | + if ( !isset( $site ) ) { |
| 126 | + $site = "wikipedia"; |
| 127 | + if ( !isset( $lang ) ) { |
| 128 | + |
| 129 | + $server = $_SERVER['SERVER_NAME']; |
| 130 | + $docRoot = $_SERVER['DOCUMENT_ROOT']; |
| 131 | + if ( preg_match( '/^(?:\/usr\/local\/apache\/|\/home\/wikipedia\/)(?:htdocs|common\/docroot)\/([a-z]+)\.org/', $docRoot, $matches ) ) { |
| 132 | + $site = $matches[1]; |
| 133 | + if ( preg_match( '/^(.*)\.' . preg_quote( $site ) . '\.org$/', $server, $matches ) ) { |
| 134 | + $lang = $matches[1]; |
| 135 | + // For some special subdomains, like pa.us |
| 136 | + $lang = str_replace( '.', '-', $lang ); |
| 137 | + } else { |
| 138 | + die( "Invalid host name, can't determine language" ); |
| 139 | + } |
| 140 | + } elseif ( preg_match( "/^\/usr\/local\/apache\/(?:htdocs|common\/docroot)\/([a-z0-9\-_]*)$/", $docRoot, $matches ) ) { |
| 141 | + $site = "wikipedia"; |
| 142 | + $lang = $matches[1]; |
| 143 | + } else { |
| 144 | + die( "Invalid host name (docroot=" . $_SERVER['DOCUMENT_ROOT'] . "), can't determine language" ); |
| 145 | + } |
| 146 | + } |
| 147 | + } |
| 148 | +} |
| 149 | + |
| 150 | + |
| 151 | +# Disabled, no IPv6 support, waste of a regex -- TS 20051207 |
| 152 | +/* |
| 153 | +$ipv6 = false; |
| 154 | +if (preg_match('/^[a-z]\.ipv6\./', $server)) { |
| 155 | + $ipv6 = true; |
| 156 | +}*/ |
| 157 | + |
| 158 | + |
| 159 | +if ( $site == "wikipedia" ) { |
| 160 | + $dbSuffix = "wiki"; |
| 161 | +} else { |
| 162 | + $dbSuffix = $site; |
| 163 | +} |
| 164 | +$wgDBname = str_replace( "-", "_", $lang . $dbSuffix ); |
| 165 | + |
| 166 | +# Shutting eswiki down |
| 167 | +#if ( $wgDBname == 'eswiki' && php_sapi_name() != 'cli' ) { die(); } |
| 168 | + |
| 169 | +wfProfileOut( "$fname-host" ); |
| 170 | + |
| 171 | +# Initialise wgConf |
| 172 | +wfProfileIn( "$fname-wgConf" ); |
| 173 | +require( "$IP/wmf-config/wgConf.php" ); |
| 174 | + |
| 175 | +function wmfLoadInitialiseSettings( $conf ) { |
| 176 | + global $IP; |
| 177 | + $wgConf =& $conf; # b/c alias |
| 178 | + require( "$IP/wmf-config/InitialiseSettings.php" ); |
| 179 | +} |
| 180 | + |
| 181 | +wfProfileOut( "$fname-wgConf" ); |
| 182 | +wfProfileIn( "$fname-confcache" ); |
| 183 | + |
| 184 | +# Is this database listed in $cluster.dblist? |
| 185 | +if ( array_search( $wgDBname, $wgLocalDatabases ) === false ){ |
| 186 | + # No? Load missing.php |
| 187 | + if ( $wgCommandLineMode) { |
| 188 | + print "Database name $wgDBname is not listed in $cluster.dblist\n"; |
| 189 | + } else { |
| 190 | + require( "$IP/wmf-config/missing.php" ); |
| 191 | + } |
| 192 | + exit; |
| 193 | +} |
| 194 | + |
| 195 | +# Try configuration cache |
| 196 | + |
| 197 | +$filename = "/tmp/mw-cache-1.17/conf-$wgDBname"; |
| 198 | +$globals = false; |
| 199 | +if ( @filemtime( $filename ) >= filemtime( "$IP/wmf-config/InitialiseSettings.php" ) ) { |
| 200 | + $cacheRecord = @file_get_contents( $filename ); |
| 201 | + if ( $cacheRecord !== false ) { |
| 202 | + $globals = unserialize( $cacheRecord ); |
| 203 | + } |
| 204 | +} |
| 205 | +wfProfileOut( "$fname-confcache" ); |
| 206 | +if ( !$globals ) { |
| 207 | + wfProfileIn( "$fname-recache-settings" ); |
| 208 | + # Get configuration from SiteConfiguration object |
| 209 | + require( "$IP/wmf-config/InitialiseSettings.php" ); |
| 210 | + |
| 211 | + $wikiTags = array(); |
| 212 | + foreach ( array( 'private', 'fishbowl', 'special', 'closed', 'flaggedrevs', 'readonly', 'switchover-jun30' ) as $tag ) { |
| 213 | + $dblist = array_map( 'trim', file( "$IP/../$tag.dblist" ) ); |
| 214 | + if ( in_array( $wgDBname, $dblist ) ) { |
| 215 | + $wikiTags[] = $tag; |
| 216 | + } |
| 217 | + } |
| 218 | + |
| 219 | + $globals = $wgConf->getAll( $wgDBname, $dbSuffix, |
| 220 | + array( |
| 221 | + 'lang' => $lang, |
| 222 | + 'docRoot' => $_SERVER['DOCUMENT_ROOT'], |
| 223 | + 'site' => $site, |
| 224 | + 'stdlogo' => "http://upload.wikimedia.org/$site/$lang/b/bc/Wiki.png" |
| 225 | + ), $wikiTags ); |
| 226 | + |
| 227 | + # Save cache |
| 228 | + $oldUmask = umask( 0 ); |
| 229 | + @mkdir( '/tmp/mw-cache-1.17', 0777 ); |
| 230 | + $file = fopen( $filename, 'w' ); |
| 231 | + if ( $file ) { |
| 232 | + fwrite( $file, serialize( $globals ) ); |
| 233 | + fclose( $file ); |
| 234 | + @chmod( $file, 0666 ); |
| 235 | + } |
| 236 | + umask( $oldUmask ); |
| 237 | + wfProfileOut( "$fname-recache-settings" ); |
| 238 | +} |
| 239 | +wfProfileIn( "$fname-misc1" ); |
| 240 | + |
| 241 | +extract( $globals ); |
| 242 | + |
| 243 | + |
| 244 | +#------------------------------------------------------------------------- |
| 245 | +# Settings common to all wikis |
| 246 | + |
| 247 | +# Private settings such as passwords, that shouldn't be published |
| 248 | +# Needs to be before db.php |
| 249 | +require( "$IP/wmf-config/PrivateSettings.php" ); |
| 250 | + |
| 251 | +# Cluster-dependent files for database and memcached |
| 252 | +require( "$IP/wmf-config/db.php" ); |
| 253 | +require("$IP/wmf-config/mc.php"); |
| 254 | + |
| 255 | + |
| 256 | +setlocale( LC_ALL, 'en_US.UTF-8' ); |
| 257 | + |
| 258 | +unset( $wgStylePath ); |
| 259 | +unset( $wgStyleSheetPath ); |
| 260 | +#$wgStyleSheetPath = '/w/skins-1.17'; |
| 261 | +if ( $wgDBname == 'testwiki' ) { |
| 262 | + // Make testing skin/JS changes easier |
| 263 | + $wgExtensionAssetsPath = 'http://test.wikipedia.org/w/extensions-1.17'; |
| 264 | + $wgStyleSheetPath = 'http://test.wikipedia.org/w/skins-1.17'; |
| 265 | + |
| 266 | +} else { |
| 267 | + $wgExtensionAssetsPath = 'http://bits.wikimedia.org/w/extensions-1.17'; |
| 268 | + $wgStyleSheetPath = 'http://bits.wikimedia.org/skins-1.17'; |
| 269 | +} |
| 270 | +$wgStylePath = $wgStyleSheetPath; |
| 271 | +$wgArticlePath = "/wiki/$1"; |
| 272 | + |
| 273 | +$wgScriptPath = '/w'; |
| 274 | +$wgLocalStylePath = "$wgScriptPath/skins-1.17"; |
| 275 | +$wgStockPath = '/images'; |
| 276 | +$wgScript = $wgScriptPath.'/index.php'; |
| 277 | +$wgRedirectScript = $wgScriptPath.'/redirect.php'; |
| 278 | +if ( $wgDBname != 'testwiki' ) { |
| 279 | + // Make testing JS/skin changes easy by not running load.php through bits for testwiki |
| 280 | + $wgLoadScript = "http://bits.wikimedia.org/{$_SERVER['SERVER_NAME']}/load.php"; |
| 281 | +} |
| 282 | + |
| 283 | +# Very wrong place for NFS access - brought the site down -- domas - 2009-01-27 |
| 284 | + |
| 285 | +#if ( ! is_dir( $wgUploadDirectory ) && !$wgCommandLineMode ) { |
| 286 | +# @mkdir( $wgUploadDirectory, 0777 ); |
| 287 | +#} |
| 288 | + |
| 289 | +$wgFileStore['deleted']['directory'] = "/mnt/upload6/private/archive/$site/$lang"; |
| 290 | + |
| 291 | +if ( $cluster == 'yaseo' ) { |
| 292 | + $wgSharedThumbnailScriptPath = 'http://commons.wikimedia.org/w/thumb.php'; |
| 293 | + $wgUploadPath = '/upload'; |
| 294 | + $wgUploadDirectory = "/mnt/upload/$site/$lang"; |
| 295 | + $wgFileStore['deleted']['directory'] = "/mnt/upload/private/archive/$site/$lang"; |
| 296 | +} |
| 297 | + |
| 298 | +# used for mysql/search settings |
| 299 | +$tmarray = getdate(time()); |
| 300 | +$hour = $tmarray['hours']; |
| 301 | +$day = $tmarray['wday']; |
| 302 | + |
| 303 | +$wgEmergencyContact = 'noc@wikipedia.org'; |
| 304 | + |
| 305 | +# HTCP multicast squid purging |
| 306 | +$wgHTCPMulticastAddress = '239.128.0.112'; |
| 307 | +$wgHTCPMulticastTTL = 2; |
| 308 | + |
| 309 | +if( defined( 'DEBUG_LOG' ) ) { |
| 310 | + if ( $wgDBname == 'aawiki' ) { |
| 311 | + $wgMemCachedDebug=true; |
| 312 | + $wgDebugLogFile = 'udp://10.0.5.8:8420/debug15'; |
| 313 | + $wgDebugDumpSql = true; |
| 314 | + } |
| 315 | +} |
| 316 | + |
| 317 | +$wgDBerrorLog = 'udp://10.0.5.8:8420/dberror'; |
| 318 | +$wgCheckDBSchema = false; |
| 319 | + |
| 320 | +if(!isset($wgLocaltimezone)) $wgLocaltimezone = 'UTC'; |
| 321 | +# Ugly hack warning! This needs smoothing out. |
| 322 | +if($wgLocaltimezone) { |
| 323 | + $oldtz = getenv('TZ'); |
| 324 | + putenv("TZ=$wgLocaltimezone"); |
| 325 | + $wgLocalTZoffset = date('Z') / 60; |
| 326 | + putenv("TZ=$oldtz"); |
| 327 | +} |
| 328 | + |
| 329 | + |
| 330 | +$wgShowIPinHeader = false; |
| 331 | +$wgUseGzip = true; |
| 332 | +$wgRCMaxAge = 30*86400; |
| 333 | + |
| 334 | +$wgUseTeX = true; |
| 335 | +$wgTexvc = "/usr/local/bin/texvc"; |
| 336 | +$wgTmpDirectory = '/tmp'; |
| 337 | +$wgLegalTitleChars = "+ %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF"; |
| 338 | + |
| 339 | +$wgSQLMode = null; |
| 340 | + |
| 341 | +# EMERGENCY OPTIMIZATION OPTIONS |
| 342 | + |
| 343 | +$wgMiserMode = true; |
| 344 | +# wgMiserMode now in the configuration object |
| 345 | +# enabled to test DB load balancing -- TS 2004-06-22 |
| 346 | + |
| 347 | +# This is overridden in the Lucene section below |
| 348 | +$wgDisableTextSearch = true; |
| 349 | +$wgDisableSearchUpdate = true; |
| 350 | +$wgDisableCounters = true; |
| 351 | + |
| 352 | +# $wgSiteSupportPage = "http://wikimediafoundation.org/fundraising"; |
| 353 | +# $wgDisableUploads = false; |
| 354 | + |
| 355 | +# Is this safe?? |
| 356 | +#$wgCookieDomain = ".wikipedia.org"; |
| 357 | +#ini_set('session.name', "{$lang}wikiSession" ); |
| 358 | +session_name( $lang.'wikiSession' ); |
| 359 | +$wgSessionsInMemcached = true; |
| 360 | + |
| 361 | +# Enable subpages in the meta space |
| 362 | +$wgNamespacesWithSubpages[4] = 1; |
| 363 | +# And namespace 101, which is probably a talk namespace of some description |
| 364 | +$wgNamespacesWithSubpages[101] = 1; |
| 365 | + |
| 366 | +/* <important notice> |
| 367 | + * |
| 368 | + * When you add a sitenotice make sure to wrap it in <span dir=ltr></span>, |
| 369 | + * otherwise it'll format badly on RTL wikis -ævar |
| 370 | + */ |
| 371 | +# Site notices |
| 372 | +#$wgSiteNotice = "All Wikimedia projects will be down for approximately 30 minutes for a server configuration change around 18:00 UTC on 11 June. We apologise for the inconvenience."; |
| 373 | +#$wgSiteNotice = "Servers will be rebooted for operating system upgrades circa 12:00 UTC."; |
| 374 | +#$wgSiteNotice = "Servers are being rebooted for operating system upgrades. May be offline for a bit."; |
| 375 | +#$wgSiteNotice = "The databases are being moved to a less crash-prone server until the new machine is debugged. We'll be offline for probably an hour or two to get a consistent and complete backup transferred."; |
| 376 | +#$wgSiteNotice = "Completing transfer of database to less crash-prone server; will be offline for a few minutes."; |
| 377 | +#$wgSiteNotice = "Database should be working, but some files are still being transferred."; |
| 378 | +#$wgSiteNotice = "The wiki will be locked starting in a few minutes"; # to |
| 379 | +#move the databases back to a faster machine. Downtime may be a few |
| 380 | +#hours, but things will be much faster after that!"; |
| 381 | +#$wgSiteNotice = "The database is offline for a while from 05:00 UTC |
| 382 | +#to make a clean copy for transfer to our new servers. Sorry for the inconvenience; |
| 383 | +#we should be back online around 06:15 UTC."; |
| 384 | +#$wgSiteNotice = "The database is read-only and using an older copy while some serious problems are fixed, sorry for the inconvenience this may cause."; |
| 385 | +#$wgSiteNotice = "<div name=\"fundraising\" id=\"fundraising\" align=\"center\">'''Wikimedia Fundraising Drive 2004'''. Help us raise $50,000. See [http://wikimediafoundation.org/wiki/fundraising our fundraising page] for details.<br /> |
| 386 | +#[http://meta.wikimedia.org/wiki/Fundraising_site_notice Information on this message] - [{{SERVER}}{{localurl:MediaWiki:Sitenotice|action=edit}} Edit this message]</div>"; |
| 387 | +#$wgSiteNotice = "-"; |
| 388 | +#$wgSiteNotice = "The site will be read only for 20 minutes for a server restart starting at the next hour time - 11:00 UTC"; |
| 389 | +#$wgSiteNotice = "The site will be read-only in 5-15 minutes for an undetermined period of time while database recovery is performed"; |
| 390 | +#$wgSiteNotice = "The site will be unavailable for about 30 minutes between 07:00 and 09:00 UTC to switch master database server."; |
| 391 | +#$wgSiteNotice = '<span dir="ltr">There is some kind of problem with the image server currently. The issue is being investigated.</span>'; # hashar |
| 392 | +#$wgSiteNotice = "There is a problem with the image storage. We are in the process of fixing it."; |
| 393 | +/* </important notice> */ |
| 394 | + |
| 395 | +# Not CLI, see http://bugs.php.net/bug.php?id=47540 |
| 396 | +if ( php_sapi_name() != 'cli' ) { |
| 397 | + ignore_user_abort(true); |
| 398 | +} |
| 399 | + |
| 400 | +$wgUseImageResize = true; |
| 401 | +$wgUseImageMagick = true; |
| 402 | +$wgImageMagickConvertCommand = '/usr/bin/convert'; |
| 403 | +$wgSharpenParameter = '0x0.8'; # for IM>6.5, bug 24857 |
| 404 | + |
| 405 | +# Strict checking is still off for now, but added |
| 406 | +# .txt and .mht to the blacklist. |
| 407 | +# -- brion 2004-09-23 |
| 408 | +# Someone has obviously turned it on, look, the line to disable it is commented out: -- TS |
| 409 | +#$wgStrictFileExtensions = false; |
| 410 | +$wgFileBlacklist[] = 'txt'; |
| 411 | +$wgFileBlacklist[] = 'mht'; |
| 412 | +# $wgFileBlacklist[] = 'pdf'; |
| 413 | +$wgFileExtensions[] = 'xcf'; |
| 414 | +# Disabling this for now -- brion - 2007-08-21 |
| 415 | +#if( $wgDBname != 'commonswiki' ) { |
| 416 | +# $wgFileExtensions[] = 'xls'; |
| 417 | +#} |
| 418 | +$wgFileExtensions[] = 'pdf'; |
| 419 | +$wgFileExtensions[] = 'mid'; |
| 420 | +#$wgFileExtensions[] = 'sxw'; # OOo writer # -- disabling these as obsolete -- brion 2008-02-05 |
| 421 | +#$wgFileExtensions[] = 'sxi'; # OOo presentation |
| 422 | +#$wgFileExtensions[] = 'sxc'; # OOo spreadsheet |
| 423 | +#$wgFileExtensions[] = 'sxd'; # OOo drawing |
| 424 | +$wgFileExtensions[] = 'ogg'; # Ogg audio & video |
| 425 | +$wgFileExtensions[] = 'ogv'; # Ogg audio & video |
| 426 | +$wgFileExtensions[] = 'svg'; |
| 427 | +$wgFileExtensions[] = 'djvu'; # DjVu images/documents |
| 428 | + |
| 429 | +if ( /* use PagedTiffHandler */ true ) { |
| 430 | + include( $IP.'/extensions/PagedTiffHandler/PagedTiffHandler.php' ); |
| 431 | + $wgTiffUseTiffinfo = true; |
| 432 | +} else { |
| 433 | + $wgFileExtensions[] = 'tif'; |
| 434 | + $wgFileExtensions[] = 'tiff'; |
| 435 | +} |
| 436 | + |
| 437 | +if( $wgDBname == 'foundationwiki' ) { # per cary on 2010-05-11 |
| 438 | + $wgFileExtensions[] = 'otf'; |
| 439 | + $wgFileExtensions[] = 'ai'; |
| 440 | +} |
| 441 | + |
| 442 | +if ( $wgDBname == 'outreachwiki' ) { # Per Frank, bug 25106 |
| 443 | + $wgFileExtensions[] = 'sla'; |
| 444 | +} |
| 445 | + |
| 446 | +if( $wmgPrivateWikiUploads ) { |
| 447 | + # mav forced me to --midom |
| 448 | + $wgFileExtensions[] = 'ppt'; |
| 449 | + |
| 450 | + # mav forced me as well!!! -- Tim |
| 451 | + $wgFileExtensions[] = 'doc'; |
| 452 | + # adding since removed elsewhere now -- 2007-08-21 -- brion |
| 453 | + $wgFileExtensions[] = 'xls'; |
| 454 | + # delphine made me do it!!!!! --brion |
| 455 | + $wgFileExtensions[] = 'eps'; |
| 456 | + $wgFileExtensions[] = 'zip'; |
| 457 | + |
| 458 | + # OpenOffice, hell if we're going to allow doc we may as well have these too -- Tim |
| 459 | + $wgFileExtensions[] = 'odf'; |
| 460 | + $wgFileExtensions[] = 'odp'; |
| 461 | + $wgFileExtensions[] = 'ods'; |
| 462 | + $wgFileExtensions[] = 'odt'; |
| 463 | + $wgFileExtensions[] = 'odg'; // OpenOffice Graphics |
| 464 | + $wgFileExtensions[] = 'ott'; // Templates |
| 465 | + |
| 466 | + # Temporary for office work :P |
| 467 | + $wgFileExtensions[] = 'wmv'; |
| 468 | + $wgFileExtensions[] = 'dv'; |
| 469 | + $wgFileExtensions[] = 'avi'; |
| 470 | + $wgFileExtensions[] = 'mov'; |
| 471 | + $wgFileExtensions[] = 'mp3'; // for Jay for fundraising bits |
| 472 | + $wgFileExtensions[] = 'aif'; // " |
| 473 | + $wgFileExtensions[] = 'aiff'; // " |
| 474 | + |
| 475 | + # Becausee I hate having to find print drivers -- tomasz |
| 476 | + $wgFileExtensions[] = 'ppd'; |
| 477 | + |
| 478 | + # InDesign & PhotoShop, Illustrator wanted for Chapters logo work |
| 479 | + $wgFileExtensions[] = 'indd'; |
| 480 | + $wgFileExtensions[] = 'inx'; |
| 481 | + $wgFileExtensions[] = 'psd'; |
| 482 | + $wgFileExtensions[] = 'ai'; |
| 483 | + |
| 484 | + # Pete made me --Roan |
| 485 | + $wgFileExtensions[] = 'omniplan'; |
| 486 | + |
| 487 | + # Dia Diagrams files --fred. |
| 488 | + $wgFileExtensions[] = 'dia'; |
| 489 | + // To allow OpenOffice doc formats we need to not blacklist zip files |
| 490 | + $wgMimeTypeBlacklist = array_diff( |
| 491 | + $wgMimeTypeBlacklist, |
| 492 | + array( 'application/zip' ) ); |
| 493 | +} |
| 494 | + |
| 495 | +# Hack for rsvg broken by security patch |
| 496 | +$wgSVGConverters['rsvg-broken'] = '$path/rsvg-convert -w $width -h $height -o $output < $input'; |
| 497 | + |
| 498 | +$wgAllowUserJs = true; |
| 499 | +$wgAllowUserCss = true; |
| 500 | + |
| 501 | +# Squid! |
| 502 | +$wgUseSquid = true; |
| 503 | +$wgUseESI = false; |
| 504 | + |
| 505 | +# As of 2005-04-08, this is empty |
| 506 | +# Squids are purged by HTCP multicast, currently relayed to paris via udpmcast on larousse |
| 507 | +$wgSquidServers = array(); |
| 508 | + |
| 509 | +# Accept XFF from these proxies |
| 510 | +$wgSquidServersNoPurge = array( |
| 511 | + |
| 512 | + # Wikimedia servers |
| 513 | + # ------------------------------------------------ |
| 514 | + |
| 515 | + # pmtpa external |
| 516 | + # Note that all pmtpa squids must have an external address here, for the |
| 517 | + # benefit of the yaseo apaches. |
| 518 | + |
| 519 | + '208.80.152.162', # singer (secure) |
| 520 | + |
| 521 | + '208.80.152.119', # eiximenis (testing) |
| 522 | + |
| 523 | + '208.80.152.11', # sq1 |
| 524 | + '208.80.152.12', # sq2 |
| 525 | + '208.80.152.13', # sq3 |
| 526 | + '208.80.152.14', # sq4 |
| 527 | + '208.80.152.15', # sq5 |
| 528 | + '208.80.152.16', # sq6 |
| 529 | + '208.80.152.17', # sq7 |
| 530 | + '208.80.152.18', # sq8 |
| 531 | + '208.80.152.19', # sq9 |
| 532 | + '208.80.152.20', # sq10 |
| 533 | + '208.80.152.21', # sq11 |
| 534 | + '208.80.152.22', # sq12 |
| 535 | + '208.80.152.23', # sq13 |
| 536 | + '208.80.152.24', # sq14 |
| 537 | + '208.80.152.25', # sq15 |
| 538 | + '208.80.152.26', # sq16 |
| 539 | + '208.80.152.27', # sq17 |
| 540 | + '208.80.152.28', # sq18 |
| 541 | + '208.80.152.29', # sq19 |
| 542 | + '208.80.152.30', # sq20 |
| 543 | + '208.80.152.31', # sq21 |
| 544 | + '208.80.152.32', # sq22 |
| 545 | + '208.80.152.33', # sq23 |
| 546 | + '208.80.152.34', # sq24 |
| 547 | + '208.80.152.35', # sq25 |
| 548 | + '208.80.152.36', # sq26 |
| 549 | + '208.80.152.37', # sq27 |
| 550 | + '208.80.152.38', # sq28 |
| 551 | + '208.80.152.39', # sq29 |
| 552 | + '208.80.152.40', # sq30 |
| 553 | + '208.80.152.41', # sq31 |
| 554 | + '208.80.152.42', # sq32 |
| 555 | + '208.80.152.43', # sq33 |
| 556 | + '208.80.152.44', # sq34 |
| 557 | + '208.80.152.45', # sq35 |
| 558 | + '208.80.152.46', # sq36 |
| 559 | + '208.80.152.47', # sq37 |
| 560 | + '208.80.152.48', # sq38 |
| 561 | + '208.80.152.49', # sq39 |
| 562 | + '208.80.152.50', # sq40 |
| 563 | + '208.80.152.51', # sq41 |
| 564 | + '208.80.152.52', # sq42 |
| 565 | + '208.80.152.53', # sq43 |
| 566 | + '208.80.152.54', # sq44 |
| 567 | + '208.80.152.55', # sq45 |
| 568 | + '208.80.152.56', # sq46 |
| 569 | + '208.80.152.57', # sq47 |
| 570 | + '208.80.152.58', # sq48 |
| 571 | + '208.80.152.59', # sq49 |
| 572 | + '208.80.152.60', # sq50 |
| 573 | + '208.80.152.61', # sq51 |
| 574 | + '208.80.152.62', # sq52 |
| 575 | + '208.80.152.63', # sq53 |
| 576 | + '208.80.152.64', # sq54 |
| 577 | + '208.80.152.65', # sq55 |
| 578 | + '208.80.152.66', # sq56 |
| 579 | + '208.80.152.67', # sq57 |
| 580 | + '208.80.152.68', # sq58 |
| 581 | + '208.80.152.69', # sq59 |
| 582 | + '208.80.152.70', # sq60 |
| 583 | + '208.80.152.71', # sq61 |
| 584 | + '208.80.152.72', # sq62 |
| 585 | + '208.80.152.73', # sq63 |
| 586 | + '208.80.152.74', # sq64 |
| 587 | + '208.80.152.75', # sq65 |
| 588 | + '208.80.152.76', # sq66 |
| 589 | + '208.80.152.77', # sq67 |
| 590 | + '208.80.152.78', # sq68 |
| 591 | + '208.80.152.79', # sq69 |
| 592 | + '208.80.152.80', # sq70 |
| 593 | + '208.80.152.81', # sq71 |
| 594 | + '208.80.152.82', # sq72 |
| 595 | + '208.80.152.83', # sq73 |
| 596 | + '208.80.152.84', # sq74 |
| 597 | + '208.80.152.85', # sq75 |
| 598 | + '208.80.152.86', # sq76 |
| 599 | + '208.80.152.87', # sq77 |
| 600 | + '208.80.152.88', # sq78 |
| 601 | + '208.80.152.89', # sq79 |
| 602 | + '208.80.152.90', # sq80 |
| 603 | + '208.80.152.91', # sq81 |
| 604 | + '208.80.152.92', # sq82 |
| 605 | + '208.80.152.93', # sq83 |
| 606 | + '208.80.152.94', # sq84 |
| 607 | + '208.80.152.95', # sq85 |
| 608 | + '208.80.152.96', # sq86 |
| 609 | + |
| 610 | + '91.198.174.11', # knsq1 |
| 611 | + '91.198.174.12', # knsq2 |
| 612 | + '91.198.174.13', # knsq3 |
| 613 | + '91.198.174.14', # knsq4 |
| 614 | + '91.198.174.15', # knsq5 |
| 615 | + '91.198.174.16', # knsq6 |
| 616 | + '91.198.174.17', # knsq7 |
| 617 | + '91.198.174.18', # knsq8 |
| 618 | + '91.198.174.19', # knsq9 |
| 619 | + '91.198.174.20', # knsq10 |
| 620 | + '91.198.174.21', # knsq11 |
| 621 | + '91.198.174.22', # knsq12 |
| 622 | + '91.198.174.23', # knsq13 |
| 623 | + '91.198.174.24', # knsq14 |
| 624 | + '91.198.174.25', # knsq15 |
| 625 | + '91.198.174.26', # knsq16 |
| 626 | + '91.198.174.27', # knsq17 |
| 627 | + '91.198.174.28', # knsq18 |
| 628 | + '91.198.174.29', # knsq19 |
| 629 | + '91.198.174.30', # knsq20 |
| 630 | + '91.198.174.31', # knsq21 |
| 631 | + '91.198.174.32', # knsq22 |
| 632 | + '91.198.174.33', # knsq23 |
| 633 | + '91.198.174.34', # knsq24 |
| 634 | + '91.198.174.35', # knsq25 |
| 635 | + '91.198.174.36', # knsq26 |
| 636 | + '91.198.174.37', # knsq27 |
| 637 | + '91.198.174.38', # knsq28 |
| 638 | + '91.198.174.39', # knsq29 |
| 639 | + '91.198.174.40', # knsq30 |
| 640 | + |
| 641 | + '91.198.174.41', # amssq31 |
| 642 | + '91.198.174.42', # amssq32 |
| 643 | + '91.198.174.43', # amssq33 |
| 644 | + '91.198.174.44', # amssq34 |
| 645 | + '91.198.174.45', # amssq35 |
| 646 | + '91.198.174.46', # amssq36 |
| 647 | + '91.198.174.47', # amssq37 |
| 648 | + '91.198.174.48', # amssq38 |
| 649 | + '91.198.174.49', # amssq39 |
| 650 | + '91.198.174.50', # amssq40 |
| 651 | + '91.198.174.51', # amssq41 |
| 652 | + '91.198.174.52', # amssq42 |
| 653 | + '91.198.174.53', # amssq43 |
| 654 | + '91.198.174.54', # amssq44 |
| 655 | + '91.198.174.55', # amssq45 |
| 656 | + '91.198.174.56', # amssq46 |
| 657 | + '91.198.174.57', # amssq47 |
| 658 | + '91.198.174.58', # amssq48 |
| 659 | + '91.198.174.59', # amssq49 |
| 660 | + '91.198.174.60', # amssq50 |
| 661 | + '91.198.174.61', # amssq51 |
| 662 | + '91.198.174.62', # amssq52 |
| 663 | + '91.198.174.63', # amssq53 |
| 664 | + '91.198.174.64', # amssq54 |
| 665 | + '91.198.174.65', # amssq55 |
| 666 | + '91.198.174.66', # amssq56 |
| 667 | + '91.198.174.67', # amssq57 |
| 668 | + '91.198.174.68', # amssq58 |
| 669 | + '91.198.174.69', # amssq59 |
| 670 | + '91.198.174.70', # amssq60 |
| 671 | + '91.198.174.71', # amssq61 |
| 672 | + '91.198.174.72', # amssq62 |
| 673 | + |
| 674 | +); |
| 675 | + |
| 676 | +# IP addresses that aren't proxies, regardless of what the other sources might say |
| 677 | +$wgProxyWhitelist = array( |
| 678 | + '68.124.59.186', |
| 679 | + '202.63.61.242', |
| 680 | + '62.214.230.86', |
| 681 | + '217.94.171.96', |
| 682 | + |
| 683 | + # True Internet |
| 684 | + # (Thai ISP, used by Waerth) |
| 685 | +# '203.144.143.2', |
| 686 | +# '203.144.143.3', |
| 687 | +# '203.144.143.6', |
| 688 | + |
| 689 | +); |
| 690 | + |
| 691 | +# Default: |
| 692 | +#$wgSquidMaxage = 2678400; |
| 693 | + |
| 694 | +# Purge site message: |
| 695 | +#$wgSquidMaxage = 2678400; |
| 696 | +#$wgSquidMaxage = 3600; |
| 697 | + |
| 698 | +# Special:AskSQL |
| 699 | +$wgLogQueries = true; |
| 700 | +$wgSqlLogFile = $wgUploadDirectory.'/sqllog'; |
| 701 | + |
| 702 | + |
| 703 | +$wgBlockOpenProxies = false; |
| 704 | + |
| 705 | +$wgDebugLogGroups['UploadBlacklist'] = 'udp://10.0.5.8:8420/upload-blacklist'; |
| 706 | + |
| 707 | +$wgDebugLogGroups['404'] = 'udp://10.0.5.8:8420/four-oh-four'; |
| 708 | + |
| 709 | + |
| 710 | +# Don't allow users to redirect other users' talk pages |
| 711 | +# Disabled because interwiki redirects are turned off, so it's not needed |
| 712 | +#include( "$IP/Filter-ext_redir.php" ); |
| 713 | + |
| 714 | +#include("outage.php"); |
| 715 | +#declareOutage( "2004-05-12", "02:00", "03:00" ); |
| 716 | +/* |
| 717 | +$d = getdate(); |
| 718 | +$hour = $d['hours']; |
| 719 | +if ( $lang == "en" && $hour >= 13 && $hour < 18 ) { |
| 720 | + $wgUseWatchlistCache = true; |
| 721 | + $wgWLCacheTimeout = 3600; |
| 722 | +} |
| 723 | +*/ |
| 724 | +## For attaching licensing metadata to pages, and displaying an |
| 725 | +## appropriate copyright notice / icon. GNU Free Documentation |
| 726 | +## License and Creative Commons licenses are supported so far. |
| 727 | +$wgEnableCreativeCommonsRdf = false; |
| 728 | + |
| 729 | +if( $site == 'wikinews' ) { |
| 730 | + #$wgRightsPage = "";# Set to the title of a wiki page that describes your license/copyright |
| 731 | + $wgRightsUrl = 'http://creativecommons.org/licenses/by/2.5/'; |
| 732 | + $wgRightsText = 'Creative Commons Attribution 2.5'; |
| 733 | + $wgRightsIcon = 'http://creativecommons.org/images/public/somerights20.png'; |
| 734 | +} elseif ( $wgDBname == 'huwikinews') { |
| 735 | + $wgRightsUrl = 'http://creativecommons.org/licenses/by/3.0/'; |
| 736 | + $wgRightsText = 'Creative Commons Attribution 3.0 Unported'; |
| 737 | + $wgRightsIcon = 'http://creativecommons.org/images/public/somerights20.png'; |
| 738 | +} else { |
| 739 | + # Set 2009-06-22 -- BV |
| 740 | + $wgRightsUrl = 'http://creativecommons.org/licenses/by-sa/3.0/'; |
| 741 | + $wgRightsText = 'Creative Commons Attribution-Share Alike 3.0 Unported'; |
| 742 | + $wgRightsIcon = 'http://creativecommons.org/images/public/somerights20.png'; |
| 743 | +} |
| 744 | + |
| 745 | +# FIXME: Turned off tidy for testing. --brion 2004-01-19 |
| 746 | +# turned it on again to see if this is the culprit --gwicke 2005-01-20 |
| 747 | +# Anthere had problems with the quarto page on meta which contained broken markup |
| 748 | +# Turned off for performance reasons experimentally -- TS 2005-04-20 |
| 749 | +# -- Didn't seem to make any difference |
| 750 | +# Turned off, to investigate cluster trouble -- AV Mon Nov 14 21:45:49 UTC 2005 |
| 751 | +# Investigated cluster trouble, tidy seems to have been unrelated to them -- TS |
| 752 | +$wgUseTidy = true; |
| 753 | + |
| 754 | +# Profiling, typically at 100 rate |
| 755 | +#Caution: moderate profiling rates can write 1.5GB per day each to the slow query and binary logs. |
| 756 | +# If the master is low on disk space, you'll need to empty the slow query log |
| 757 | +# PLEASE TELL JAMES OR WHOEVER IS LOOKING AFTER THE DATABASE SERVERS IF YOU TURN ON PROFILING |
| 758 | +# :PROFILING: |
| 759 | + |
| 760 | +/* |
| 761 | +//if ( isset( $_REQUEST['wpSave'] ) ) { |
| 762 | + if ( $wgDBname == 'enwiki' || $wgDBname == 'dewiki' ) { |
| 763 | + $wgProfiling = true; |
| 764 | + $wgProfileToDatabase = true; |
| 765 | + $wgProfileSampleRate = 500; |
| 766 | + } |
| 767 | + if ( $wgDBname == 'frwiki' ) { |
| 768 | + $wgProfiling = true; |
| 769 | + $wgProfileToDatabase = true; |
| 770 | + $wgProfileSampleRate = 100; |
| 771 | + } |
| 772 | + if ( $wgDBname == 'testwiki' ) { |
| 773 | + $wgProfiling = true; |
| 774 | + $wgProfileToDatabase = true; |
| 775 | + $wgProfileSampleRate = 1; |
| 776 | + } |
| 777 | +// $wgProfileSampleRate /= 50; |
| 778 | +//} |
| 779 | +*/ |
| 780 | +/* |
| 781 | +if ($wgDBname == 'enwiki' || $wgDBname == 'commonswiki' ) { |
| 782 | + $wgProfiling = true; |
| 783 | + $wgProfilerType = 'SimpleUDP'; |
| 784 | + $wgProfileSampleRate = 1; |
| 785 | +}*/ |
| 786 | +$wgUDPProfilerHost = '208.80.152.161'; # spence |
| 787 | +$wgAggregateStatsID = 'all'; |
| 788 | + |
| 789 | +// $wgProfiler is set in index.php |
| 790 | +if ( isset( $wgProfiler ) ) { |
| 791 | + $wgProfiling = true; |
| 792 | + $wgProfileToDatabase = true; |
| 793 | + $wgProfileSampleRate = 1; |
| 794 | +} |
| 795 | + |
| 796 | + |
| 797 | +wfProfileOut( "$fname-misc1" ); |
| 798 | +wfProfileIn( "$fname-ext-include1" ); |
| 799 | + |
| 800 | +include($IP.'/extensions/timeline/Timeline.php'); |
| 801 | +include($IP.'/extensions/wikihiero/wikihiero.php'); |
| 802 | + |
| 803 | +// if ( $wgDBname == 'testwiki' ) { |
| 804 | + // $wgTimelineSettings->fontFile = 'unifont-5.1.20080907.ttf'; |
| 805 | +// } |
| 806 | +if ( $wgDBname == 'testwiki' || $wgDBname == 'mlwiki' ) { |
| 807 | + // FreeSansWMF has been generated from FreeSans and FreeSerif by using this script with fontforge: |
| 808 | + // Open("FreeSans.ttf"); |
| 809 | + // MergeFonts("FreeSerif.ttf"); |
| 810 | + // SetFontNames("FreeSans-WMF", "FreeSans WMF", "FreeSans WMF Regular", "Regular", ""); |
| 811 | + // Generate("FreeSansWMF.ttf", "", 4 ); |
| 812 | + $wgTimelineSettings->fontFile = 'FreeSansWMF.ttf'; |
| 813 | +} |
| 814 | + |
| 815 | + |
| 816 | +include( $IP.'/extensions/SiteMatrix/SiteMatrix.php' ); |
| 817 | +// Config for sitematrix |
| 818 | +$wgSiteMatrixFile = '/apache/common/langlist'; |
| 819 | +$wgSiteMatrixClosedSites = "$IP/../closed.dblist"; |
| 820 | +$wgSiteMatrixPrivateSites = "$IP/../private.dblist"; |
| 821 | +$wgSiteMatrixFishbowlSites = "$IP/../fishbowl.dblist"; |
| 822 | + |
| 823 | +include( $IP.'/extensions/CharInsert/CharInsert.php' ); |
| 824 | +include( $IP.'/extensions/CheckUser/CheckUser.php' ); |
| 825 | +include( $IP.'/extensions/ParserFunctions/ParserFunctions.php' ); |
| 826 | +$wgMaxIfExistCount = 500; // obs |
| 827 | +$wgExpensiveParserFunctionLimit = 500; |
| 828 | + |
| 829 | +// <ref> and <references> tags -ævar, 2005-12-23 |
| 830 | +require( $IP.'/extensions/Cite/Cite.php' ); |
| 831 | + |
| 832 | +// psuedobotinterface -ævar, 2005-12-25 |
| 833 | +//require( $IP.'/extensions/Filepath/SpecialFilepath.php' ); // obsolete 2008-02-12 |
| 834 | + |
| 835 | +# Inputbox extension for searching or creating articles |
| 836 | +include( $IP.'/extensions/InputBox/InputBox.php' ); |
| 837 | + |
| 838 | +include( $IP.'/extensions/ExpandTemplates/ExpandTemplates.php' ); |
| 839 | +// include( $IP.'/extensions/PicturePopup/PicturePopup.php' ); // extension deleted in december 2007... |
| 840 | + |
| 841 | +include( $IP.'/extensions/ImageMap/ImageMap.php' ); |
| 842 | +include( $IP.'/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php' ); |
| 843 | + |
| 844 | +// Experimental side-by-side comparison extension for wikisource. enabled brion 2006-01-13 |
| 845 | +if( $wmgUseDoubleWiki ) { |
| 846 | + include( $IP.'/extensions/DoubleWiki/DoubleWiki.php' ); |
| 847 | +} |
| 848 | + |
| 849 | +# Poem |
| 850 | +include( $IP.'/extensions/Poem/Poem.php' ); |
| 851 | + |
| 852 | +if ( $wgDBname == 'testwiki' ) { |
| 853 | + include( $IP.'/extensions/UnicodeConverter/UnicodeConverter.php' ); |
| 854 | +} |
| 855 | + |
| 856 | +// Per-wiki config for Flagged Revisions |
| 857 | +if ( $wmgUseFlaggedRevs ) { |
| 858 | + include( $IP.'/wmf-config/flaggedrevs.php'); |
| 859 | +} |
| 860 | + |
| 861 | +$wgUseAjax = true; |
| 862 | +$wgCategoryTreeDynamicTag = true; |
| 863 | +require( $IP.'/extensions/CategoryTree/CategoryTree.php' ); |
| 864 | + |
| 865 | + |
| 866 | +if ( $wmgUseProofreadPage ) { |
| 867 | +//if ( $wgDBname == 'frwikisource' || $wgDBname == 'enwikisource' || $wgDBname == 'ptwikisource' ) { |
| 868 | + include( $IP . '/extensions/ProofreadPage/ProofreadPage.php' ); |
| 869 | + include( $IP . '/wmf-config/proofreadpage.php'); |
| 870 | +} |
| 871 | +if( $wmgUseLST ) { |
| 872 | + include( $IP . '/extensions/LabeledSectionTransclusion/lst.php' ); |
| 873 | +} |
| 874 | + |
| 875 | +if( $wmgUseSpamBlacklist ) { |
| 876 | + include( $IP.'/extensions/SpamBlacklist/SpamBlacklist.php' ); |
| 877 | +} |
| 878 | + |
| 879 | +include( $IP.'/extensions/UploadBlacklist/UploadBlacklist.php' ); |
| 880 | +# disabled by Domas. reenabling without consulting will end up on wrath and torture |
| 881 | +include( $IP.'/extensions/TitleBlacklist/TitleBlacklist.php' ); |
| 882 | + |
| 883 | +$wgTitleBlacklistSources = array( |
| 884 | + array( |
| 885 | + 'type' => TBLSRC_URL, |
| 886 | + 'src' => 'http://meta.wikimedia.org/w/index.php?title=Title_blacklist&action=raw&tb_ver=1', |
| 887 | + ), |
| 888 | +); |
| 889 | + |
| 890 | +#if ( $site == 'wikiversity' || $wgDBname == 'ptwikibooks' || $wgDBname == 'itwikibooks' || $wgDBname == 'enwikinews' ) { |
| 891 | +if( $wmgUseQuiz ) { |
| 892 | + include( "$IP/extensions/Quiz/Quiz.php" ); |
| 893 | +} |
| 894 | + |
| 895 | +if ( $wmgUseGadgets ) { |
| 896 | + include( "$IP/extensions/Gadgets/Gadgets.php" ); |
| 897 | +} |
| 898 | + |
| 899 | +// if( $wgAutomaticGroups ) { |
| 900 | +// include( "$IP/extensions/AutomaticGroups/AutomaticGroups.php" ); |
| 901 | +//} |
| 902 | + |
| 903 | +include( $IP.'/extensions/OggHandler/OggHandler.php' ); |
| 904 | +$wgOggThumbLocation = '/usr/local/bin/oggThumb'; |
| 905 | +// you can keep the filename the same and use maintenance/purgeList.php |
| 906 | +$wgCortadoJarFile = 'http://upload.wikimedia.org/jars/cortado.jar'; |
| 907 | + |
| 908 | +include( $IP.'/extensions/AssertEdit/AssertEdit.php' ); |
| 909 | + |
| 910 | +if ( $wgDBname == 'foundationwiki' ) { |
| 911 | + include( "$IP/extensions/FormPreloadPostCache/FormPreloadPostCache.php" ); |
| 912 | + include( "$IP/extensions/SkinPerPage/SkinPerPage.php" ); |
| 913 | + include( "$IP/extensions/skins/Schulenburg/Schulenburg.php" ); |
| 914 | + include( "$IP/extensions/skins/Tomas/Tomas.php" ); |
| 915 | + include( "$IP/extensions/skins/Donate/Donate.php" ); |
| 916 | + |
| 917 | + include( "$IP/extensions/ContributionReporting/ContributionReporting.php" ); |
| 918 | + include( "$IP/wmf-config/reporting-setup.php"); |
| 919 | + |
| 920 | + include( "$IP/extensions/ContactPageFundraiser/ContactPage.php" ); |
| 921 | + $wgContactUser = 'Storiescontact'; |
| 922 | + $wgUseTidy = false; |
| 923 | + |
| 924 | + $wgAllowedTemplates = array( |
| 925 | + 'enwiki_00','enwiki_01','enwiki_02','enwiki_03', |
| 926 | + 'enwiki_04','enwiki_05', 'donate','2009_Notice1', |
| 927 | + '2009_Notice1_b', '2009_EM1Notice','2009_EM1Notice_b','2009_Notice11', |
| 928 | + '2009_Notice10','2009_Notice14','2009_Notice15','2009_Notice17', |
| 929 | + '2009_Notice17_g','2009_Notice18','2009_Notice18_g','2009_Notice21_g', |
| 930 | + '2009_Notice22','2009_Notice22_g','2009_Notice30','2009_Notice31', |
| 931 | + '2009_Notice32','2009_Notice33','2009_Notice34','2009_Notice30_g', |
| 932 | + '2009_Notice30_EML', 'Notice30_EML','2009_Notice35','2009_Notice36', |
| 933 | + '2009_Notice36_g','2009_Notice37','2009_Notice38','2009_Notice39', |
| 934 | + '2009_Notice40','2009_Notice30_bold','2009_Yandex1','2009_Notice41', |
| 935 | + '2009_Notice42','2009_Notice43','2009_Notice44','2009_Notice45', |
| 936 | + '2009_Notice47','2009_Notice46','2009_Notice48','2009_Craig_Appeal1', |
| 937 | + '2009_Jimmy_Appeal1','2009_Jimmy_Appeal3','2009_Jimmy_Appeal4','2009_Jimmy_Appeal5', |
| 938 | + '2009_Jimmy_Appeal7','2009_Jimmy_Appeal8','2009_Jimmy_Appeal9','2009_Notice49', |
| 939 | + '2009_Notice51','2009_ThankYou1','2009_ThankYou2','2010_testing1', |
| 940 | + '2010_testing1B','2010_testing2','2010_testing2B','2010_testing3', |
| 941 | + '2010_testing3B','2010_testing4','2010_testing4B','2010_testing5', |
| 942 | + '2010_testing5_anon','2010_testing6','2010_testing6_anon','2010_testing7', |
| 943 | + '2010_testing7_anon','2010_testing8','2010_testing8_anon','2010_testing9', |
| 944 | + '2010_testing9_anon','2010_testing10','2010_testing10_anon','2010_testing11', |
| 945 | + '2010_testing11_anon','2010_testing12','2010_testing12_anon','2010_testing13', |
| 946 | + '2010_testing13_anon','2010_testing14','2010_testing14_anon','2010_testing15', |
| 947 | + '2010_testing15_anon','2010_testing16','2010_testing17','2010_testing18', |
| 948 | + '2010_testing15_anon','2010_testing16','2010_testing17','2010_testing18', |
| 949 | + '2010_testing19','2010_testing20','2010_testing21','2010_testing22', |
| 950 | + '2010_testing23','2010_testing24','2010_testing25','2010_testing26', |
| 951 | + '2010_testing23','2010_testing24','2010_testing25','2010_testing26', |
| 952 | + '2010_testing23','2010_testing24','2010_testing25','2010_testing26', |
| 953 | + '2010_testing27','2010_testing28','2010_testing29','2010_testing30', |
| 954 | + '2010_testing31','2010_testing32','2010_testing33','2010_testing34', |
| 955 | + '2010_testing35','2010_testing36','2010_testing37','2010_testing38', |
| 956 | + '2010_testing39','2010_testing40','2010_testing41','2010_testing42', |
| 957 | + '2010_testing43','2010_testing44','2010_testing44_twostep','2010_testing45', |
| 958 | + '2010_testing46','2010_testing47','2010_testing48','2010_testing49', |
| 959 | + '2010_testing50','2010_testing51','2010_testing52','2010_testing53', |
| 960 | + '2010_testing54','2010_testing55','2010_fr_testing1','2010_fr_testing5', |
| 961 | + '2010_fr_testing3','2010_fr_testing4','2010_de_testing1','2010_de_testing2', |
| 962 | + '2010_de_testing3','2010_de_testing4','2010_en_testing1',',2010_en_testing2', |
| 963 | + '2010_en_testing3','2010_en_testing4','2010_en_testing5','2010_en_testing6', |
| 964 | + '2010_en_testing7','2010_en_testing8','2010_en_testing9','2010_en_testing10', |
| 965 | + '2010_en_testing11','2010_en_testing12','2010_en_testing13','2010_en_testing14', |
| 966 | + '2010_en_testing15','2010_en_testing16','2010_en_testing17','2010_en_testing18', |
| 967 | + '2010_en_testing19','2010_en_testing20','2010_en_testing21','2010_en_testing22', |
| 968 | + '2010_en_testing23','2010_en_testing24','2010_en_testing25','2010_en_testing26', |
| 969 | + '2010_en_testing27','2010_en_testing28','2010_en_testing29','2010_en_testing30', |
| 970 | + '2010_en_testing31','2010_en_testing32','2010_en_testing33','2010_en_testing34', |
| 971 | + '2010_en_testing35','2010_en_testing36','2010_en_testing37','2010_en_testing38', |
| 972 | + '2010_en_testing39','2010_en_testing40', |
| 973 | + |
| 974 | + ); |
| 975 | + |
| 976 | + $wgAllowedSupport = array( |
| 977 | + 'Support', 'Support2', 'ChangeWorld', 'FiveFacts', |
| 978 | + 'Craig_Appeal', 'Appeal', 'Appeal2', 'Global_Support', |
| 979 | + '2010_Landing_1','2010_Landing_2','2010_Landing_3', '2010_Landing_4', |
| 980 | + '2010_Landing_5','2010_Landing_6','2010_Landing_7','2010_Landing_8', |
| 981 | + '2010_Landing_9','cc1','cc2','cc3','cc4','cc5','cc6','cc7','cc8','cc9', |
| 982 | + 'cc10','cc11','cc12','cc13','cc14','cc15','Appeal3','Appeal4','Appeal5', |
| 983 | + 'Appeal6','Appeal7','Appeal8','Appeal9','Appeal10','Appeal11','Appeal12', |
| 984 | + 'Appeal13','Appeal14','Appeal16','Appeal18','Appeal20','cc15', |
| 985 | + ); |
| 986 | + |
| 987 | + $wgAllowedPaymentMethod = array( |
| 988 | + 'cc','pp' |
| 989 | + ); |
| 990 | + |
| 991 | + |
| 992 | +} |
| 993 | + |
| 994 | +if ( $wgDBname == 'mediawikiwiki' ) { |
| 995 | + include( "$IP/extensions/ExtensionDistributor/ExtensionDistributor.php" ); |
| 996 | + $wgExtDistTarDir = '/mnt/upload6/ext-dist'; |
| 997 | + $wgExtDistTarUrl = 'http://upload.wikimedia.org/ext-dist'; |
| 998 | + $wgExtDistWorkingCopy = '/mnt/upload6/private/ExtensionDistributor/mw-snapshot'; |
| 999 | + $wgExtDistRemoteClient = '208.80.152.165:8430'; |
| 1000 | + |
| 1001 | + $wgExtDistBranches = array( |
| 1002 | + 'trunk' => array( |
| 1003 | + 'tarLabel' => 'trunk', |
| 1004 | + 'msgName' => 'extdist-current-version', |
| 1005 | + ), |
| 1006 | + /** |
| 1007 | + * If you add a branch here, you must also check it out into the working copy directory. |
| 1008 | + * If you add it here without doing that, the extension will break. |
| 1009 | + */ |
| 1010 | + 'branches/REL1_17' => array( |
| 1011 | + 'tarLabel' => 'MW1.17', |
| 1012 | + 'name' => '1.17.x', |
| 1013 | + ), |
| 1014 | + 'branches/REL1_16' => array( |
| 1015 | + 'tarLabel' => 'MW1.16', |
| 1016 | + 'name' => '1.16.x', |
| 1017 | + ), |
| 1018 | + 'branches/REL1_15' => array( |
| 1019 | + 'tarLabel' => 'MW1.15', |
| 1020 | + 'name' => '1.15.x', |
| 1021 | + ), |
| 1022 | + 'branches/REL1_14' => array( |
| 1023 | + 'tarLabel' => 'MW1.14', |
| 1024 | + 'name' => '1.14.x', |
| 1025 | + ), |
| 1026 | + 'branches/REL1_13' => array( |
| 1027 | + 'tarLabel' => 'MW1.13', |
| 1028 | + 'name' => '1.13.x', |
| 1029 | + ), |
| 1030 | + 'branches/REL1_12' => array( |
| 1031 | + 'tarLabel' => 'MW1.12', |
| 1032 | + 'name' => '1.12.x', |
| 1033 | + ), |
| 1034 | + 'branches/REL1_11' => array( |
| 1035 | + 'tarLabel' => 'MW1.11', |
| 1036 | + 'name' => '1.11.x', |
| 1037 | + ), |
| 1038 | + /** |
| 1039 | + * If you delete a branch, you must also delete it from the working copy |
| 1040 | + */ |
| 1041 | + 'branches/REL1_10' => array( |
| 1042 | + 'tarLabel' => 'MW1.10', |
| 1043 | + 'name' => '1.10.x', |
| 1044 | + ), |
| 1045 | + ); |
| 1046 | +} |
| 1047 | + |
| 1048 | +include( $IP.'/extensions/GlobalBlocking/GlobalBlocking.php' ); |
| 1049 | +$wgGlobalBlockingDatabase = 'centralauth'; |
| 1050 | +$wgApplyGlobalBlocks = $wmgApplyGlobalBlocks; |
| 1051 | + |
| 1052 | +include( $IP.'/extensions/TrustedXFF/TrustedXFF.php' ); |
| 1053 | +$wgTrustedXffFile = "$IP/cache/trusted-xff.cdb"; |
| 1054 | + |
| 1055 | +if ( $wmgContactPageConf ) { |
| 1056 | + include( $IP.'/extensions/ContactPage/ContactPage.php' ); |
| 1057 | + extract( $wmgContactPageConf ); |
| 1058 | +} |
| 1059 | + |
| 1060 | +include( $IP.'/extensions/SecurePoll/SecurePoll.php' ); |
| 1061 | + |
| 1062 | +$wgHooks['SecurePoll_JumpUrl'][] = 'wmfSecurePollJumpUrl'; |
| 1063 | + |
| 1064 | +function wmfSecurePollJumpUrl( $page, &$url ) { |
| 1065 | + global $site, $lang; |
| 1066 | + |
| 1067 | + $url = wfAppendQuery( $url, array( 'site' => $site, 'lang' => $lang ) ); |
| 1068 | + return true; |
| 1069 | +} |
| 1070 | + |
| 1071 | +// Email capture |
| 1072 | +// NOTE: Must be BEFORE ArticleFeedback |
| 1073 | +if ( $wgUseEmailCapture ) { |
| 1074 | + include( "$IP/extensions/EmailCapture/EmailCapture.php" ); |
| 1075 | +} |
| 1076 | + |
| 1077 | +// Mobile redirect |
| 1078 | +if ( $wmgUseWikimediaMobile && !$secure ) { |
| 1079 | + include( "$IP/extensions/WikimediaMobile/WikimediaMobile.php" ); |
| 1080 | + $wgWikimediaMobileUrl = "http://$lang.m.$site.org/wiki"; |
| 1081 | + $wgWikimediaMobileVersion .= '.2'; |
| 1082 | +} |
| 1083 | + |
| 1084 | +// PoolCounter |
| 1085 | +if ( $wmgUsePoolCounter ) { |
| 1086 | + include( "$IP/wmf-config/PoolCounterSettings.php" ); |
| 1087 | +} |
| 1088 | + |
| 1089 | +wfProfileOut( "$fname-ext-include1" ); |
| 1090 | +wfProfileIn( "$fname-misc2" ); |
| 1091 | + |
| 1092 | +/* |
| 1093 | +# Per site additional spam blacklists |
| 1094 | +# -- hashar Sat Jan 6 21:27:21 UTC 2007 |
| 1095 | +switch( $wgDBname ) { |
| 1096 | + 'frwiki': |
| 1097 | +# $wgSpamBlacklistFiles[] = 'http://fr.wikipedia.org/w/index.php?title=<INSERT_TITLE>&action=raw&sb_ver=1'; |
| 1098 | + break; |
| 1099 | + default: |
| 1100 | + |
| 1101 | +} |
| 1102 | +*/ |
| 1103 | + |
| 1104 | +# Upload spam system |
| 1105 | +// SHA-1 hashes of blocked files: |
| 1106 | +# FIXME should check file size too |
| 1107 | +$ubUploadBlacklist = array( |
| 1108 | + // Goatse: |
| 1109 | + 'aebbf277146e497c036937d3c3d6d0cac49a37a8', // 20050901082002!Patoo.jpg |
| 1110 | + // Spam: |
| 1111 | + '7740dab676725bcf6ea58b03b231aa4ec6c7ff34', // Austriaflaggemodern.jpg |
| 1112 | + '1f1c44af6ee4f6e4b6cb48b892e625fa52238bd1', // Nostalgieplattenspielerei.jpg |
| 1113 | + 'e6eb4549756b88e2c69171ffbd278be51c3e2bfe', // Patioboy.jpg |
| 1114 | + 'eeb9b16edb9b5e9c58f47a558589e7eb970f32c0', // Shoessss.jpg, 73464736474847367.jpg |
| 1115 | + '14e4858e63b008a7e087f2b90d3f57c021ab0f78', // Vacuumbigmell.jpg |
| 1116 | + 'f989e303ef505c4706db42d5cdad67841042e2b9', // 998_pre_1.jpg |
| 1117 | + // Ass pus: |
| 1118 | + '27979159b13b819d1bf62e1071a0c2a54b373ed5', // Squish.png |
| 1119 | + '7176aeddf3d7d8aada785721773ffeb7ee7b292e', // 20050905221505!Linguistics_stub.png * |
| 1120 | + '27979159b13b819d1bf62e1071a0c2a54b373ed5', // 20050905235133!Leaf.png |
| 1121 | + 'bb3acc61413ef813453a4b0c0198e30b2cd8fcf9', // Kitty100.jpg |
| 1122 | + '855e55c4925644aeaef262ef25dd00815761c076', // Wikipedia-logo-100px |
| 1123 | + '203bc24e5291e543779201734c49cfd88fcb2445', // Wikipodia-logo.png |
| 1124 | + '14d2a0c0f3081815d04493f72ab5970c51422bc7', // Bung.jpg |
| 1125 | + '3c610bc87d0ba49467c6f2d3cfba4b3321f6b351', // Blue_morpho_butterfly_300x271.png |
| 1126 | + '7176aeddf3d7d8aada785721773ffeb7ee7b292e', // 20050905235450!Blue_morpho_butterfly_300x271.png |
| 1127 | + '7a7f9d7ef52ed8967cb6b0171ef8d45e2a0c68b9', // Leaf.png |
| 1128 | + '1ecfaf883c4130e1827290ad063158d0037631e6', // Wikimedia-button1.png |
| 1129 | + '1c73d6596685175a8af6b08508468252c4dff8e2', // Windbuchencom.jpg |
| 1130 | + '203bc24e5291e543779201734c49cfd88fcb2445', // Leaf.png |
| 1131 | + '95d825bcf01ca3e553f4175dd7238ff12ba1d153', // 20050915055251!New_Orleans_Survivor_Flyover.jpg |
| 1132 | + 'bbd292d917d7fa7dec9a524de77ca39bd8cdf738', // 20050915060435!New_Orleans_Survivor_Flyover.jpg |
| 1133 | + |
| 1134 | + // Some singnet guy |
| 1135 | + 'bed74eef04f5b54884dc650679e5688c7c1f74cb', // Peniscut.jpg |
| 1136 | + ); |
| 1137 | + |
| 1138 | + |
| 1139 | +if( file_exists( '/usr/bin/ploticus' ) ) { |
| 1140 | + $wgTimelineSettings->ploticusCommand = '/usr/bin/ploticus'; |
| 1141 | +} else { |
| 1142 | + // Back-compat for Fedora boxes |
| 1143 | + $wgTimelineSettings->ploticusCommand = '/usr/local/bin/pl'; |
| 1144 | +} |
| 1145 | +$wgTimelineSettings->epochTimestamp = '20110206135500'; // fixed font setting |
| 1146 | +putenv("GDFONTPATH=/usr/local/apache/common/fonts"); |
| 1147 | + |
| 1148 | +$wgAllowRealName = false; |
| 1149 | +$wgSysopRangeBans = true; |
| 1150 | +$wgSysopUserBans = true; |
| 1151 | + |
| 1152 | + |
| 1153 | +#### To declare an outage: |
| 1154 | +#include("outage.php"); |
| 1155 | +#declareOutage( "2005-01-03", "04:00", "08:00" ); |
| 1156 | + |
| 1157 | +# Log IP addresses in the recentchanges table |
| 1158 | +$wgPutIPinRC = true; |
| 1159 | + |
| 1160 | +$wgUploadSizeWarning = false; |
| 1161 | + |
| 1162 | +# Default address gets rejected by some mail hosts |
| 1163 | +$wgPasswordSender = 'wiki@wikimedia.org'; |
| 1164 | + |
| 1165 | +$wgLocalFileRepo = array( |
| 1166 | + 'class' => 'LocalRepo', |
| 1167 | + 'name' => 'local', |
| 1168 | + 'directory' => $wgUploadDirectory, |
| 1169 | + 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath, |
| 1170 | + 'hashLevels' => 2, |
| 1171 | + 'thumbScriptUrl' => $wgThumbnailScriptPath, |
| 1172 | + 'transformVia404' => true, |
| 1173 | + 'initialCapital' => $wgCapitalLinks, |
| 1174 | + 'deletedDir' => "/mnt/upload6/private/archive/$site/$lang", |
| 1175 | + 'deletedHashLevels' => 3, |
| 1176 | + 'thumbDir' => str_replace( '/mnt/upload6', '/mnt/thumbs', "$wgUploadDirectory/thumb" ), |
| 1177 | + ); |
| 1178 | +# New commons settings |
| 1179 | +if( $wgDBname != 'commonswiki' ) { |
| 1180 | + $wgForeignFileRepos[] = array( |
| 1181 | + 'class' => 'ForeignDBViaLBRepo', |
| 1182 | + 'name' => 'shared', |
| 1183 | + 'directory' => '/mnt/upload6/wikipedia/commons', |
| 1184 | + 'url' => 'http://upload.wikimedia.org/wikipedia/commons', |
| 1185 | + 'hashLevels' => 2, |
| 1186 | + 'thumbScriptUrl' => false, |
| 1187 | + 'transformVia404' => true, |
| 1188 | + 'hasSharedCache' => true, |
| 1189 | + 'descBaseUrl' => 'http://commons.wikimedia.org/wiki/File:', |
| 1190 | + 'scriptDirUrl' => 'http://commons.wikimedia.org/w', |
| 1191 | + 'fetchDescription' => true, |
| 1192 | + 'wiki' => 'commonswiki', |
| 1193 | + 'initialCapital' => true, |
| 1194 | + ); |
| 1195 | + $wgDefaultUserOptions['watchcreations'] = 1; |
| 1196 | +} |
| 1197 | + |
| 1198 | +if($wgDBname == 'nostalgiawiki') { |
| 1199 | + # Link back to current version from the archive funhouse |
| 1200 | + if( ( isset( $_REQUEST['title'] ) && ( $title = $_REQUEST['title'] ) ) |
| 1201 | + || (isset( $_SERVER['PATH_INFO'] ) && ( $title = substr( $_SERVER['PATH_INFO'], 1 ) ) ) ) { |
| 1202 | + if( preg_match( '/^(.*)\\/Talk$/', $title, $matches ) ) { |
| 1203 | + $title = 'Talk:' . $matches[1]; |
| 1204 | + } |
| 1205 | + $wgSiteNotice = '[http://en.wikipedia.org/wiki/' . |
| 1206 | + htmlspecialchars( urlencode( $title ) ) . |
| 1207 | + ' See the current version of this page on Wikipedia]'; |
| 1208 | + } else { |
| 1209 | + $wgSiteNotice = '[http://en.wikipedia.org/ See current Wikipedia]'; |
| 1210 | + } |
| 1211 | + $wgDefaultUserOptions['highlightbroken'] = 0; |
| 1212 | +} |
| 1213 | + |
| 1214 | +$wgUseHashTable = true; |
| 1215 | + |
| 1216 | +$wgCopyrightIcon = '<a href="http://wikimediafoundation.org/"><img src="http://bits.wikimedia.org/images/wikimedia-button.png" width="88" height="31" alt="Wikimedia Foundation"/></a>'; |
| 1217 | + |
| 1218 | +# For Special:Cite, we only want it on wikipedia (but can't count on $site), |
| 1219 | +# not on these fakers. |
| 1220 | +$wgLanguageCodeReal = $wgLanguageCode; |
| 1221 | +# Fake it up |
| 1222 | +if( $wgLanguageCode == 'commons' || |
| 1223 | + $wgLanguageCode == 'meta' || |
| 1224 | + $wgLanguageCode == 'sources' || |
| 1225 | + $wgLanguageCode == 'species' || |
| 1226 | + $wgLanguageCode == 'foundation' || |
| 1227 | + $wgLanguageCode == 'nostalgia' || |
| 1228 | + $wgLanguageCode == 'mediawiki' |
| 1229 | + ) { |
| 1230 | + $wgLanguageCode = 'en'; |
| 1231 | +} |
| 1232 | + |
| 1233 | +# :SEARCH: |
| 1234 | +$wgUseLuceneSearch = true; |
| 1235 | + |
| 1236 | +# Proposed emergency optimisation -- TS |
| 1237 | +/* |
| 1238 | +if ( time() < 1234195258 ) { |
| 1239 | + $wgUseLuceneSearch = false; |
| 1240 | +}*/ |
| 1241 | + |
| 1242 | +wfProfileOut( "$fname-misc2" ); |
| 1243 | + |
| 1244 | + |
| 1245 | +if( $wgUseLuceneSearch ) { |
| 1246 | + wfProfileIn( "$fname-lucene" ); |
| 1247 | + include( $IP.'/wmf-config/lucene.php' ); |
| 1248 | + wfProfileOut( "$fname-lucene" ); |
| 1249 | +} |
| 1250 | + |
| 1251 | +// Case-insensitive title prefix search extension |
| 1252 | +// Load this _after_ Lucene so Lucene's prefix search can be used |
| 1253 | +// when available (for OpenSearch suggestions and AJAX search mode) |
| 1254 | +// But note we still need TitleKey for "go" exact matches and similar. |
| 1255 | +if( $wmgUseTitleKey ) { |
| 1256 | + include "$IP/extensions/TitleKey/TitleKey.php"; |
| 1257 | +} |
| 1258 | + |
| 1259 | +wfProfileIn( "$fname-misc3" ); |
| 1260 | + |
| 1261 | +$wgUseDumbLinkUpdate = false; |
| 1262 | +$wgAntiLockFlags = ALF_NO_LINK_LOCK | ALF_NO_BLOCK_LOCK; |
| 1263 | +# had been using |
| 1264 | +#$wgUseDumbLinkUpdate = true; |
| 1265 | +#$wgAntiLockFlags = ALF_PRELOAD_LINKS | ALF_PRELOAD_EXISTENCE; |
| 1266 | + |
| 1267 | +#$wgSquidFastPurge = true; |
| 1268 | +# Deferred update still broken |
| 1269 | +$wgMaxSquidPurgeTitles = 500; |
| 1270 | + |
| 1271 | +$wgInvalidateCacheOnLocalSettingsChange = false; |
| 1272 | + |
| 1273 | +// General Cache Epoch: |
| 1274 | +$wgCacheEpoch = '20060419151500'; # broken thumbnails due to power failure |
| 1275 | + |
| 1276 | +// Entries olders than the general wgCacheEpoch |
| 1277 | +#if( $lang == 'sr' ) $wgCacheEpoch = '20060311075933'; # watch/unwatch title corruption |
| 1278 | +#if( $wgDBname == 'frwikiquote' ) $wgCacheEpoch = '20060331191924'; # cleaned... |
| 1279 | + |
| 1280 | +// Newer entries |
| 1281 | +if( $wgDBname == 'zhwiki' ) $wgCacheEpoch = '20060528093500'; # parser bug? |
| 1282 | +if( $wgDBname == 'lawikibooks' ) $wgCacheEpoch = '20060610090000'; # sidebar bug |
| 1283 | + |
| 1284 | +#$wgThumbnailEpoch = '20060227114700'; # various rsvg and imagemagick fixes |
| 1285 | +$wgThumbnailEpoch = '20051227114700'; # various rsvg and imagemagick fixes |
| 1286 | + |
| 1287 | +# OAI repository for update server |
| 1288 | +include( $IP.'/extensions/OAI/OAIRepo.php' ); |
| 1289 | +$oaiAgentRegex = '/experimental/'; |
| 1290 | +$oaiAuth = true; # broken... squid? php config? wtf |
| 1291 | +$oaiAudit = true; |
| 1292 | +$oaiAuditDatabase = 'oai'; |
| 1293 | +$wgDebugLogGroups['oai'] = 'udp://10.0.5.8:8420/oai'; |
| 1294 | + |
| 1295 | +$wgEnableUserEmail = true; |
| 1296 | + |
| 1297 | +# XFF log for vandal tracking |
| 1298 | +function wfLogXFF() { |
| 1299 | + if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { |
| 1300 | + $uri = ( $_SERVER['HTTPS'] ? 'https://' : 'http://' ) . |
| 1301 | + $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
| 1302 | + wfErrorLog( |
| 1303 | + gmdate('r') . "\t" . |
| 1304 | + "$uri\t" . |
| 1305 | + "{$_SERVER['HTTP_X_FORWARDED_FOR']}, {$_SERVER['REMOTE_ADDR']}\t" . |
| 1306 | + ($_REQUEST['wpSave'] ? 'save' : '') . "\n", |
| 1307 | + 'udp://10.0.5.8:8420/xff' ); |
| 1308 | + } |
| 1309 | +} |
| 1310 | +$wgExtensionFunctions[] = 'wfLogXFF'; |
| 1311 | + |
| 1312 | +wfProfileOut( "$fname-misc3" ); |
| 1313 | +wfProfileIn( "$fname-ext-include2" ); |
| 1314 | + |
| 1315 | +# Experimental category intersection plugin. |
| 1316 | +# Enabling on an exerimental basis for Wikinews only, |
| 1317 | +# 2005-03-30 brion |
| 1318 | +#if( $site == 'wikinews' || $site == 'wikiquote' || |
| 1319 | +# $wgDBname == 'metawiki' || |
| 1320 | +# $wgDBname == 'enwiktionary' || $wgDBname == 'dewiktionary' || |
| 1321 | +# $site == 'wikibooks' || |
| 1322 | +# $wgDBname == 'srwiki' ) { |
| 1323 | +if( $wmgUseDPL ) { |
| 1324 | + include( $IP.'/extensions/intersection/DynamicPageList.php' ); |
| 1325 | +} |
| 1326 | + |
| 1327 | +# 2005-10-12 -ævar |
| 1328 | +# 2010-01-22 hashar: disabled as per 16878 |
| 1329 | +//include( $IP.'/extensions/CrossNamespaceLinks/SpecialCrossNamespaceLinks.php' ); |
| 1330 | + |
| 1331 | +#if ( $wgDBname == 'frwiki' || $wgDBname == 'testwiki' || $wgDBname == 'dewiki' ) { |
| 1332 | +# include( $IP.'/BoardVoteInit.php' ); |
| 1333 | +#} |
| 1334 | + |
| 1335 | +include( $IP.'/extensions/Renameuser/SpecialRenameuser.php' ); |
| 1336 | + |
| 1337 | +#if( $wgDBname == 'metawiki' || $wgDBname == 'mediawikiwiki' || $wgDBname == 'chrwiki' || $wgDBname == 'pdcwiki' ) { |
| 1338 | +if ( $wmgUseSpecialNuke ) { |
| 1339 | + // TODO: Update path |
| 1340 | + include( $IP.'/extensions/Nuke/SpecialNuke.php' ); |
| 1341 | +} |
| 1342 | + |
| 1343 | +include( "$IP/extensions/AntiBot/AntiBot.php" ); |
| 1344 | +$wgAntiBotPayloads = array( |
| 1345 | + 'default' => array( 'log', 'fail' ), |
| 1346 | +); |
| 1347 | + |
| 1348 | +include( "$IP/extensions/TorBlock/TorBlock.php" ); |
| 1349 | +$wgTorLoadNodes = false; |
| 1350 | +$wgTorIPs = array( '91.198.174.2', '208.80.152.2', '203.212.189.253' ); |
| 1351 | +$wgTorAutoConfirmAge = 90 * 86400; |
| 1352 | +$wgTorAutoConfirmCount = 100; |
| 1353 | +$wgTorDisableAdminBlocks = false; |
| 1354 | +$wgTorTagChanges = false; |
| 1355 | +$wgGroupPermissions['user']['torunblocked'] = false; |
| 1356 | + |
| 1357 | +if ( $wmgUseRSSExtension ) { |
| 1358 | + include( "$IP/extensions/RSS/RSS.php" ); |
| 1359 | + #$wgRSSProxy = 'url-downloader.wikimedia.org:8080'; |
| 1360 | +} |
| 1361 | + |
| 1362 | +wfProfileOut( "$fname-ext-include2" ); |
| 1363 | +wfProfileIn( "$fname-misc4" ); |
| 1364 | + |
| 1365 | +# 2005-09-30: Disabled for potential XSS issue -ævar |
| 1366 | +#include 'extensions/PageCSS/PageCSS.php'; |
| 1367 | + |
| 1368 | +$wgDisabledActions = array( 'credits' ); |
| 1369 | +# $wgDisableHardRedirects = true; // moved to InitializeSettings.php |
| 1370 | + |
| 1371 | +# category rss feed extension, sponsored by kennisnet |
| 1372 | +#include("extensions/catfeed/catfeed.php"); |
| 1373 | +# why is there, AGAIN, no explanation of safety or limitation to known places? |
| 1374 | + |
| 1375 | + |
| 1376 | +# Process group overrides |
| 1377 | + |
| 1378 | +# makesysop permission removed, https://bugzilla.wikimedia.org/show_bug.cgi?id=23081 |
| 1379 | +# $wgGroupPermissions['steward' ]['makesysop' ] = true; |
| 1380 | +# $wgGroupPermissions['bureaucrat']['makesysop' ] = true; |
| 1381 | + |
| 1382 | +$wgGroupPermissions['steward' ]['userrights'] = true; |
| 1383 | +$wgGroupPermissions['bureaucrat']['userrights'] = false; |
| 1384 | + |
| 1385 | +$wgGroupPermissions['sysop']['bigdelete'] = false; // quick hack |
| 1386 | + |
| 1387 | +foreach ( $groupOverrides2 as $group => $permissions ) { |
| 1388 | + if ( !array_key_exists( $group, $wgGroupPermissions ) ) { |
| 1389 | + $wgGroupPermissions[$group] = array(); |
| 1390 | + } |
| 1391 | + $wgGroupPermissions[$group] = $permissions + $wgGroupPermissions[$group]; |
| 1392 | +} |
| 1393 | +foreach ( $groupOverrides as $group => $permissions ) { |
| 1394 | + if ( !array_key_exists( $group, $wgGroupPermissions ) ) { |
| 1395 | + $wgGroupPermissions[$group] = array(); |
| 1396 | + } |
| 1397 | + $wgGroupPermissions[$group] = $permissions + $wgGroupPermissions[$group]; |
| 1398 | +} |
| 1399 | + |
| 1400 | +$wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed']; |
| 1401 | +$wgGroupPermissions['confirmed']['skipcaptcha'] = true; |
| 1402 | + |
| 1403 | +$wgAutopromote = array( |
| 1404 | + 'autoconfirmed' => array( '&', |
| 1405 | + array( APCOND_EDITCOUNT, $wgAutoConfirmCount ), |
| 1406 | + array( APCOND_AGE, $wgAutoConfirmAge ), |
| 1407 | + ), |
| 1408 | +); |
| 1409 | + |
| 1410 | +if ( is_array( $wmgAutopromoteExtraGroups ) ) { |
| 1411 | + $wgAutopromote += $wmgAutopromoteExtraGroups; |
| 1412 | +} |
| 1413 | + |
| 1414 | +if ( is_array( $wmgExtraImplicitGroups ) ) { |
| 1415 | + $wgImplicitGroups = array_merge( $wgImplicitGroups, $wmgExtraImplicitGroups ); |
| 1416 | +} |
| 1417 | + |
| 1418 | +$wgLegacySchemaConversion = true; |
| 1419 | + |
| 1420 | +#$wgReadOnly = '5 min DB server maintenance...'; |
| 1421 | +#$wgReadOnly = 'Read-only during network issues'; |
| 1422 | + |
| 1423 | +# fcache stuff -kate |
| 1424 | +#$fcuse = array("metawiki"); |
| 1425 | +#if (in_array($wgDBname, $fcuse) && file_exists('/mnt/fcache/fcache_is_mounted')) { |
| 1426 | +# $wgUseFileCache = true; |
| 1427 | +# /** Directory where the cached page will be saved */ |
| 1428 | +# $wgFileCacheDirectory = "/mnt/fcache/$wgDBname/"; |
| 1429 | +#} |
| 1430 | + |
| 1431 | +if ( $cluster != 'pmtpa' ) { |
| 1432 | + $wgHTTPTimeout = 10; |
| 1433 | +} |
| 1434 | + |
| 1435 | +/* |
| 1436 | +if( //isset( $_POST['action'] ) && |
| 1437 | + isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && |
| 1438 | + strpos( $_SERVER['HTTP_X_FORWARDED_FOR'], '208.63.189.57' ) !== false ) { |
| 1439 | + $wgDebugLogFile = "udp://10.0.5.8:8420/broken-editors"; |
| 1440 | + $wgDebugDumpSql = true; |
| 1441 | + foreach( $wgDBservers as $key => $x ) { |
| 1442 | + $wgDBservers[$key]['flags'] |= DBO_DEBUG; |
| 1443 | + } |
| 1444 | +} |
| 1445 | +*/ |
| 1446 | +/* |
| 1447 | +if ( $wgDBname == 'enwiki' ) { |
| 1448 | + require( "$IP/extensions/CookieBlock/CookieBlock.php" ); |
| 1449 | + |
| 1450 | + $wgCookieBlocks = array( |
| 1451 | + # Test -- block Tim on aawiki for a day |
| 1452 | + #'d0e2a4080155d22cc2340e64b9930689' => array( 37, 86400 ), |
| 1453 | + ); |
| 1454 | +}*/ |
| 1455 | + |
| 1456 | +// disabling so we don't worry about xmlrpc |
| 1457 | +// 2006-10-21 |
| 1458 | +#include( $IP.'/extensions/MWBlocker/MWBlockerHook.php' ); |
| 1459 | +#$mwBlockerHost = 'larousse'; |
| 1460 | +#$mwBlockerPort = 8126; |
| 1461 | +##$wgProxyList = array_flip( array_map( 'trim', file( 'udp://10.0.5.8:8420/mwblocker' ) ) ); |
| 1462 | +$wgProxyList = "$IP/wmf-config/mwblocker.log"; |
| 1463 | + |
| 1464 | +if( getenv( 'WIKIDEBUG' ) ) { |
| 1465 | + $wgDebugLogFile = '/tmp/wiki.log'; |
| 1466 | + $wgDebugDumpSql = true; |
| 1467 | + $wgDebugLogGroups = array(); |
| 1468 | + foreach( $wgDBservers as $key => $val ) { |
| 1469 | + $wgDBserver[$key]['flags'] |= 1;//DBO_DEBUG; |
| 1470 | + } |
| 1471 | + foreach( $wgExternalServers as $key => $val ) { |
| 1472 | + foreach( $val as $x => $y ) { |
| 1473 | + $wgExternalServers[$key][$x]['flags'] |= 1;//DBO_DEBUG; |
| 1474 | + } |
| 1475 | + } |
| 1476 | +} |
| 1477 | + |
| 1478 | +wfProfileOut( "$fname-misc4" ); |
| 1479 | +wfProfileIn( "$fname-misc5" ); |
| 1480 | + |
| 1481 | +//$wgDisableSearchContext = true; |
| 1482 | +// Turn off search text extracts for random visitors, put it on |
| 1483 | +// for editors. --brion 2005-11-09 |
| 1484 | +// Turning it back on -- brion 2008-03-12 |
| 1485 | +//$wgDisableSearchContext = !isset($_COOKIE["{$wgDBname}_session"]); |
| 1486 | + |
| 1487 | +$wgBrowserBlackList[] = '/^Lynx/'; |
| 1488 | + |
| 1489 | +// Vandal checks |
| 1490 | +require( $IP.'/wmf-config/checkers.php' ); |
| 1491 | + |
| 1492 | +// Experimental ScanSet extension |
| 1493 | +if ( $wgDBname == 'enwikisource' ) { |
| 1494 | + require( $IP.'/extensions/ScanSet/ScanSet.php' ); |
| 1495 | + $wgScanSetSettings = array( |
| 1496 | + 'baseDirectory' => '/mnt/upload6/wikipedia/commons/scans', |
| 1497 | + 'basePath' => 'http://upload.wikimedia.org/wikipedia/commons/scans', |
| 1498 | + ); |
| 1499 | +} |
| 1500 | + |
| 1501 | +// 2005-11-27 Special:Cite for Wikipedia -Ævar |
| 1502 | +// FIXME: This should really be done with $wmgUseSpecialCite in InitialiseSettings.php |
| 1503 | +if ( ($site == 'wikipedia' && $wgLanguageCodeReal == $wgLanguageCode ) |
| 1504 | + || $site == 'wikisource' |
| 1505 | + || ( $site == 'wikiversity' && $wgLanguageCode == 'en' ) |
| 1506 | + || ( $site == 'wikibooks' && $wgLanguageCode == 'it' ) |
| 1507 | + || ( $site == 'wiktionary' && $wgLanguageCode == 'it' ) ) |
| 1508 | + require( $IP.'/extensions/Cite/SpecialCite.php' ); |
| 1509 | + |
| 1510 | +// Added throttle for account creations on zh due to mass registration attack 2005-12-16 |
| 1511 | +// might be useful elesewhere. --brion |
| 1512 | +// disabled temporarily due to tugela bug -- Tim |
| 1513 | + |
| 1514 | +if( false /*$lang == 'zh' || $lang == 'en'*/ ) { |
| 1515 | + require( "$IP/extensions/UserThrottle/UserThrottle.php" ); |
| 1516 | + $wgGlobalAccountCreationThrottle = array( |
| 1517 | +/* |
| 1518 | + 'min_interval' => 30, // Hard minimum time between creations (default 5) |
| 1519 | + 'soft_time' => 300, // Timeout for rolling count |
| 1520 | + 'soft_limit' => 5, // 5 registrations in five minutes (default 10) |
| 1521 | +*/ |
| 1522 | + 'min_interval' => 0, // Hard minimum time between creations (default 5) |
| 1523 | + 'soft_time' => 60, // Timeout for rolling count (default 5 minutes) |
| 1524 | + 'soft_limit' => 2, // 2 registrations in one minutes (default 10) |
| 1525 | + ); |
| 1526 | +} |
| 1527 | + |
| 1528 | + |
| 1529 | +// Customize URL handling for secure.wikimedia.org HTTPS logins |
| 1530 | +if( $secure ) { |
| 1531 | + require( "$IP/wmf-config/secure.php" ); |
| 1532 | +} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) { |
| 1533 | + // New HTTPS service on regular URLs |
| 1534 | + $wgServer = preg_replace( '/^http:/', 'https:', $wgServer ); |
| 1535 | +} else { |
| 1536 | + # For non-SSL hosts... |
| 1537 | + if( $wgDBname != 'testwiki' ) { |
| 1538 | +# $wgStyleSheetPath = 'http://upload.wikimedia.org/skins'; |
| 1539 | + } |
| 1540 | +} |
| 1541 | + |
| 1542 | +if ( isset( $_REQUEST['captchabypass'] ) && $_REQUEST['captchabypass'] == $wmgCaptchaPassword ) { |
| 1543 | + $wmgEnableCaptcha = false; |
| 1544 | +} |
| 1545 | + |
| 1546 | +if( $wmgEnableCaptcha ) { |
| 1547 | + require( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" ); |
| 1548 | + require( "$IP/extensions/ConfirmEdit/FancyCaptcha.php" ); |
| 1549 | + $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = true; |
| 1550 | +# $wgCaptchaTriggers['edit'] = true; |
| 1551 | + $wgCaptchaSecret = $wmgCaptchaSecret; |
| 1552 | + $wgCaptchaDirectory = '/mnt/upload6/private/captcha'; |
| 1553 | + $wgCaptchaDirectoryLevels = 3; |
| 1554 | + $wgCaptchaStorageClass = 'CaptchaCacheStore'; |
| 1555 | + $wgCaptchaClass = 'FancyCaptcha'; |
| 1556 | + $wgCaptchaWhitelist = '#^https?://([.a-z0-9-]+\\.)?((wikimedia|wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikispecies|mediawiki|wikimediafoundation|wikinews|wikiversity)\.org|dnsstuff\.com|completewhois\.com|wikimedia\.de|toolserver\.org)(/|$)#i'; |
| 1557 | + $wgCaptchaWhitelistIP = array( '91.198.174.0/24' ); # toolserver (bug 23982) |
| 1558 | + $wgDebugLogGroups["captcha"] = "udp://10.0.5.8:8420/captcha"; |
| 1559 | + /** |
| 1560 | + * Possibly a broken spambot, or a spambot being tested before a real run. |
| 1561 | + * Hitting lots of wikis in late June 2006 |
| 1562 | + */ |
| 1563 | + $wgCaptchaRegexes[] = '/\b\d{22,28}\b/'; |
| 1564 | + /** |
| 1565 | + * Somebody's been repeatedly hitting some user talk pages and other arts |
| 1566 | + * with this; February 2007 |
| 1567 | + */ |
| 1568 | + $wgCaptchaRegexes[] = '/\{\{indefblockeduser\}\}/'; |
| 1569 | + // copyvio bot on be.wikipedia |
| 1570 | + if( $lang == 'be' ) { |
| 1571 | + $wgCaptchaRegexes[] = '/\[\[Катэгорыя:Архітэктура\]\]/'; |
| 1572 | + } |
| 1573 | + if ( $wgDBname == 'testwiki' ) { |
| 1574 | + $wgCaptchaTriggers['create'] = true; |
| 1575 | + } |
| 1576 | + // Mystery proxy bot |
| 1577 | + // http://en.wikipedia.org/w/index.php?title=Killamanjaro&diff=prev&oldid=168037317 |
| 1578 | + $wgCaptchaRegexes[] = '/^[a-z0-9]{5,}$/m'; |
| 1579 | + |
| 1580 | + // 'XRumer' spambot |
| 1581 | + // adds non-real links |
| 1582 | + // http://meta.wikimedia.org/wiki/User:Cometstyles/XRumer |
| 1583 | + // http://meta.wikimedia.org/wiki/User:Jorunn/tracks |
| 1584 | + // (added 2008-05-08 -- brion) |
| 1585 | + $wgCaptchaRegexes[] = '/<a +href/i'; |
| 1586 | + |
| 1587 | + // https://bugzilla.wikimedia.org/show_bug.cgi?id=14544 |
| 1588 | + // 2008-07-05 |
| 1589 | + $wgCaptchaRegexes[] = '/\b(?i:anontalk\.com)\b/'; |
| 1590 | + |
| 1591 | + // For emergencies |
| 1592 | + if( $wmgEmergencyCaptcha ) { |
| 1593 | + $wgCaptchaTriggers['edit'] = true; |
| 1594 | + $wgCaptchaTriggers['create'] = true; |
| 1595 | + } |
| 1596 | +} |
| 1597 | + |
| 1598 | + |
| 1599 | + |
| 1600 | +require( "$IP/extensions/Oversight/HideRevision.php" ); |
| 1601 | +$wgGroupPermissions['oversight']['hiderevision'] = true; |
| 1602 | +$wgGroupPermissions['oversight']['oversight'] = true; |
| 1603 | + |
| 1604 | +if ( extension_loaded( 'wikidiff2' ) ) { |
| 1605 | + $wgExternalDiffEngine = 'wikidiff2'; |
| 1606 | +} |
| 1607 | + |
| 1608 | +if( function_exists( 'dba_open' ) && file_exists( "$IP/cache/interwiki.cdb" ) ) { |
| 1609 | + $wgInterwikiCache = "$IP/cache/interwiki.cdb"; |
| 1610 | +} |
| 1611 | + |
| 1612 | +$wgDebugLogGroups["ExternalStoreDB"] = "udp://10.0.5.8:8420/external"; |
| 1613 | + |
| 1614 | +#if( $wgDBname == 'frwikiquote' || |
| 1615 | +if( $wgDBname == 'sep11wiki' ) { |
| 1616 | + $wgSiteNotice = @file_get_contents( $wgReadOnlyFile ); |
| 1617 | +} |
| 1618 | + |
| 1619 | +// Enable enotif for user talk if it's on for watchlist. |
| 1620 | +if( $wgEnotifWatchlist ) { |
| 1621 | + $wgEnotifUserTalk = true; |
| 1622 | +} else { |
| 1623 | + $wgShowUpdatedMarker = false; // not working right ? |
| 1624 | +} |
| 1625 | + |
| 1626 | +# testing enotif via job queue, river 2007-05-10 |
| 1627 | +# turning this off since it's currently so lagged it's horrible -- brion 2009-01-20 |
| 1628 | +# turning back on while investigating other probs |
| 1629 | +$wgEnotifUseJobQ = true; |
| 1630 | + |
| 1631 | +// Quick hack for Makesysop vs enwiki |
| 1632 | +// (Slightly slower hack now [TS]) |
| 1633 | +if ( isset( $sectionLoads ) ) { |
| 1634 | + $wgAlternateMaster = array( 'DEFAULT' => $dbHostsByName[key( $sectionLoads['DEFAULT'] )] ); |
| 1635 | + foreach ( $sectionsByDB as $db => $section ) { |
| 1636 | + $wgAlternateMaster[$db] = $dbHostsByName[key( $sectionLoads[$section] )]; |
| 1637 | + } |
| 1638 | +} |
| 1639 | + |
| 1640 | +$wgDebugLogGroups["query"] = "udp://10.0.5.8:8420/botquery"; |
| 1641 | + |
| 1642 | +// Username spoofing / mixed-script / similarity check detection |
| 1643 | +include $IP . '/extensions/AntiSpoof/AntiSpoof.php'; |
| 1644 | +//$wgAntiSpoofAccounts = false; // log only for now |
| 1645 | +$wgDebugLogGroups['antispoof'] = 'udp://10.0.5.8:8420/antispoof'; |
| 1646 | + |
| 1647 | +// For transwiki import |
| 1648 | +ini_set( 'user_agent', 'Wikimedia internal server fetcher (noc@wikimedia.org' ); |
| 1649 | + |
| 1650 | +// CentralAuth |
| 1651 | +if ( $wmgUseCentralAuth ) { |
| 1652 | + include "$IP/extensions/CentralAuth/CentralAuth.php"; |
| 1653 | + $wgCentralAuthDryRun = false; |
| 1654 | + #unset( $wgGroupPermissions['*']['centralauth-merge'] ); |
| 1655 | + #$wgGroupPermissions['sysop']['centralauth-merge'] = true; |
| 1656 | + $wgCentralAuthCookies = true; |
| 1657 | + |
| 1658 | + # Broken -- TS |
| 1659 | + $wgCentralAuthUDPAddress = $wgRC2UDPAddress; |
| 1660 | + $wgCentralAuthNew2UDPPrefix = "#central\t"; |
| 1661 | + |
| 1662 | + # Determine second-level domain |
| 1663 | + if ( preg_match( '/^\w+\.\w+\./', strrev( $wgServer ), $m ) ) { |
| 1664 | + $wmgSecondLevelDomain = strrev( $m[0] ); |
| 1665 | + } else { |
| 1666 | + $wmgSecondLevelDomain = false; |
| 1667 | + } |
| 1668 | + $wgCentralAuthAutoLoginWikis = array( |
| 1669 | + '.wikipedia.org' => 'enwiki', |
| 1670 | + 'meta.wikimedia.org' => 'metawiki', |
| 1671 | + '.wiktionary.org' => 'enwiktionary', |
| 1672 | + '.wikibooks.org' => 'enwikibooks', |
| 1673 | + '.wikiquote.org' => 'enwikiquote', |
| 1674 | + '.wikisource.org' => 'enwikisource', |
| 1675 | + 'commons.wikimedia.org' => 'commonswiki', |
| 1676 | + '.wikinews.org' => 'enwikinews', |
| 1677 | + '.wikiversity.org' => 'enwikiversity', |
| 1678 | + '.mediawiki.org' => 'mediawikiwiki', |
| 1679 | + 'species.wikimedia.org' => 'specieswiki', |
| 1680 | + ); |
| 1681 | + # Don't autologin to self |
| 1682 | + if ( isset( $wgCentralAuthAutoLoginWikis[$wmgSecondLevelDomain] ) ) { |
| 1683 | + unset( $wgCentralAuthAutoLoginWikis[$wmgSecondLevelDomain] ); |
| 1684 | + $wgCentralAuthCookieDomain = $wmgSecondLevelDomain; |
| 1685 | + } elseif ( $wgDBname == 'commonswiki' ) { |
| 1686 | + unset( $wgCentralAuthAutoLoginWikis['commons.wikimedia.org'] ); |
| 1687 | + $wgCentralAuthCookieDomain = 'commons.wikimedia.org'; |
| 1688 | + } elseif ( $wgDBname == 'metawiki' ) { |
| 1689 | + unset( $wgCentralAuthAutoLoginWikis['meta.wikimedia.org'] ); |
| 1690 | + $wgCentralAuthCookieDomain = 'meta.wikimedia.org'; |
| 1691 | + } else { |
| 1692 | + # Don't set 2nd-level cookies for *.wikimedia.org, insecure |
| 1693 | + $wgCentralAuthCookieDomain = ''; |
| 1694 | + } |
| 1695 | + $wgCentralAuthLoginIcon = $wmgCentralAuthLoginIcon; |
| 1696 | + $wgCentralAuthAutoNew = true; |
| 1697 | + |
| 1698 | + $wgHooks['CentralAuthWikiList'][] = 'wmfCentralAuthWikiList'; |
| 1699 | + function wmfCentralAuthWikiList( &$list ) { |
| 1700 | + global $wgLocalDatabases, $IP; |
| 1701 | + $privateWikis = array_map( 'trim', file( "$IP/../private.dblist" ) ); |
| 1702 | + $fishbowlWikis = array_map( 'trim', file( "$IP/../fishbowl.dblist" ) ); |
| 1703 | + $closedWikis = array_map( 'trim', file( "$IP/../closed.dblist" ) ); |
| 1704 | + $list = array_diff( $wgLocalDatabases, |
| 1705 | + $privateWikis, $fishbowlWikis, $closedWikis ); |
| 1706 | + return true; |
| 1707 | + } |
| 1708 | + |
| 1709 | + // Let's give it another try |
| 1710 | + $wgCentralAuthCreateOnView = true; |
| 1711 | + |
| 1712 | + // Enable global sessions for secure.wikimedia.org |
| 1713 | + if( $secure ) { |
| 1714 | + $wgCentralAuthCookies = true; |
| 1715 | + $wgCentralAuthCookieDomain = 'secure.wikimedia.org'; |
| 1716 | + |
| 1717 | + $wgCentralAuthCookiePrefix = 'centralauth_'; |
| 1718 | + |
| 1719 | + // Don't log in to the insecure URLs |
| 1720 | + $wgCentralAuthAutoLoginWikis = array(); |
| 1721 | + } |
| 1722 | +} |
| 1723 | + |
| 1724 | +# Dismissable site notice demo |
| 1725 | +//if ( $wgDBname == 'testwiki' ) { |
| 1726 | +// require( "$IP/sitenotice.php" ); |
| 1727 | +//} |
| 1728 | + |
| 1729 | +// taking it live 2006-12-15 brion |
| 1730 | +if( $wmgUseDismissableSiteNotice ) { |
| 1731 | + require( "$IP/extensions/DismissableSiteNotice/DismissableSiteNotice.php" ); |
| 1732 | +} |
| 1733 | +$wgMajorSiteNoticeID = '2'; |
| 1734 | + |
| 1735 | +#$wgSiteNotice = "<span class=\"ltr\">All community members are invited to give [[m:Board elections/2007/Candidates|Board Election Candidates]] their [[m:Board elections/2007/Endorsements|endorsements]].</span>"; |
| 1736 | + |
| 1737 | + |
| 1738 | +//require( "$IP/extensions/UsernameBlacklist/UsernameBlacklist.php" ); //Removed per bug 15888 |
| 1739 | + |
| 1740 | +/* |
| 1741 | +function wfInitDonationLinkMessage() { |
| 1742 | + global $wgMessageCache; |
| 1743 | + $wgMessageCache->addMessage( 'sitenotice_link', '[http://wikimediafoundation.org/wiki/Wikimedia_thanks_Virgin_Unite Virgin Unite]' ); |
| 1744 | +} |
| 1745 | +$wgExtensionFunctions[] = 'wfInitDonationLinkMessage'; |
| 1746 | + |
| 1747 | +*/ |
| 1748 | + |
| 1749 | +$wgHooks['LoginAuthenticateAudit'][] = 'logBadPassword'; |
| 1750 | +$wgDebugLogGroups['badpass'] = 'udp://10.0.5.8:8420/badpass'; |
| 1751 | +$wgDebugLogGroups['ts_badpass'] = 'udp://10.0.5.8:8420/ts_badpass'; |
| 1752 | +$wgHooks['PrefsEmailAudit'][] = 'logPrefsEmail'; |
| 1753 | +$wgHooks['PrefsPasswordAudit'][] = 'logPrefsPassword'; |
| 1754 | + |
| 1755 | +function logBadPassword( $user, $pass, $retval ) { |
| 1756 | + $headers = apache_request_headers(); |
| 1757 | + |
| 1758 | + if( $user->isAllowed( 'delete' ) && $retval != LoginForm::SUCCESS ) { |
| 1759 | + switch( $retval ) { |
| 1760 | + case LoginForm::WRONG_PASS: |
| 1761 | + case LoginForm::EMPTY_PASS: |
| 1762 | + $bit = 'Bad login attempt'; |
| 1763 | + break; |
| 1764 | + case LoginForm::RESET_PASS: |
| 1765 | + $bit = 'Login with temporary password'; |
| 1766 | + break; |
| 1767 | + default: |
| 1768 | + $bit = '???'; |
| 1769 | + } |
| 1770 | + |
| 1771 | + wfDebugLog( 'badpass', "$bit for sysop '" . |
| 1772 | + $user->getName() . "' from " . wfGetIP() . |
| 1773 | + #" - " . serialize( apache_request_headers() ) |
| 1774 | + " - " . @$headers['X-Forwarded-For'] . |
| 1775 | + ' - ' . @$headers['User-Agent'] . |
| 1776 | + '' |
| 1777 | + ); |
| 1778 | + } |
| 1779 | + |
| 1780 | + # Looking for broken bot on toolserver -river 2007-10-13 |
| 1781 | + if ($retval != LoginForm::SUCCESS |
| 1782 | + && @strpos(@$headers['X-Forwarded-For'], "91.198.174.201") !== false) |
| 1783 | + { |
| 1784 | + wfDebugLog('ts_badpass', "bad login for '" . $user->getName() . "' - " |
| 1785 | + . @$headers['User-Agent']); |
| 1786 | + } |
| 1787 | + |
| 1788 | + return true; |
| 1789 | +} |
| 1790 | + |
| 1791 | +function logPrefsEmail( $user, $old, $new ) { |
| 1792 | + if( $user->isAllowed( 'delete' ) ) { |
| 1793 | + $headers = apache_request_headers(); |
| 1794 | + wfDebugLog( 'badpass', "Email changed in prefs for sysop '" . |
| 1795 | + $user->getName() . |
| 1796 | + "' from '$old' to '$new'" . |
| 1797 | + " - " . wfGetIP() . |
| 1798 | + #" - " . serialize( apache_request_headers() ) |
| 1799 | + " - " . @$headers['X-Forwarded-For'] . |
| 1800 | + ' - ' . @$headers['User-Agent'] . |
| 1801 | + ''); |
| 1802 | + } |
| 1803 | + return true; |
| 1804 | +} |
| 1805 | + |
| 1806 | +function logPrefsPassword( $user, $pass, $status ) { |
| 1807 | + if( $user->isAllowed( 'delete' ) ) { |
| 1808 | + $headers = apache_request_headers(); |
| 1809 | + wfDebugLog( 'badpass', "Password change in prefs for sysop '" . |
| 1810 | + $user->getName() . |
| 1811 | + "': $status" . |
| 1812 | + " - " . wfGetIP() . |
| 1813 | + #" - " . serialize( apache_request_headers() ) |
| 1814 | + " - " . @$headers['X-Forwarded-For'] . |
| 1815 | + ' - ' . @$headers['User-Agent'] . |
| 1816 | + ''); |
| 1817 | + } |
| 1818 | + return true; |
| 1819 | +} |
| 1820 | + |
| 1821 | +if ( file_exists( '/etc/wikimedia-image-scaler' ) ) { |
| 1822 | + $wgMaxShellMemory = 300000; // temp was 200M |
| 1823 | +} |
| 1824 | +$wgMaxShellTime = 50; // so it times out before PHP and curl and squid |
| 1825 | +$wgImageMagickTempDir = '/a/magick-tmp'; |
| 1826 | + |
| 1827 | +// Re-enable GIF scaling --catrope 2010-01-04 |
| 1828 | +// Disabled again, apparently thumbnailed GIFs above the limits have only one frame, |
| 1829 | +// should be unthumbnailed instead -- Andrew 2010-01-13 |
| 1830 | +// Retrying with wgMaxAnimatedGifArea back at a sensible value. Andrew 2010-04-06 |
| 1831 | +// if ( $wgDBname != 'testwiki' ) { |
| 1832 | +// $wgMediaHandlers['image/gif'] = 'BitmapHandler_ClientOnly'; |
| 1833 | +// } |
| 1834 | + |
| 1835 | + |
| 1836 | +// Banner notice system |
| 1837 | +if( $wmgUseCentralNotice ) { |
| 1838 | + include "$IP/extensions/CentralNotice/CentralNotice.php"; |
| 1839 | + |
| 1840 | + // new settings for secure server support |
| 1841 | + if( $secure ) { |
| 1842 | + # Don't load the JS from an insecure source! |
| 1843 | + $wgCentralPagePath = 'https://secure.wikimedia.org/wikipedia/meta/w/index.php'; |
| 1844 | + } else { |
| 1845 | + $wgCentralPagePath = 'http://meta.wikimedia.org/w/index.php'; |
| 1846 | + } |
| 1847 | + |
| 1848 | + $wgNoticeProject = $wmgNoticeProject; |
| 1849 | + $wgCentralDBname = 'metawiki'; |
| 1850 | + |
| 1851 | + $wgCentralNoticeLoader = $wmgCentralNoticeLoader; |
| 1852 | + |
| 1853 | + |
| 1854 | + /* |
| 1855 | + $wgNoticeTestMode = true; |
| 1856 | + $wgNoticeEnabledSites = array( |
| 1857 | + 'test.wikipedia', |
| 1858 | + 'en.wikipedia', // sigh |
| 1859 | + 'en.*', |
| 1860 | + 'meta.*', |
| 1861 | + 'commons.*', |
| 1862 | + # Wednesday |
| 1863 | + 'af.*', |
| 1864 | + 'ca.*', |
| 1865 | + 'de.*', |
| 1866 | + 'fr.*', |
| 1867 | + 'ja.*', |
| 1868 | + 'ru.*', |
| 1869 | + 'sv.*', |
| 1870 | + 'zh.*', |
| 1871 | + 'zh-yue.*', |
| 1872 | + ); |
| 1873 | + */ |
| 1874 | + |
| 1875 | + # Wed evening -- all on! |
| 1876 | + $wgNoticeTimeout = 3600; |
| 1877 | + $wgNoticeServerTimeout = 3600; // to let the counter update |
| 1878 | + $wgNoticeCounterSource = 'http://wikimediafoundation.org/wiki/Special:ContributionTotal' . |
| 1879 | + '?action=raw' . |
| 1880 | + '&start=20101112000000' . // FY 10-11 |
| 1881 | + '&fudgefactor=660000'; // fudge for pledged donations not in CRM |
| 1882 | + |
| 1883 | + if( $wgDBname == 'metawiki' ) { |
| 1884 | + $wgNoticeInfrastructure = true; |
| 1885 | + } else { |
| 1886 | + $wgNoticeInfrastructure = false; |
| 1887 | + } |
| 1888 | +} |
| 1889 | + |
| 1890 | + |
| 1891 | +// Load our site-specific l10n extensions |
| 1892 | +include "$IP/extensions/WikimediaMessages/WikimediaMessages.php"; |
| 1893 | + |
| 1894 | +if ( $wmgUseWikimediaLicenseTexts ) { |
| 1895 | + include "$IP/extensions/WikimediaMessages/WikimediaLicenseTexts.php"; |
| 1896 | +} |
| 1897 | + |
| 1898 | + |
| 1899 | +function wfNoDeleteMainPage( &$title, &$user, $action, &$result ) { |
| 1900 | + global $wgMessageCache, $wgDBname; |
| 1901 | + if ( $action !== 'delete' && $action !== 'move' ) { |
| 1902 | + return true; |
| 1903 | + } |
| 1904 | + $main = Title::newMainPage(); |
| 1905 | + $mainText = $main->getPrefixedDBkey(); |
| 1906 | + if ( $mainText === $title->getPrefixedDBkey() ) { |
| 1907 | + $wgMessageCache->addMessage( 'cant-delete-main-page', "You can't delete or move the main page." ); |
| 1908 | + $result = array( 'cant-delete-main-page' ); |
| 1909 | + return false; |
| 1910 | + } |
| 1911 | + return true; |
| 1912 | +} |
| 1913 | + |
| 1914 | +if( $wgDBname == 'enwiki' ) { |
| 1915 | + // Please don't interferew with our hundreds of wikis ability to manage themselves. |
| 1916 | + // Only use this shitty hack for enwiki. Thanks. |
| 1917 | + // -- brion 2008-04-10 |
| 1918 | + $wgHooks['getUserPermissionsErrorsExpensive'][] = 'wfNoDeleteMainPage'; |
| 1919 | +} |
| 1920 | + |
| 1921 | +// Quickie extension that addsa bogus field to edit form and whinges if it's filled out |
| 1922 | +// Might or might not do anything useful :D |
| 1923 | +// Enabling just to log to udp://10.0.5.8:8420/spam |
| 1924 | +include "$IP/extensions/SimpleAntiSpam/SimpleAntiSpam.php"; |
| 1925 | + |
| 1926 | +if( $wmgUseCollection ) { |
| 1927 | + // PediaPress / PDF generation |
| 1928 | + include "$IP/extensions/Collection/Collection.php"; |
| 1929 | + #$wgPDFServer = 'http://bindery.wikimedia.org/cgi-bin/pdfserver.py'; |
| 1930 | + #$wgCollectionMWServeURL = 'http://bindery.wikimedia.org/cgi-bin/mwlib.cgi'; |
| 1931 | + #$wgCollectionMWServeURL = 'http://bindery.wikimedia.org:8080/mw-serve/'; |
| 1932 | + #$wgCollectionMWServeURL = 'http://erzurumi.wikimedia.org:8080/mw-serve/'; |
| 1933 | + $wgCollectionMWServeURL = 'http://pdf1.wikimedia.org:8080/mw-serve/'; |
| 1934 | + |
| 1935 | + // MediaWiki namespace is not a good default |
| 1936 | + $wgCommunityCollectionNamespace = NS_PROJECT; |
| 1937 | + |
| 1938 | + // Allow collecting Help pages |
| 1939 | + $wgCollectionArticleNamespaces[] = NS_HELP; |
| 1940 | + |
| 1941 | + // Sidebar cache doesn't play nice with this |
| 1942 | + $wgEnableSidebarCache = false; |
| 1943 | + |
| 1944 | + $wgCollectionFormats = array( |
| 1945 | + 'rl' => 'PDF', |
| 1946 | + 'odf' => 'OpenDocument Text', |
| 1947 | + 'zim' => 'openZIM', |
| 1948 | + ); |
| 1949 | + |
| 1950 | + $wgLicenseURL = 'http://en.wikipedia.org/w/index.php?title=Wikipedia:Text_of_the_GNU_Free_Documentation_License&action=raw'; |
| 1951 | + |
| 1952 | + $wgCollectionPortletForLoggedInUsersOnly = $wmgCollectionPortletForLoggedInUsersOnly; |
| 1953 | + $wgCollectionArticleNamespaces = $wmgCollectionArticleNamespaces; |
| 1954 | +} |
| 1955 | + |
| 1956 | +// Testing internally |
| 1957 | +include "$IP/wmf-config/secret-projects.php"; |
| 1958 | + |
| 1959 | +/* |
| 1960 | +if ( $wgDBname == 'idwiki' ) { |
| 1961 | + # Account creation throttle disabled for outreach event |
| 1962 | + # Contact: Siska Doviana <serenity@gmail.com> |
| 1963 | + if ( time() > strtotime( '2008-08-08T08:00 +7:00' ) |
| 1964 | + && time() < strtotime( '2008-08-08T19:00 +7:00' ) ) |
| 1965 | + { |
| 1966 | + $wgAccountCreationThrottle = 300; |
| 1967 | + } |
| 1968 | +} |
| 1969 | +*/ |
| 1970 | + |
| 1971 | +/* |
| 1972 | +if ( $wgDBname == 'enwiki' ) { |
| 1973 | + # Account creation throttle disabled for outreach event |
| 1974 | + # Contact: fschulenburg@wikimedia.org |
| 1975 | + if ( time() > strtotime( '2009-10-19T11:00 -7:00' ) |
| 1976 | + && time() < strtotime( '2009-10-19T16:00 -7:00' ) ) |
| 1977 | + { |
| 1978 | + $wgAccountCreationThrottle = 300; |
| 1979 | + } |
| 1980 | +} |
| 1981 | + */ |
| 1982 | + |
| 1983 | +if ( $wgDBname == 'elwiki' ) { |
| 1984 | + # Account creation throttle disabled for editing workshop |
| 1985 | + # Contact: ariel@wikimedia.org (irc: apergos) |
| 1986 | + if ( time() > strtotime( '2011-05-16T17:00 +3:00' ) |
| 1987 | + && time() < strtotime( '2011-05-16T20:00 +3:00') ) |
| 1988 | + { |
| 1989 | + $wgAccountCreationThrottle = 40; |
| 1990 | + } |
| 1991 | +} |
| 1992 | + |
| 1993 | +# Account creation throttle raised for wiki week at UEM, see bug 21510 |
| 1994 | +function efRaiseThrottleForUEM() { |
| 1995 | + global $wgAccountCreationThrottle; |
| 1996 | + if ( wfGetIP() == '193.147.239.254' && |
| 1997 | + time() > strtotime( '2009-11-30T08:00 +1:00' ) && |
| 1998 | + time() < strtotime( '2009-12-06T23:00 +1:00' ) ) |
| 1999 | + { |
| 2000 | + $wgAccountCreationThrottle = 300; |
| 2001 | + } |
| 2002 | +} |
| 2003 | +if ( $wgDBname == 'eswiki' ) |
| 2004 | + $wgExtensionFunctions[] = 'efRaiseThrottleForUEM'; |
| 2005 | + |
| 2006 | +if( $wmgUseNewUserMessage ) { |
| 2007 | + include "$IP/extensions/NewUserMessage/NewUserMessage.php"; |
| 2008 | + $wgNewUserSuppressRC = $wmgNewUserSuppressRC; |
| 2009 | + $wgNewUserMinorEdit = $wmgNewUserMinorEdit; |
| 2010 | + $wgNewUserMessageOnAutoCreate = $wmgNewUserMessageOnAutoCreate; |
| 2011 | +} |
| 2012 | + |
| 2013 | +if( $wmgUseCodeReview ) { |
| 2014 | + include "$IP/extensions/CodeReview/CodeReview.php"; |
| 2015 | + include( $IP.'/wmf-config/codereview.php'); |
| 2016 | + $wgSubversionProxy = 'http://codereview-proxy.wikimedia.org/index.php'; |
| 2017 | + |
| 2018 | + $wgGroupPermissions['user']['codereview-add-tag'] = false; |
| 2019 | + $wgGroupPermissions['user']['codereview-remove-tag'] = false; |
| 2020 | + $wgGroupPermissions['user']['codereview-post-comment'] = false; |
| 2021 | + $wgGroupPermissions['user']['codereview-set-status'] = false; |
| 2022 | + $wgGroupPermissions['user']['codereview-link-user'] = false; |
| 2023 | + $wgGroupPermissions['user']['codereview-signoff'] = false; |
| 2024 | + $wgGroupPermissions['user']['codereview-associate'] = false; |
| 2025 | + |
| 2026 | + $wgGroupPermissions['user']['codereview-post-comment'] = true; |
| 2027 | + |
| 2028 | + $wgGroupPermissions['coder']['codereview-add-tag'] = true; |
| 2029 | + $wgGroupPermissions['coder']['codereview-remove-tag'] = true; |
| 2030 | + $wgGroupPermissions['coder']['codereview-set-status'] = true; |
| 2031 | + $wgGroupPermissions['coder']['codereview-link-user'] = true; |
| 2032 | + $wgGroupPermissions['coder']['codereview-signoff'] = true; |
| 2033 | + $wgGroupPermissions['coder']['codereview-associate'] = true; |
| 2034 | + |
| 2035 | + $wgGroupPermissions['svnadmins']['repoadmin'] = true; // Default is stewards, but this has nothing to do with them |
| 2036 | + |
| 2037 | + $wgCodeReviewENotif = true; // let's experiment with this |
| 2038 | + $wgCodeReviewSharedSecret = $wmgCodeReviewSharedSecret; |
| 2039 | + $wgCodeReviewCommentWatcherEmail = 'mediawiki-codereview@lists.wikimedia.org'; |
| 2040 | + $wgCodeReviewRepoStatsCacheTime = 60*60; // 1 hour, default is 6 |
| 2041 | + |
| 2042 | + $wgCodeReviewMaxDiffPaths = 30; |
| 2043 | +} |
| 2044 | + |
| 2045 | +if( $wmgUseAbuseFilter ) { |
| 2046 | + include "$IP/extensions/AbuseFilter/AbuseFilter.php"; |
| 2047 | + include( $IP.'/wmf-config/abusefilter.php'); |
| 2048 | +} |
| 2049 | + |
| 2050 | +if ($wmgUseCommunityVoice == true) { |
| 2051 | + include ( "$IP/extensions/ClientSide/ClientSide.php" ); |
| 2052 | + include ( "$IP/extensions/CommunityVoice/CommunityVoice.php" ); |
| 2053 | +} |
| 2054 | + |
| 2055 | +if ($wmgUsePdfHandler == true) { |
| 2056 | + include ("$IP/extensions/PdfHandler/PdfHandler.php" ); |
| 2057 | +} |
| 2058 | + |
| 2059 | +if ($wmgUseUsabilityInitiative) { |
| 2060 | + |
| 2061 | + $wgNavigableTOCCollapseEnable = true; |
| 2062 | + $wgNavigableTOCResizable = true; |
| 2063 | + require( "$IP/extensions/Vector/Vector.php" ); |
| 2064 | + |
| 2065 | + require( "$IP/extensions/WikiEditor/WikiEditor.php" ); |
| 2066 | + |
| 2067 | + // Uncomment this line for debugging only |
| 2068 | + //if ( $wgDBname == 'testwiki' ) { $wgUsabilityInitiativeResourceMode = 'raw'; } |
| 2069 | + // Disable experimental things |
| 2070 | + $wgWikiEditorFeatures['templateEditor'] = |
| 2071 | + $wgWikiEditorFeatures['preview'] = |
| 2072 | + $wgWikiEditorFeatures['previewDialog'] = |
| 2073 | + $wgWikiEditorFeatures['publish'] = |
| 2074 | + $wgWikiEditorFeatures['templates'] = |
| 2075 | + $wgVectorFeatures['collapsiblenav'] = |
| 2076 | + $wgWikiEditorFeatures['highlight'] = array( 'global' => false, 'user' => true ); // Hidden from prefs view |
| 2077 | + $wgVectorFeatures['simplesearch'] = array( 'global' => true, 'user' => false ); |
| 2078 | + $wgVectorFeatures['expandablesearch'] = array( 'global' => false, 'user' => false ); |
| 2079 | + $wgVectorUseSimpleSearch = true; |
| 2080 | + // Enable EditWarning by default |
| 2081 | + $wgDefaultUserOptions['useeditwarning'] = 1; |
| 2082 | + $wgHiddenPrefs[] = 'usenavigabletoc'; |
| 2083 | + $wgHiddenPrefs[] = 'wikieditor-templates'; |
| 2084 | + $wgHiddenPrefs[] = 'wikieditor-template-editor'; |
| 2085 | + $wgHiddenPrefs[] = 'wikieditor-preview'; |
| 2086 | + $wgHiddenPrefs[] = 'wikieditor-previewDialog'; |
| 2087 | + $wgHiddenPrefs[] = 'wikieditor-publish'; |
| 2088 | + $wgHiddenPrefs[] = 'wikieditor-highlight'; |
| 2089 | + if ( $wmgUseCollapsibleNav ) { |
| 2090 | + $wgDefaultUserOptions['vector-collapsiblenav'] = 1; |
| 2091 | + } else { |
| 2092 | + $wgHiddenPrefs[] = 'vector-collapsiblenav'; |
| 2093 | + } |
| 2094 | + if( $wgDBname == 'enwiki' ) { |
| 2095 | + $wgHiddenPrefs[] = 'minordefault'; |
| 2096 | + } |
| 2097 | + |
| 2098 | + if ($wmgUsabilityPrefSwitch) { |
| 2099 | + require_once( "$IP/extensions/PrefStats/PrefStats.php" ); |
| 2100 | + |
| 2101 | + $wgPrefStatsTrackPrefs = array( |
| 2102 | + 'skin' => $wgDefaultSkin != 'vector' ? 'vector' : 'monobook', |
| 2103 | + 'usebetatoolbar' => $wmgUsabilityEnforce ? 0 : 1, |
| 2104 | + 'useeditwarning' => 0, |
| 2105 | + 'usenavigabletoc' => 1, |
| 2106 | + 'usebetatoolbar-cgd' => $wmgUsabilityEnforce ? 0 : 1, |
| 2107 | + ); |
| 2108 | + |
| 2109 | + require_once( "$IP/extensions/PrefSwitch/PrefSwitch.php" ); |
| 2110 | + $wgPrefSwitchGlobalOptOut = true; |
| 2111 | + $wgPrefSwitchShowLinks = false; |
| 2112 | + } |
| 2113 | + |
| 2114 | + |
| 2115 | + if ($wmgUsabilityEnforce) { |
| 2116 | + $wgEditToolbarGlobalEnable = false; |
| 2117 | + $wgDefaultUserOptions['usebetatoolbar'] = 1; |
| 2118 | + $wgDefaultUserOptions['usebetatoolbar-cgd'] = 1; |
| 2119 | + |
| 2120 | + } |
| 2121 | + |
| 2122 | + // For Babaco... these are still experimental, won't be on by default |
| 2123 | + $wgNavigableTOCUserEnable = true; |
| 2124 | + $wgEditToolbarCGDUserEnable = true; |
| 2125 | + |
| 2126 | + if( $wmgUserDailyContribs ) { |
| 2127 | + require "$IP/extensions/UserDailyContribs/UserDailyContribs.php"; |
| 2128 | + } |
| 2129 | + |
| 2130 | + if( $wmgClickTracking ) { |
| 2131 | + require "$IP/extensions/ClickTracking/ClickTracking.php"; |
| 2132 | + |
| 2133 | + $wgClickTrackThrottle = $wmgClickTrackThrottle; |
| 2134 | + # Disable Special:ClickTracking, not secure yet (as of r59230) |
| 2135 | + unset( $wgSpecialPages['ClickTracking'] ); |
| 2136 | + # Remove the clicktracking permission because people see it in ListGroupRights and wonder what it does |
| 2137 | + unset( $wgGroupPermissions['sysop']['clicktrack'] ); |
| 2138 | + } |
| 2139 | + |
| 2140 | + if ( $wmgVectorEditSectionLinks ) { |
| 2141 | + $wgVectorFeatures['sectioneditlinks'] = array( 'global' => false, 'user' => true ); |
| 2142 | + $wgVectorSectionEditLinksBucketTest = true; |
| 2143 | + $wgVectorSectionEditLinksLotteryOdds = 1; |
| 2144 | + $wgVectorSectionEditLinksExperiment = 2; |
| 2145 | + } |
| 2146 | +} |
| 2147 | + |
| 2148 | +if ( $wmgClickTracking && $wmgCustomUserSignup ){ |
| 2149 | + include "$IP/extensions/CustomUserSignup/CustomUserSignup.php"; |
| 2150 | +} |
| 2151 | + |
| 2152 | +if (!$wmgEnableVector) { |
| 2153 | + $wgSkipSkins[] = 'vector'; |
| 2154 | +} |
| 2155 | + |
| 2156 | +if ($wmgUseReaderFeedback) { |
| 2157 | + require_once( "$IP/extensions/ReaderFeedback/ReaderFeedback.php" ); |
| 2158 | + $wgFeedbackStylePath = "$wgExtensionAssetsPath/ReaderFeedback"; |
| 2159 | + $wgFeedbackNamespaces = $wmgFeedbackNamespaces; |
| 2160 | + if( $wmgFeedbackTags ) { |
| 2161 | + $wgFeedbackTags = $wmgFeedbackTags; |
| 2162 | + } |
| 2163 | + $wgFeedbackSizeThreshhold = $wmgFeedbackSizeThreshhold; |
| 2164 | +} |
| 2165 | + |
| 2166 | +if( $wmgUseLocalisationUpdate ) { |
| 2167 | + require_once( "$IP/extensions/LocalisationUpdate/LocalisationUpdate.php" ); |
| 2168 | + // Set to a local checkout that's accessible when we run... |
| 2169 | + $wgLocalisationUpdateSVNURL = "/home/wikipedia/l10n/trunk"; |
| 2170 | + $wgLocalisationUpdateDirectory = "$IP/cache/l10n"; |
| 2171 | +} |
| 2172 | + |
| 2173 | +if ( $wmgEnableLandingCheck ) { |
| 2174 | + require_once( "$IP/extensions/LandingCheck/LandingCheck.php" ); |
| 2175 | + |
| 2176 | + $wgPriorityCountries = array( 'AU', 'AT', 'FR', 'DE', 'HU', 'IL', 'IT', |
| 2177 | + 'NL', 'RU', 'SE', 'CH', 'GB'); |
| 2178 | +} |
| 2179 | + |
| 2180 | +if ( $wmgUseLiquidThreads ) { |
| 2181 | + require_once( "$IP/wmf-config/liquidthreads.php" ); |
| 2182 | +} |
| 2183 | + |
| 2184 | +if ( $wmgUseFundraiserPortal ) { |
| 2185 | + require "$IP/extensions/FundraiserPortal/FundraiserPortal.php"; |
| 2186 | + $wgExtensionFunctions[] = 'setupFundraiserPortal'; |
| 2187 | + function setupFundraiserPortal() { |
| 2188 | + global $wgScriptPath; // SSL may change this after CommonSettings |
| 2189 | + global $wgFundraiserPortalDirectory, $wgFundraiserPortalPath, $wgFundraiserImageUrl; |
| 2190 | + $wgFundraiserPortalDirectory = "/mnt/upload6/portal"; |
| 2191 | + $wgFundraiserPortalPath = "http://upload.wikimedia.org/portal"; |
| 2192 | + $wgFundraiserImageUrl = "$wgScriptPath/extensions/FundraiserPortal/images"; |
| 2193 | + } |
| 2194 | +} |
| 2195 | + |
| 2196 | +if ( $wmgDonationInterface ) { |
| 2197 | + require_once( "$IP/extensions/DonationInterface/donate_interface/donate_interface.php" ); |
| 2198 | + require_once( "$IP/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php" ); |
| 2199 | +// require_once( "$IP/extensions/DonationInterface/paypal_gateway/paypal_gateway.php" ); # Pulling until Diana fixes ContribTracking Posts |
| 2200 | +} |
| 2201 | + |
| 2202 | +if ( $wmgUseGlobalUsage ) { |
| 2203 | + require_once( "$IP/extensions/GlobalUsage/GlobalUsage.php" ); |
| 2204 | + $wgGlobalUsageDatabase = 'commonswiki'; |
| 2205 | +} |
| 2206 | + |
| 2207 | +if ( $wmgUseAPIRequestLog ) { |
| 2208 | + $wgAPIRequestLog = "udp://locke.wikimedia.org:9000/$wgDBname"; |
| 2209 | +} |
| 2210 | + |
| 2211 | +if ( $wmgUseLivePreview ) { |
| 2212 | + $wgDefaultUserOptions['uselivepreview'] = 1; |
| 2213 | +} |
| 2214 | + |
| 2215 | +if ( $wmgUseArticleAssessment ) { |
| 2216 | + require_once( "$IP/extensions/PrefSwitch/PrefSwitch.php" ); |
| 2217 | + $wgPrefSwitchGlobalOptOut = true; |
| 2218 | + $wgPrefSwitchShowLinks = false; |
| 2219 | + require_once( "$IP/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php" ); |
| 2220 | + |
| 2221 | + $wgArticleAssessmentCategory = $wmgArticleAssessmentCategory; |
| 2222 | + |
| 2223 | + // WMF-specific tweaks for back compat with 1.16wmf4 |
| 2224 | + $wgSimpleSurveyJSPath = "$wgExtensionAssetsPath/PrefSwitch/PrefSwitch.js"; |
| 2225 | + $wgSimpleSurveyCSSPath = "$wgExtensionAssetsPath/PrefSwitch/PrefSwitch.css"; |
| 2226 | + $wgArticleAssessmentJUIPath = $wgArticleAssessmentJUIJSPath = "$wgExtensionAssetsPath/UsabilityInitiative/js/js2stopgap/jui.combined.min.js"; |
| 2227 | + $wgArticleAssessmentJUICSSPath = "$wgExtensionAssetsPath/UsabilityInitiative/css/vector/jquery-ui-1.7.2.css"; |
| 2228 | + $wgArticleAssessmentNeedJUICSS = true; |
| 2229 | + |
| 2230 | + // Enable this for testing only |
| 2231 | + if ( $wgDBname == 'testwiki' ) $wgArticleAssessmentResourceMode = 'raw'; |
| 2232 | +} |
| 2233 | + |
| 2234 | +if ( $wmgUseArticleFeedback ) { |
| 2235 | + require_once( "$IP/extensions/ArticleFeedback/ArticleFeedback.php" ); |
| 2236 | + $wgArticleFeedbackCategories = $wmgArticleFeedbackCategories; |
| 2237 | + $wgArticleFeedbackLotteryOdds = $wmgArticleFeedbackLotteryOdds; |
| 2238 | + $wgArticleFeedbackTrackingVersion = 1; |
| 2239 | + |
| 2240 | + $wgArticleFeedbackTracking = array( |
| 2241 | + 'buckets' => array( |
| 2242 | + 'track' => 10, |
| 2243 | + 'ignore' => 90, |
| 2244 | + //'track'=>0, 'ignore' => 100 |
| 2245 | + ), |
| 2246 | + 'version' => 8, |
| 2247 | + 'expires' => 30, |
| 2248 | + 'tracked' => false |
| 2249 | + ); |
| 2250 | + $wgArticleFeedbackOptions = array( |
| 2251 | + 'buckets' => array( |
| 2252 | + 'show' => 100, |
| 2253 | + 'hide' => 0, |
| 2254 | + ), |
| 2255 | + 'version' => 8, |
| 2256 | + 'expires' => 30, |
| 2257 | + 'tracked' => false |
| 2258 | + ); |
| 2259 | + $wgArticleFeedbackDashboard = $wmgArticleFeedbackDashboard; |
| 2260 | +} |
| 2261 | + |
| 2262 | +#if ( $wgDBname == 'testwiki' ) { |
| 2263 | +# $wgDebugLogFile = '/tmp/debuglog_tmp.txt'; |
| 2264 | +#} |
| 2265 | + |
| 2266 | + |
| 2267 | +$wgDefaultUserOptions['thumbsize'] = $wmgThumbsizeIndex; |
| 2268 | + |
| 2269 | +if ( $wgDBname == 'strategywiki' ) { |
| 2270 | + require_once( "$IP/extensions/StrategyWiki/ActiveStrategy/ActiveStrategy.php" ); |
| 2271 | +} |
| 2272 | + |
| 2273 | +if ( $wgDBname == 'testwiki' || $wgDBname == 'foundationwiki' ) { |
| 2274 | + require_once( "$IP/extensions/CommunityHiring/CommunityHiring.php" ); |
| 2275 | + $wgCommunityHiringDatabase = 'officewiki'; |
| 2276 | +} elseif ( $wgDBname == 'officewiki' ) { |
| 2277 | + require_once( "$IP/extensions/CommunityApplications/CommunityApplications.php" ); |
| 2278 | +} |
| 2279 | + |
| 2280 | +## Hack to block emails from some idiot user who likes 'The Joker' --Andrew 2009-05-28 |
| 2281 | +$wgHooks['EmailUser'][] = 'wmfBlockJokerEmails'; |
| 2282 | +$wgDebugLogGroups['block_joker_mail'] = 'udp://10.0.5.8:8420/jokermail'; |
| 2283 | + |
| 2284 | +function wmfBlockJokerEmails( &$to, &$from, &$subject, &$text ) { |
| 2285 | + $blockedAddresses = array( 'the4joker@gmail.com', 'testaccount@werdn.us', 'randomdude5555@gmail.com', 'siyang.li@yahoo.com', 'johnnywiki@gmail.com', 'wikifreedomfighter@googlemail.com' ); |
| 2286 | + if ( in_array( $from->address, $blockedAddresses ) ) { |
| 2287 | + wfDebugLog( 'block_joker_mail', "Blocked attempted email from ".$from->toString(). |
| 2288 | + " to ".$to->address." with subject ".$subject."\n" ); |
| 2289 | + return false; |
| 2290 | + } |
| 2291 | + return true; |
| 2292 | +} |
| 2293 | + |
| 2294 | +#$wgEnableUploads = false; |
| 2295 | +#$wgUploadMaintenance = true; // temp disable delete/restore of images |
| 2296 | +#$wgSiteNotice = "Image uploads, deletes and restores are temporarily disabled while we upgrade our servers. We expect to enable them again shortly."; |
| 2297 | +#if( $wgDBname == 'enwiki' ) { |
| 2298 | +# $wgExtensionFunctions[] = 'logWtf'; |
| 2299 | +# function logWtf() { |
| 2300 | +# wfDebugLog( 'wtf', $_SERVER['REQUEST_URI'] ); |
| 2301 | +# } |
| 2302 | +#} |
| 2303 | + |
| 2304 | +#$wgReadOnly = "Emergency database maintenance, will be back to full shortly."; |
| 2305 | +#$wgSiteNotice = "<div style='text-align: center; background: #f8f4f0; border: solid 1px #988; font-size: 90%; padding: 4px'>Software updates are being applied to Wikimedia sites; there may be some brief interruption as the servers update.</div>"; |
| 2306 | +#$wgSiteNotice = "<div style='text-align: center; background: #f8f4f0; border: solid 1px #988; font-size: 90%; padding: 4px'>Software updates are being applied to Wikimedia sites; we're shaking out a few remaining issues.</div>"; |
| 2307 | + |
| 2308 | +// Variable destinations for Donate link in sidebar. Currently only for test wiki |
| 2309 | +if ( $wgUseVariablePage ) { |
| 2310 | + include( "$IP/extensions/VariablePage/VariablePage.php"); |
| 2311 | + $wgVariablePagePossibilities = array( |
| 2312 | + 'http://wikimediafoundation.org/wiki/WMFJA1/en' => 100, |
| 2313 | + ); |
| 2314 | + |
| 2315 | + $wgVariablePageShowSidebarLink = true; |
| 2316 | + $wgVariablePageSidebarLinkQuery = array( |
| 2317 | + 'utm_source' => 'donate', |
| 2318 | + 'utm_medium' => 'sidebar', |
| 2319 | + 'utm_campaign' => 'spontaneous_donation' |
| 2320 | + ); |
| 2321 | +} |
| 2322 | + |
| 2323 | +// ContributionTracking for handling PayPal redirects |
| 2324 | +if ( $wgUseContributionTracking ) { |
| 2325 | + include( "$IP/extensions/ContributionTracking/ContributionTracking.php" ); |
| 2326 | + include( "$IP/wmf-config/contribution-tracking-setup.php"); |
| 2327 | + $wgContributionTrackingPayPalIPN = "https://civicrm.wikimedia.org/fundcore_gateway/paypal"; |
| 2328 | + $wgContributionTrackingPayPalRecurringIPN = "https://civicrm.wikimedia.org/IPNListener_Recurring.php"; |
| 2329 | +} |
| 2330 | + |
| 2331 | +if ( $wmgUseUploadWizard ) { |
| 2332 | + require_once( "$IP/extensions/UploadWizard/UploadWizard.php" ); |
| 2333 | + $wgUploadStashScalerBaseUrl = "http://upload.wikimedia.org/$site/$lang/thumb/temp"; |
| 2334 | + $wgUploadWizardConfig = array( |
| 2335 | + #'debug' => true, |
| 2336 | + 'disableResourceLoader' => false, |
| 2337 | + 'autoCategory' => 'Uploaded with UploadWizard', |
| 2338 | + // If Special:UploadWizard again experiences unexplained slowness loading JavaScript (spinner on intial load spinning forever) |
| 2339 | + // set fallbackToAltUploadForm to true. |
| 2340 | + 'fallbackToAltUploadForm' => false, # Set by neilk, 2011-05-17 |
| 2341 | + 'altUploadForm' => 'Special:Upload', # Set by demon, 2011-05-10 per neilk |
| 2342 | + ); |
| 2343 | + if ( $wgDBname == 'testwiki' ) { |
| 2344 | + $wgUploadWizardConfig['feedbackPage'] = 'Prototype_upload_wizard_feedback'; |
| 2345 | + $wgUploadWizardConfig['altUploadForm'] = 'Special:Upload'; |
| 2346 | + unset( $wgUploadWizardConfig['fallbackToAltUploadForm'] ); |
| 2347 | + } else if ( $wgDBname == 'commonswiki' ) { |
| 2348 | + $wgUploadWizardConfig['feedbackPage'] = 'Commons:Prototype_upload_wizard_feedback'; |
| 2349 | + $wgUploadWizardConfig['altUploadForm'] = 'Commons:Upload'; |
| 2350 | + } |
| 2351 | +} |
| 2352 | + |
| 2353 | +if ( $wmgUseNarayam ) { |
| 2354 | + require_once( "$IP/extensions/Narayam/Narayam.php" ); |
| 2355 | + $wgNarayamEnabledByDefault = false; |
| 2356 | +} |
| 2357 | + |
| 2358 | +if ( $wmgUseGoogleNewsSitemap ) { |
| 2359 | + include( "$IP/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php" ); |
| 2360 | +} |
| 2361 | + |
| 2362 | +if ( $wmgUseCLDR ) { |
| 2363 | + require_once( "$IP/extensions/cldr/cldr.php" ); |
| 2364 | +} |
| 2365 | + |
| 2366 | +# Disable action=parse due to bug 25238 -- TS |
| 2367 | +# ImageAnnotator disabled, reenabling parse on Commons --catrope |
| 2368 | +#if ( $wgDBname == 'commonswiki' ) { |
| 2369 | +# $wgAPIModules['parse'] = 'ApiDisabled'; |
| 2370 | +#} |
| 2371 | + |
| 2372 | +if ( $wgDBname == 'ptwikibooks' ) { |
| 2373 | + # Account creation throttle disabled for "Logística 2011" project from |
| 2374 | + # [[FCT]] / [[New University of Lisbon]] |
| 2375 | + $wgAccountCreationThrottle = 100; |
| 2376 | +} |
| 2377 | + |
| 2378 | +$wgObjectCaches['ehcache-multiwrite'] = array( |
| 2379 | + 'class' => 'MultiWriteBagOStuff', |
| 2380 | + 'caches' => array( |
| 2381 | + 0 => array( |
| 2382 | + 'class' => 'EhcacheBagOStuff', |
| 2383 | + 'servers' => array( |
| 2384 | + '10.0.6.50:8080', |
| 2385 | + ), |
| 2386 | + 'connectTimeout' => 0.5, |
| 2387 | + 'timeout' => 5, |
| 2388 | + ), |
| 2389 | + 1 => array( |
| 2390 | + 'factory' => 'ObjectCache::newMemcached', |
| 2391 | + ), |
| 2392 | + ) |
| 2393 | +); |
| 2394 | + |
| 2395 | + |
| 2396 | +# Style version appendix |
| 2397 | +# Shouldn't be needed much in 1.17 due to ResourceLoader, but some legacy things still need it |
| 2398 | +$wgStyleVersion .= '-2'; |
| 2399 | + |
| 2400 | +// DO NOT DISABLE WITHOUT CONTACTING PHILIPPE / LEGAL! |
| 2401 | +// Installed by Andrew, 2011-04-26 |
| 2402 | +if ( $wmgUseDisableAccount ) { |
| 2403 | + require_once( "$IP/extensions/DisableAccount/DisableAccount.php" ); |
| 2404 | + $wgGroupPermissions['bureaucrat']['disableaccount'] = true; |
| 2405 | +} |
| 2406 | + |
| 2407 | +if ( $wmgUseIncubator ) { |
| 2408 | + require_once( "$IP/extensions/WikimediaIncubator/WikimediaIncubator.php" ); |
| 2409 | +} |
| 2410 | + |
| 2411 | + |
| 2412 | +# THIS MUST BE AFTER ALL EXTENSIONS ARE INCLUDED |
| 2413 | +# |
| 2414 | +# REALlY ... were not kidding here ... NO EXTENSIONS AFTER |
| 2415 | + |
| 2416 | +require( "$IP/wmf-config/ExtensionMessages.php" ); |
| 2417 | + |
| 2418 | +wfProfileOut( "$fname-misc5" ); |
| 2419 | +wfProfileOut( $fname ); |