Commit graph

413 commits

Author SHA1 Message Date
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
Alexandre Emsenhuber
b65893755f Added new "byemail" action to the new users log
This allows to display the "password sent by e-mail." string in the user's language
since it's now in the action text rather than always in content language due to the
fact it was hardcoded in the log's comment.

Insertion of log entries for the new users log is now acomplished using the
ManualLogEntry class rather than the old LogPage one.

Removed 'newuserlog-byemail' message since it's no longer used (also checked
extensions in Wikimedia's Git repo).

IRC notifications will use the same message for 'create2' and 'byemail' for backward
compatibility. The only difference is that 'byemail' entries will no longer have
"password sent by email." in the comment.

Change-Id: Icdf1d714259d054cf8c256faf894c533be0dc73c
2013-01-25 16:15:33 +01:00
Tyler Anthony Romeo
8102bb87bc (bug 40679) Set $wgSecureLogin to false for $wgServers with schemes.
When $wgServer has a scheme, force $wgSecureLogin to false in order
to stop infinite redirects when trying to go to the login page.

Change-Id: I5792eb1a54c7b6279aad0531cedf9f7b4bf94e6e
2012-12-13 20:45:16 -05:00
umherirrender
cdbf6c434d Remove deprecated $wgAllowRealName
Deprecated since 1.16, which is out of lifecycle since August 2011

Change-Id: Ie48a4116eab9d07bc435ea9ce784762313b757cb
2012-10-05 20:53:22 +02:00
csteipp
f8710f255c (bug 33471) compare detectProtocol to 'https'
Extra ':' was added to the comparison string in gerrit change I6adc7e3e

Change-Id: I3ff7274f6aa006b5cb9dcc3d2c44721f25a0fc8f
2012-09-26 17:20:15 -07:00
Reedy
f6c21c607c (bug 38451) remove $wgAllowPageInfo
InfoAction needs a bit of work, so this might want to wait a little
while. The patch removes $wgAllowPageInfo which was used to enable the
action=info action (which was disabled by default).

https://gerrit.wikimedia.org/r/#/c/15847 is needed to disable the
counter query.

Change-Id: I467e688090919b627bf1fb124ef712821c2257f6
2012-08-31 18:17:51 +02:00
Tyler Romeo
71b03dd499 (bug 33471) Changed detection of secure cookies.
Changed code in Setup.php that checks whether or
not to use secure cookies. Previously it just
looked at $wgServer, which doesn't work with
protocol-relative URLs. Now it uses WebRequest::detectProtocol(),
which in turn checks $_SERVER.

Change-Id: I6adc7e3e9bd224608b13cbb748bdd2b61edaa764
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
2012-08-10 16:27:13 -04:00
Alexandre Emsenhuber
53b3c82fd7 Added WebRequest::getMethod() to get the HTTP method of the request.
This is to replace the usage of $_SERVER['REQUEST_METHOD'].

Change-Id: I45084254c5452b00b0665df78628cfd214e39cab
2012-08-07 18:28:43 +02:00
Niklas Laxström
357c9be1b1 Fix regression in API log events (bug 35635)
Patch set 2: Fixed minor typo (redier -> redir)

Change-Id: Ia38075db1e687f33b77c733994e0f19815444a78
2012-07-15 17:47:53 +01:00
Mark A. Hershberger
99fdc6e838 Bug 24985 use $wgTmpDirectory when available
We had two way to get a temporary directory:

 - $wgTempDirectory: more or less stable accross sessions
 - wfTempDir(): set through environnement variable and could potentially
   vary from a session to another one thanks to tempnam()

This patch makes wfTempDir() to always use the global $wgTempDirectory
first when it is available. Thus explicitly overriding tempnam() or any
environnement variable such as TMP or TEMP.

Hence, people who don't have access to a system wide directory
specificed by their environnement (such as /tmp) can specify an
alternative straight from the MediaWiki configuration.

The patch remove references to $wgTmpDirectory and replace them with
calls to wfTempDir().  Make wfTempDir() use $wgTmpDirectory first.

The default setting of $wgTmpDirectory was removed in favor of having it
initialized through Setup.php by calling wfTempDir.

Note: this may also address Bug 36475 - Generating thumbnails does not
work when there is no access to /tmp

Change-Id: Ifdc79e9c5d95f978025b237a5eeb95fd75092f46
2012-06-13 21:30:22 +02:00
Alexandre Emsenhuber
bc9d9f1f9c Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent and removed a duplicate comment from SpecialPageFactory.php in SpecialPage.php.

Change-Id: I99dd2de7fe461f2fad4e0bd315ebc2899958a90f
2012-05-10 17:51:44 +02:00
tstarling
42fcd43299 Remove request_with_session/request_without_session
Remove wfIncrStats() calls for request_with_session and
request_without_session. These cause a high load on the profiler and are
not currently needed for performance analysis.

Change-Id: I0ed1e87574c7c9eeaee4e503db86b862ff0995bb
2012-04-10 10:38:07 +10:00
Catrope
458f162b63 Merge "[LanguageConverter] Added some cache code based on the problems in r97512." 2012-04-09 22:25:24 +00:00
Aaron Schulz
0c2a0e4d6b Merged ImageFunctions.php into GlobalFunctions.php
Change-Id: I02d468f9c54a6a0448a6d99505d0201a7949855a
2012-04-06 16:43:27 -07:00
Catrope
edd81d2a5d Implement routing for HTCP purges
This allows HTCP purges for different domains to be sent to different
multicast groups, based on regexes. Mark requested this so we could
separate the multicast groups for upload caches and text caches.

