Commit graph

446 commits

Author SHA1 Message Date
withoutaname
493855da50 If $wgEnableEmail is false, disable other email settings
Bug: 63678
Change-Id: I8464f540f4bd850d6be1c578b043d9702ed8e773
2014-07-09 18:10:53 +00:00
Bryan Davis
b6d18ab9f7 Fix GitInfo cache file path computation and storage location
Depending on the configuration used in LocalSettings.php, $IP can be
changed between the time that configuration is loaded and the wiki
runtime by logic in WebStart.php. Attempt to mitigate the effects of
such changes on the cache file name computation by canonicalizing both
$IP and the path using PHP's realpath() function.

Related but distinct is the possible need to configure the canonical
location for finding cache files on disk separately from
$wgCacheDirectory. This change introduces a new configuration variable
named $wgGitInfoCacheDirectory that can be set to a path that diverges
from the default location of $wgCacheDirectory/gitinfo. This will be
useful in the WMF cluster where $wgCacheDirectory points to a directory
that is not managed by the deployment system.

Finally add wfDebugLog logging to make tracking down issues such as
miscomputed cache paths easier.

Bug: 53972
Change-Id: Iceb9e1ce8d3b4bb08f89fa6ec5d5e7392aaafd46
2014-07-08 16:36:10 +00:00
Alexandre Emsenhuber
a7de863d3a Don't use isset to check for null
Change isset() checks for variables that are always defined.

Change-Id: Ic96b9661d94742909c0d6b62a8eb2f6a038a774f
2014-07-04 21:20:22 +02:00
jenkins-bot
fc3869f0a1 Merge "Setup.php: Move hacky skin requires higher up" 2014-07-01 13:53:22 +00:00
Bartosz Dziewoński
f7939a856b Setup.php: Move hacky skin requires higher up
Some of the setup code in some of the configurations apparently depends
on all extensions and skins being already required by the point
Setup.php is being loaded. We ran into issues with LocalisationCache.

Bug: 67318
Change-Id: Idde13c2e835a9969593a4716a62b392d4c1388d6
2014-07-01 15:39:46 +02:00
jenkins-bot
e3e8659cfc Merge "Make the global objects documentation consistent in Setup.php" 2014-07-01 11:18:05 +00:00
Kunal Grover
50144cd02a First version of Page Language selector
Special page PageLanguage to set the page language of a page.
To enable the feature, set $wgPageLanguageUseDB to true
and assign the 'pagelang' user right to a user group.

Bug: 35489
Change-Id: I0f82b146fbe948f917c1c5d29f7469644d797e80
2014-06-27 23:27:07 +00:00
Bartosz Dziewoński
08da4b0f32 Setup.php: Update comment about loading default skins
Change-Id: Icd6d8c83404b853e91ed7312137bc144d488568d
2014-06-26 19:55:13 +02:00
Bartosz Dziewoński
ec1ccf4367 Separate MonoBook skin from core
This makes it behave exactly like a custom skin.

* Renamed directory to reflect skin name.
* Split skin classes to separate PHP files.
* Removed core autoloader entries for skin classes.
* Changed the hack in Setup.php to require_once the skin PHP file, as
  the skin is now registered there.
* Extracted skin-specific localisation messages.
* Extracted skin-specific resources.

