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
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
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
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
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
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
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
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
- Changed "#" to "//" for non-block comments
- Put the inline comment describing the file back
in the file description
Change-Id: I0aec0f4c10def58b608a8f08455fccb2317e4538
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
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
- 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
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
$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
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
$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
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
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
Kept wfGetIP() for now because it is still in use in the SecurePoll
extension and in WMF configuration.
Change-Id: Id412e37743f89bb67eb329a2f475f8496cf7b006
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
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
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
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
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
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
* $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
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
* 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
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
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