This code is UNTESTED, I'm mostly submitting this as a proof of concept
and to invite review by other core devs (specifically Tim).

Change-Id: Ie333a04131d6ca8394884ed1054f2baff55ab2d1
2012-04-06 15:04:27 -07:00
Aaron Schulz
10f49bd065 [LanguageConverter] Added some cache code based on the problems in r97512.
* Added $wgLanguageConverterCacheType global to control LC cache type. We can use it to enable direct apc use for language converter (to match the live hack).
* Added $wgLangConvMemc object, available via Setup.php

Change 1:
* Updated unit tests
* Minor documentation cleanup in DefaultSettings.php

Change-Id: Icd5dd28407e9759ce294c784ec41d9ca15c89616
2012-04-06 13:26:17 -07:00
Alexandre Emsenhuber
15a4786f2f Make the first line of debug log more consitent between CLI and web call by putting the method and the URL directly on the first line 2012-03-19 20:52:59 +00:00
Alexandre Emsenhuber
73f6907199 * Put the timer stuff after leading line breaks in debug log entries (mainly for the first call on a request) so that they are placed near the remaing text and not on its own line
* Normalise line breaks in the first entry on a web request so that it's consistent with the one for command line requests
2012-03-12 19:01:44 +00:00
John Du Hart
6fd8ea4b3f Followup r105123, fix for MWDebug logging SQL queries on command line mode 2012-02-21 16:48:46 +00:00
Antoine Musso
7488eddb04 revert r111028 (attempt to fix bug 34254)
That patch was obviously wrong, it disabled compression for any
requests *blushes*  :-]
2012-02-12 19:33:52 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Antoine Musso
311bc79c88 (bug 34254) fix gzipped file cache double compressing output
A gzipped file cache is enabled by setting $wgUseGzip and $wgUseFileCache.
To save CPU cycles, HTMLFileCache would print the compressed output as is
but WebStart uses an ob_gzhandler so we end up with a double compression.
2012-02-09 11:02:36 +00:00
Aaron Schulz
67ac87beba Disable $wgDebugToolbar if file cache is turned on, as with $$wgShowIPinHeader 2012-02-07 21:30:41 +00:00
Alexandre Emsenhuber
a172d738eb Recommit r110758 (again) now that the problem has been fixed in r110761 2012-02-06 17:34:33 +00:00
Antoine Musso
5912473690 reverts r110488
Breaks maintenance/rebuildFileCache.php with stack trace saying that
FauxRequest::getRequestURL() not implemented

Backtrace:
#0 includes/WebRequest.php(1261): FauxRequest->notImplemented('FauxRequest::ge...')
#1 includes/debug/Debug.php(266): FauxRequest->getRequestURL()
#2 includes/Skin.php(561): MWDebug::getDebugHTML(Object(RequestContext))
#3 includes/SkinTemplate.php(461): Skin->generateDebugHTML()
#4 includes/OutputPage.php(1982): SkinTemplate->outputPage()
#5 maintenance/rebuildFileCache.php(119): OutputPage->output()
#6 maintenance/doMaintenance.php(105): RebuildFileCache->execute()
#7 maintenance/rebuildFileCache.php(146): require_once('/srv/trunk/main...')
#8 {main}
2012-02-06 16:42:58 +00:00
Alexandre Emsenhuber
4d9259d36d Recommit r109062 (Only run some MWDebug code when really needed) but leaving the addition of ResourceLoader module inside the MWDebug class this time 2012-02-01 15:48:12 +00:00
Aaron Schulz
8d5837cc27 Reverted r109062 per code slush (also has a CR complaint) 2012-01-19 02:26:10 +00:00
Alexandre Emsenhuber
7e16cba902 Only run some MWDebug code when really needed:
* Add the mediawiki.debug module from OutputPage::addDefaultModules() along with other modules
* Get the request information when building the JS output instead of in Setup.php
2012-01-16 21:29:05 +00:00
Antoine Musso
ff39c31a97 Move MWDebug enabling logic to Setup.php
MWDebug initialization method was made to look up for a global variable. This
patch move the logic to Setup.php so we can replicate it when doing tests.

Side effect, MWDebug is disabled by default. Users will explicitly have to
enable it by using init().

Ping r105123
2012-01-16 13:44:46 +00:00
Alexandre Emsenhuber
66587c2574 No need to do the safe_mode check on every request in $wgAdditionalMailParams is set; that variable will not be passed to mail() if safe_mode is enabled since r99411 2012-01-14 14:53:32 +00:00
Niklas Laxström
63407b7112 Revert r107835 - breaks my wiki "unknown function' 2012-01-02 18:26:09 +00:00
Chad Horohoe
cd205aedf1 remove an extra space 2012-01-02 15:34:35 +00:00
Chad Horohoe
e5167d224b simplify r107833 per CR, just use wfExpandUrl() 2012-01-02 15:31:28 +00:00
Chad Horohoe
b582210a4e Revert r107042 (bug 32219, make InstantCommons protocol-relative) and do it properly + release notes.
apibase is used for fetching content from the server as well as determining description pages, so should use a full-qualified protocol when the site's in https.
2012-01-02 14:38:19 +00:00