Change-Id: Ife9926d12b6baaa84cd2aa9a415f1183415863c8
2014-06-21 00:01:05 +02:00
Bartosz Dziewoński
a96afeb262 Separate Vector skin from core
This makes it behave exactly like a custom skin, with the caveat that
it is still hardcoded in several places :(, most notably lots of
skinStyles in Resources.php, the installer and some tests.

* Renamed directory to reflect skin name.
* Split skin classes to separate PHP files.
* Removed core autoloader entries for skin classes.
* Changed the hack in Setup.php to require_once the skin PHP file, as
  the skin is now registered there.
* Extracted skin-specific localisation messages.
* Extracted skin-specific resources. Did not touch skinStyles yet.
* Hacked up the installer not to fall over entirely if Vector is
  missing.
* Adjusted hardcoded paths in some more places...

Change-Id: Idfffc1430790b3a104cc9835a6367137bcbf0e4e
2014-06-21 00:01:04 +02:00
Alexandre Emsenhuber
07795699fb Make the global objects documentation consistent in Setup.php
Change-Id: I7ba179ea2202586854194c4f20f403ed9fd60aa3
2014-06-10 19:55:30 +00:00
Bartosz Dziewoński
9e6827d7b5 Don't use autodiscovery for core skins, move them to separate directories
Step one on the way to killing the autodiscovery mechanism and making
the core skins less intertwined with core.

This only moves the files and fixes hardcoded paths throughout core.
Any further changes will be done in separate patch(es).

Moved files:
* skins/MonoBook.php → skins/monobook/MonoBook.php
* skins/Vector.php   → skins/vector/Vector.php

Bug: 65748
Change-Id: Ib4bdda5ed3c133fce0113eb17fa39950aa812f87
2014-06-10 02:49:17 +00:00
Siebrand Mazeland
49cffd699c Make phpcs-strict pass on includes/ (2/~10)
Change-Id: I59fa9af7b16e0a5a4eb8a5cc764a605b18137316
2014-05-11 19:22:05 +00:00
Alexandre Emsenhuber
f32f31613c Remove $wgSessionStarted
This variable is useless since there is the check "session_id() !== ''"
to do the same, that works correctly if the session has been started
during the request.

Change-Id: I5081e79e30e01c97aa0e59b106cc75e9d1ba951a
2014-05-10 16:29:02 +02:00
Ori Livneh
72c0ce43a8 Add $wgServerName
This partially reverts r73950 which removed $wgServerName on the ground that it
was only used for {{SERVERNAME}}. When it was pointed out that $wgServerName was
also used by several extensions, the response was not to restore the variable, but
to proceed to remove it from extensions as well.

It is a useful variable to have, as the discussion on Id819246a9 makes clear
(see Tim's comment on PS12 and Timo's reply). So let's reintroduce it, and expose
it in mw.config and ApiQuerySiteInfo as well.

Change-Id: I40a6fd427d38c64c628f70a2f407b145443ea204
2014-05-09 11:53:56 +02:00
Alexandre Emsenhuber
52abfd6a64 Normalise comments in Setup.php
- Changed "#" to "//" for non-block comments
- Put the inline comment describing the file back
  in the file description

Change-Id: I0aec0f4c10def58b608a8f08455fccb2317e4538
2014-04-14 00:17:14 +00:00
Antoine Musso
6084fdcef2 Adjust debug log for caches being used
I always found out the debug message listing the cache being in use to
be slightly confusing:

    MemcachedPeclBagOStuff[main] MemcachedPeclBagOStuff[message]
    MemcachedPhpBagOStuff[parser]

Swap the class name and identifier to output:

    main: MemcachedPeclBagOStuff, message: MemcachedPeclBagOStuff,
    parser: MemcachedPhpBagOStuff

Change-Id: If069dec70eb31ed2dafe0e88ec4d4653005ff7e3
2014-04-01 11:03:56 +02:00
Alexandre Emsenhuber
d966a5266f Send the profiler output to the 'profileoutput' log group
And deprecate $wgProfileOnly in the same time.

This has the advantage of allowing profiler output to be separated
from the main debug log file; or even be completely disabled while
keeping the other debugging messages.

Also updated the checks in wfLogProfilingData() to detect the cases
where the output would not be sent anywhere to not execute the
last part of the method which would be useless otherwise.

Backward compatibility with installations having $wgProfileOnly
set to true is kept by moving the log file from $wgDebugLogFile
to $wgDebugLogGroups['profileoutput'] in Setup.php in that case.

Change-Id: I7b35195e527dfa7978b710126ed4599e75dab46b
2014-03-28 07:39:08 +01:00
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +00:00
jenkins-bot
5086bae49c Merge "Add two new debug log groups" 2014-03-14 22:18:27 +00:00
This, that and the other
6cbdf65b4f Add $wgLocalInterwikis to handle multiple local prefixes
This is akin to $wgSkipSkin/$wgSkipSkins. It is quite plausible for a wiki
to have more than one self prefix (e.g. enwiki has w: en: wikipedia: and
maybe others).

Some recent changes code seems to use $wgLocalInterwiki for quite unclear
purposes:
- I removed the line using $wgLocalInterwiki from the RecentChange
  class, as the 'lang' field of $mExtra is not used anywhere in core code.
  Extensions may use it, but it would seem more appropriate for them to
  use something like $wgDBname (or indeed to consult $wgLocalInterwikis
  directly) if they need to identify a particular wiki.
- In the IRC formatter, the first prefix in the array is used (if set).
  Appropriate documentation is added to DefaultSettings.php.

Related to bug 954 comment 3.

Bug: 954
Bug: 955
Change-Id: I9dbb566385b464402c5e78510b95dd2ffb4d9489
2014-03-12 13:32:07 +01:00
Antoine Musso
5b52c881be Deprecates $wgRateLimitLog in favor of debug log
$wgRateLimitLog is meant to log rate limiting occuring in MediaWiki. The
feature was introduced by e46d19e72d / r9202 in 2005.  We might not
have wfDebugLog() at that time and we used error_log() with the global
pointing to a file.  A later patch converted to file_put_contents().

On Wikimedia production the variable is set to a udp:// URL, I am not
sure file_put_contents() can write to it.  Additionally the warning are
suppressed which I tend to hate.

Instead use the log bucket 'ratelimit'.

For backcompabitilibity purposes, if $wgRateLmitLog is still set:
attempt to set $wgDebugLogGroup['ratelimit'] with its value.

Change-Id: I86131c4a8053800afd9f41fa1906c998a88736c6
2014-03-04 13:12:35 +00:00
Alexandre Emsenhuber
2744ecb520 Add two new debug log groups
So that they are easier to separate from the main debug log.
The two news are:
- 'autoloader' for messages sent by the AutoLoader class
- 'caches' for the list of cache types

Change-Id: Ifb6dc2666fec2323219bbfac94ab53a422e5312a
2014-02-26 20:45:33 +00:00
tinajohnson.1234
e7b85e720f Removed deprecated $wgDisabledActions
$wgDisabledActions is deprecated since 1.18 and is hardly used
anywhere. It occurs once in includes/DefaultSettings.php where
it is initialized to an empty array.And in Setup.php, for every
action in $wgDisabledActions $wgActions is set to false. Also
added Release notes

Bug: 60460
Change-Id: I5fab95c76b2742b12c1f397d27898148625a9959
2014-02-18 10:37:49 -08:00
Chad Horohoe
8f61a16900 Remove stubiness from AuthPlugin
The point of stubs is to delay loading tons of code as late as
possible. AuthPlugin is about the same size as StubObject, so
we're not really saving anything.

Change-Id: Icb36e47a8e9ff9f0f60ac1a8f1698102a1aa2366
2014-02-07 00:20:37 +01:00
Hashar
967dd32d07 Revert "Added some constants to speed up Setup.php"
This patch causes php maintenance/getConfiguration.php  to die with a fatal
error:

Fatal error: Call to a member function isItemLoaded() on a non-object
  in includes/GlobalFunctions.php on line 1268
 
Call Stack:
  1. {main}() maintenance/getConfiguration.php:0
  2. require_once('maintenance/doMaintenance.php')
       maintenance/getConfiguration.php:196
  3. wfLogProfilingData() maintenance/doMaintenance.php:116

When calling wfLogProfilingData() the $wgUser is undefined which causes the
fatal at:

  if ( $wgUser->isItemLoaded( 'id' ) && $wgUser->isAnon() ) {
    $forward .= ' anon';
  }
  
This reverts commit 2c9de255f7.

Change-Id: I093d8fbe2c08875808868d449a90b620cc6c94a6
2014-02-06 09:04:46 +00:00
Aaron Schulz
2c9de255f7 Added some constants to speed up Setup.php
Change-Id: I528b362d6ef3d07c6c301e7a1767a1be0fc93725
2014-01-25 04:37:32 +00:00
Aaron Schulz
875a597e7f Move BitmapHandler::canRotate() call out of Setup.php
* This was wasting 5ms on every request hit on test wiki

Change-Id: Ie7a5aa27593ab8e0d52fb00218345d1789da61a1
2013-12-21 21:44:30 -08:00
jenkins-bot
3bb1d6257e Merge "Removed deprecated functions and merged ProxyTools into GlobalFunctions" 2013-12-20 19:29:42 +00:00
Aaron Schulz
87ae5b2402 Added more Setup.php profiling
Change-Id: Ie76c1ae54ccf825f387b57a8e9096f608eb3d120
2013-12-16 21:18:38 +00:00
Aaron Schulz
6640bdf0d8 Removed deprecated functions and merged ProxyTools into GlobalFunctions
Kept wfGetIP() for now because it is still in use in the SecurePoll
extension and in WMF configuration.

Change-Id: Id412e37743f89bb67eb329a2f475f8496cf7b006
2013-12-16 12:54:16 +00:00
umherirrender
0bc583af2c Move closing parenthesis from multi line if and function to own line
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.

Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
2013-12-01 21:39:00 +01:00
umherirrender
5dbfd5bf80 Fixed spacing
- Removed trailing spaces in comments
- Removed multiple empty lines
- Removed space after object operator

Change-Id: I9fd3256ab490c7cd2034de3fd94e6be6e6d6d8f2
2013-11-21 18:52:25 +00:00
Victor Vasiliev
2961884b43 Provide a JSON recent changes feed.
This introduces a new configuration variable, $wgRCFeeds, which allows the user
to configure multiple destinations for RC notifications. It also allows the
notification format to be customized. Two formats are included by default: the
older IRC format and a new JSON format.

Change-Id: I270bde418a82985c94372ac4579100435b6ee026
2013-08-25 21:23:16 -07:00
Alex Monk
db51c53b8f Replace remaining sajax use
Bug: 40785
Change-Id: I4a0af8986f924cd127a73828e72da6998f28536c
2013-08-13 02:29:31 +00:00
Antoine Musso
e137df71af $wgHTCPMulticastRouting rename + multi hosts support
This patch does two things:

A) rename $wgHTCPMulticastRouting to $wgHTCPRouting since you can have
   MediaWiki send purge packets over unicast.
B) add support for multi hosts purge in the few cases one want to split
   the multicast groups per cache role but still want to purge more than
   one cache group.

A) rename

The rename adds deprecation notices in the comments and adds a back
compatibility layer in the case someone is already using this feature.
Given Wikimedia Foundation is not even using it, it is very unlikely,
but yet: better safe than sorry.

My logic is flawed sometime, so that needs a bit of review :) There is
two levels of deprecations to watch for:
- pre mw1.20 which useds $wgHTCPMulticastAddress and
  $wgHTCPMulticastPort
- pre mw1.22 (aka before this patch) that used $wgHTCPMulticastRouting

The resulting configuration should be properly loaded in $wgHTCPRouting.

B) multi hosts

The HTCP routing let you split purges to different hosts according to
the URL.  In some case, we want to be able to purge an URL from more
than one multicast group.  A Wikimedia example would be to send text
related purges to the text and mobiles caches while upload purges are
sent to the upload caches.

An abstracted example would be:

$wgHTCPRouting = array(

	// upload URLs to upload caches
	'/(upload|thumbs)/' => array(
		'host' => '<ip for upload caches>'
	),

	// Everything else to text & mobile
	'' => array(
		array( 'host' => '<ip for text caches>' ),
		array( 'host' => '<ip for mobile caches>' ),
	),

);

Change-Id: Ie87f6b81007f47f9cb439371743f3ad9a4b0c774
2013-07-31 16:07:05 +02:00
Timo Tijhof
40e18e4534 Installer: Remove wgResourceLoaderMaxQueryLength in LocalSettings
This can change from one web server to another. Hardcoding it
in LocalSettings is unnececary (and could even cause problems
when a MediaWiki install is moved to a server with a lower
limit than the original server, as ResourceLoader would still
be acting on the old limit).

Similar to how wgUsePathInfo is currently dynamically set.

The less cruft in LocalSettings by default the better imho.
Except for stuff that makes sense to be sticky, explicit and
cached. Or stuff that is every commonly enabled and is therefor
convinient (such as wgEnableUploads/wgUseInstantCommons).

Change-Id: I58cb185f8dc1650a76c60c7fd04767fb74b32be2
2013-06-05 16:07:17 +02:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
Timo Tijhof
1f956360b8 Deprecate $wgJsMimeType
It hasn't been used for its documented purpose for a while.
In fact the one significant thing it can cause wasn't even
documented. If set to anything other than "text/javascript"
it will cause action=raw to no longer respond to
ctype=text/javascript requests (such as done by wikibits'
importScript function).

Follows-up 97caae596d.

Change-Id: Ib04ff5b21eb0ae172b94e31bc0dc16c9649e1864
2013-05-21 01:17:44 +02:00
Daniel Friesen
97caae596d Drop support for XHTML 1.0
* $wgHtml5 = false; is now ignored completely.
* $wgDocType and $wgDTD have been removed.
* $wgXhtmlDefaultNamespace is now ignored.
* XHTML5 will be output if $wgMimeType is set to an XML mime type (according to HTML5's rules).
* For backwards compatibility with extensions $wgHtml5 and $wgXhtmlDefaultNamespace are set
  in Setup.php but depending on them is deprecated.

Change-Id: Iad9634e2ee420b5a3bbffe550421fde4fa1819b0
2013-05-15 23:09:25 -07:00
Tim Starling
1fe9340bb3 Remove hphpc support and deprecate related functions
hphpc has been superseded by hhvm, so support for hphpc is no longer
needed.

* Continue to use Preprocessor_Hash under HipHop since it is still
  faster under hhvm
* Keep $wgCompiledFiles for now, so that wikihiero doesn't give an error
  before Ic9d1e795 is merged
* Migrate the run-server script and associated configuration file to
  hhvm. Enable EnableStaticContentFromDisk since it doesn't seem
  ridiculously inefficient at first glance. Run from $IP rather than
  $IP/.. since hhvm is apparently not picky about sourcing files from
  outside of the current directory.

Change-Id: Ic3e769f1fbad4f7ad26dd819406796fee48c6b45
2013-05-09 08:28:05 +10:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
35572ce19e Remove duplicate code from Setup.php
Change-Id: I6dadb12ec8410258d7c9c24e1d12badf6c1c2dea
2013-04-20 16:25:15 +00:00
Chad Horohoe
f9e54577af Remove completely unused $wgRedirectScript/redirect.php
Change-Id: Ia624d65fbb1c787293054e12162b1444ab7c1edc
2013-04-01 18:29:42 +00:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Lee Worden
6881e5f365 Remove gaps from $wgFileExtensions array
If $wgFileExtensions contains values that are in $wgFileBlacklist,
when Setup.php uses array_diff to remove them it leaves $wgFileExtensions
as an array with nonconsecutive integer indices.

When this array is encoded by the Xml class, for use in client-side
JavaScript, the nonconsecutive indices cause it to encode it as an
Object rather than Array.  This breaks the extension processing in
UploadWizard's JS code.  To fix this, use array_values to remove the
gaps in indices.

Bug: 44776
Change-Id: I4ef7f1de90a0384800722839f3fa3a581c63bac9
2013-02-24 13:19:08 +00:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00