Commit graph

617 commits

Author SHA1 Message Date
This, that and the other
ea335eb55d Improved personal toolbar for logged-out users
Previously, logged-out users either only saw "Create account" and "Log in"
links in the personal area, or if $wgShowIPinHeader was true, they saw

  [icon] 127.0.0.1  Talk for this IP address  Create account  Log in

where the IP address itself linked to the IP user page.

Now, logged-out users by default see the following:

  [icon] Not logged in  Talk  Contributions  Create account  Log in

The old $wgShowIPinHeader feature is removed. It is very unfriendly to
show the user's IP address (in red, no less) at the top of every page,
since this will mean nothing to most visitors. Caching means that this
can't even be done reliably, anyway.

Another improvement is that the "talk" and "contributions" links are not
shown if anonymous users don't have the 'edit' right.

Modelled after the loggedOutTalkPage() function at Dutch Wikipedia
<https://nl.wikipedia.org/w/index.php?oldid=44706954>

Bug: T112724
Change-Id: I6f44e3e5d97ea917e4a03af47f3795792e4ca122
2015-12-01 18:44:52 +00:00
Bryan Davis
a914de4041 Remove deprecated wgRateLimitLog
Remove the backwards compatibility shims for $wgRateLimitLog which was
deprecated in 1.23 (I86131c4).

Change-Id: I771bbaff43b44d011bff81ddda4f35166ea5f77e
2015-11-17 22:07:47 +00:00
Bartosz Dziewoński
6fb44cf116 Really validate that $wgArticlePath starts with a slash
The regular expression wasn't entirely correct.
Follow-up to a4a3d04540.

Bug: T48998
Change-Id: I08bdf2db20c1c3de55527fc812bcbb55fa23f7bc
2015-11-11 23:01:18 +01:00
JuneHyeon Bae
a4a3d04540 Validates wgArticlePath does start with slash (/).
When relative URL used in $wgArticlePath, and $wgArticlePath does not
start with slash (/), raise FatalError.

Bug: T48998
Change-Id: Ic7cd6f774cff97081f4f35af351161170b4b26eb
2015-11-10 17:59:20 -05:00
Aaron Schulz
5cb16e7711 Mention main WAN and stash instances in cache debug statement
Change-Id: Ic98ce5aecc093400f23d3595be75df3bf54268bf
2015-11-09 22:41:04 -08:00
Bartosz Dziewoński
ed6648427a Work around broken HHVM ini_get() for 'upload_max_filesize' and 'post_max_size'
In HHVM, the settings 'upload_max_filesize' and 'post_max_size' are
not available via ini_get() due to some long-standing bug
(https://github.com/facebook/hhvm/issues/4993). Instead, one can use
'hhvm.server.upload.upload_max_file_size' and 'hhvm.server.max_post_size'
(in a typical PHP fashion, their names are subtly different than the
originals as to increase the potential for confusion).

Added a new method UploadBase::getMaxPhpUploadSize() to handle this.

Additionally:
* 'post_max_size' can be set to 0, which is equivalent to no limit.
  Handle this correctly.
* $wgMaxUploadSize can be an array structure, instead of just a number.
  Handle this correctly by using UploadBase::getMaxUploadSize().
* When no maximum is set, use PHP_INT_MAX rather than 1e100. It should
  be big enough, and the latter is a float, results in 0 when cast to
  int, and doesn't look as pretty when formatted in GB in the interface.

Bug: T116347
Change-Id: Idf707253eeae1b90792a7e26d2ab66d1317e67ae
2015-11-08 19:48:23 +00:00
Federico Leva
c5f80a4af5 Hotlink InstantCommons images by default to speed up parsing
The configuration, tested on wiki.wikimedia.it, generally improves
performance for all parties involved.

Bug: T114098
Change-Id: I76a34e8782908a28523531b2a928ea4ef7710b19
2015-11-06 20:29:04 +01:00
Bartosz Dziewoński
d2c5298a71 Setup.php: Remove incorrect comment
This is not true since $wgSkinExtensionFunctions was removed in r87487.

Change-Id: Ia2c75aa191516fa43272ed51789579cf7afd9e37
2015-10-23 20:50:34 +02:00
csteipp
59b627b0b7 SECURITY: API: Improve validation in chunked uploading
This fixes a few shortcomings in the chunked uploader:
* Raises an error if offset + chunksize > filesize.
* Enforces a minimum chunk size for non-final chunks.
* Refuses additional chunks after seeing a final chunk.
* Status of a chunked upload in progress is now available with
  'checkstatus'.

Bug: T91203
Bug: T91205
Change-Id: I2262db1bc8460616b069c564475d2e4148001768
2015-10-16 14:10:44 -07:00
Ori Livneh
7628a11d8e Remove .php5 entrypoints and $wgScriptExtension
* The '.php5' entrypoints were deprecated in I68b1ae842, $wgScriptExtension
  in I3690f78bc.
* Drop the associated ResourceLoader configuration variable, too. `mwgrep`
  shows no usage in the MediaWiki namespace.
* Keep the scriptExtension configuration parameter for FileRepo for people who
  would like to interoperate with older MediaWiki installations that still use
  '.php5'.

Change-Id: I17c8a15484b7e82cd5970d34e688109a2aae3840
2015-10-08 15:45:31 +01:00
Aaron Schulz
cc4ca3e86d Removed deprecated $wgDeferredUpdateList
Change-Id: I7072ad3b34dd9a0726df6d1c044616c3b4bcd79f
2015-09-21 16:30:16 -07:00
Timo Tijhof
583fdd54ad Support empty string for wgEmergencyContact/wgPasswordSender
In previous versions, the installer often outputted the following
in the generated LocalSettings.php:
> $wgEmergencyContact = '';
> $wgPasswordSender = '';

While this case did not result in providing default values in recent
MediaWiki versions, the mail handling didn't cause an error.

As of MediaWiki 1.25, the error handling is more strict and these
values being empty causes a fatal error and breaks all outgoing mail.

Bug: T104142
Change-Id: Ibf1f857b2f250dac9b725aff8f442e08b8ecd5c9
2015-09-02 12:10:18 +00:00
Timo Tijhof
31b41c535b Use wgResourceBasePath instead of wgScriptPath for wgStylePath etc.
This make re-configuring these much easier by only needing to update
one variable instead of four.

Also remove redundant hardcoding of wgStylePath and wgResourceBasePath
in the generated LocalSettings.php file during installation. This way
changing wgScriptPath will naturally result in the other variables
updating too. We already do this for many other variables (such as
wgLoadScript, wgScript, wgExtensionAssetsPath, etc.).

Change-Id: Ide74355b4054c78214c17f3b2d6fa2f5270e0ab9
2015-09-01 18:18:03 +02:00
C. Scott Ananian
f5c874cbaf Use Parsoid v3 API; emulate the RESTBase v1 API
Update the ParsoidVirtualRESTService and the
RestbaseVirtualRESTService to use Parsoid's v3 API, instead of the
deprecated v1/v2 APIs.  Since Visual Editor still issues requests
using the Parsoid v1 API, convert Parsoid v1 API requests into Parsoid
v3 API requests when needed for a smooth transition.  We also add
support for converting RESTBase v1 API requests to Parsoid v3 API
requests.

The next step will be to convert Visual Editor to issue RESTBase v1
API requests (https://gerrit.wikimedia.org/r/217995), and then the
Parsoid v1 conversion code added here can be removed (T100681).

Tested Parsoid v1->v3 conversion, Parsoid v1->RESTBase conversion,
plus Parsoid v3 and RESTBase v1->Parsoid v3 conversion using VE
patched to issue RESTBase v1 API requests.

Bug: T100681
Change-Id: I07ac60cdec7a52ef93187d40099325a069e3239a
2015-08-27 18:41:23 -04:00
Timo Tijhof
86c701f290 objectcache: Remove use of deprecated $wgSessionsInMemcached
Deprecated since MediaWiki 1.20.

Change-Id: I3b431714e0d2b21b3911c80bbf2b4b4868634510
2015-08-24 22:11:22 +02:00
Ori Livneh
8338476b8e Create a subdirectory for compatibility stubs
Instead of littering includes/ with stub back-compat aliases, house such
classes in includes/compat/.

Change-Id: I4c1b83e35c8d6c18777a4a3e17d81023915cfb7f
2015-06-29 19:27:13 +00:00
Mark A. Hershberger
364f0b716d Allow extensions to set $wgDisableCounters.
Alternatively, removing this completely might surface the issue for users
more quickly.  Without this change, resolving {T74420} becomes more of an issue.

Bug: T74420
Change-Id: Ib2dc9ed56a945acb06b64f3b85ff07ac2a6b7600
(cherry picked from commit 6b4d6662b5b5005bb84f4c5e6315288611bf57f1)
2015-06-27 04:31:25 +01:00
umherirrender
d8821f2b0b Fixed spacing
- Removed space after casts
- Removed spaces in array index
- Added spaces around string concat
- Added space after words: switch, foreach
- else if -> elseif
- Removed parentheses around require_once, because it is not a function
- Added newline at end of file
- Removed double spaces
- Added spaces around operations
- Removed repeated newlines

Bug: T102609
Change-Id: Ib860222b24f8ad8e9062cd4dc42ec88dc63fb49e
2015-06-17 20:22:32 +00:00
Vivek Ghaisas
9f5b6f5aeb Fix whitespace issues around parentheses
Fix issues found by MediaWiki.WhiteSpace.SpaceyParenthesis sniff.

Bug: T102617
Change-Id: Iec7f71e64081659fba373ec20d9d2006306a98f4
2015-06-16 22:14:02 +03:00
Gergő Tisza
8517b3cb22 Fix InstantCommons - HTTP access to Commons does not work anymore
Bug: T102562
Change-Id: Ie0b4ec179b9ccd13015c9bcbfa5c9917ff26de36
2015-06-15 22:55:50 +00:00
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
csteipp
1a20dc9362 Password validity by policy per group
Make password policies defined in a configurable policy, which is
defined by group. A user's password policy will be the maximum of
each group policy that the user belongs to.

Bug: T94774
Change-Id: Iad8e49ffcffed38df6293db0ef31a227d3962003
2015-06-10 10:34:17 -07:00
Aaron Schulz
8194b2014b Deprecate $wgEnableParserCache
* There is little reason to disable it and one can set $wgParserCacheType
  if truly needed

Change-Id: Iec5fc7729d0f9de67ec2aa6c0e9c2c1e3e0d57ad
2015-06-04 19:23:03 +01:00
Ori Livneh
4b672d434b Follow-up for I68b1ae842: Deprecate $wgScriptExtension as well
Change-Id: I3690f78bc57030d3f1e3992554ba0ae7eb393273
2015-05-11 18:17:04 +00:00
Ed Sanders
cf2678e24d Allow override of extension directory
Also sets default paths immediately (not in Setup.php) so
they are available before extensions register.

Bug: T98319
Change-Id: I41a8aec7a3e9c576ec7344abf51f8106248ade4b
2015-05-06 19:22:55 +01:00
Timo Tijhof
b391983f14 Make $wgDBerrorLogTZ actually default to $wgLocaltimezone
Change-Id: I6ef84bf6b91a6783d1ff1c3dd0c4016ebf076367
2015-04-29 04:06:43 +00:00
Aaron Schulz
d61244e4f9 Automatically set $wgMainWANCache by default using $wgMainCacheType
Change-Id: If1ad62e4d1f84e01cd4fea04c6dd568c9d290178
2015-04-24 01:37:04 -07:00
Chad Horohoe
58a9df7571 Don't profile setting up the temp directory
It's boring and profiling of wfTempDir() will already catch it

Change-Id: If4b489eb665af329fa9e3cb9b3e9913832b83862
2015-04-23 10:31:18 -07:00
Timo Tijhof
15765a295f Deprecate .php5 file extension
Hello, 2015.

Change-Id: I68b1ae842840be5aba62ca670f6af4e8de380869
2015-04-22 11:54:58 -07:00
jenkins-bot
7308c4d8de Merge "Change default of $wgResourceLoaderMaxQueryLength to 2000" 2015-03-27 22:45:56 +00:00
Jan Zerebecki
cbce504c3d Change default of $wgResourceLoaderMaxQueryLength to 2000
The lowest commonly supported length is a bit over 2000.  That is the limit of
Internet Explorer.  For discussion of the IE limit see
http://blogs.msdn.com/b/ieinternals/archive/2014/08/13/url-length-limits-in-internet-explorer.aspx .
Some servers only support 4k.

Having it unlimited does not work when running qunit jenkins test jobs of the
Wikibase extension or when running its qunit tests in vagrant, because it hits
the nginx limit.

This also adds a mw.track call for when the request split happens.

Bug: T90453
Change-Id: Ic416def846f361425c46f7bd1022ed85fa8ac85e
2015-03-27 23:23:06 +01:00
Chad Horohoe
9971834131 Delay language conversion cache construction until needed
Instead of instantiating this on every single request. Removes
wfGetLangConverterCacheStorage() and $wgLangConvMemc which were
otherwise unused.

Change-Id: Ic500944a92c2a94bc649e1b492c33714d81dca00
2015-03-03 21:12:28 -08:00
Kunal Mehta
c8900f30af Move includes/normal to includes/libs/normal
Change-Id: Ib530ad9dbe1d3a33dc53ef8b9620f61d4e1a2d62
2015-01-29 00:00:35 +00:00
Kunal Mehta
72df08286a Only try to load UtfNormalDefines.php once
It's already loaded in Defines.php, so no need to do it again

Change-Id: Ie6f3bf3fbbcbaadd85cfc8e54527b93e98f7b898
2015-01-28 20:39:30 +00:00
Brion Vibber
f0f2435db2 Add HiDPI PNG variants for 'Powered by MediaWiki' footer icon
Added 1.5x and 2x-density variants of the 'Powered by MediaWiki' footer
icon, built from this SVG version on Commons:

  https://commons.wikimedia.org/wiki/File:Powered_by_MediaWiki.svg

Note the SVG version is too large to use directly right now as it
contains a huge amount of detail; the PNGs are only a few KiB.

Renderings from Commons taken and run through pngcrush.

Note that adding 'srcset' attributes to footer icons appears to work
just fine here, so can be done for others.

Bug: T65872
Change-Id: I785d21add456eeddb6ed1ee36a1906d178323e63
2015-01-23 21:27:24 +00:00
Aaron Schulz
69998a7e0d Converted some profiling to scopedProfileIn
Change-Id: I63eb315155ef03d20a2d228c2be07a24baa0c278
2015-01-07 21:03:02 -08:00
Kunal Mehta
bfe4ddd810 Implement extension registration from an extension.json file
Introduces wfLoadExtension()/wfLoadSkin() which should be used in
LocalSettings.php rather than require-ing a PHP entry point.

Extensions and skins would add "extension.json" or "skin.json" files
in their root, which contains all the information typically
present in PHP entry point files (classes to autoload, special pages,
API modules, etc.) A full schema can be found at
docs/extension.schema.json, and a script to validate these to the
schema is provided. An additional script is provided to convert
typical PHP entry point files into their JSON equivalents.

The basic flow of loading an extension goes like:
 * Get the ExtensionRegistry singleton instance
 * ExtensionRegistry takes a filename, reads the file or tries
   to get the parsed JSON from APC if possible.
 * The JSON is run through a Processor instance,
   which registers things with the appropriate
   global settings.
 * The output of the processor is cached in APC if possible.
 * The extension/skin is marked as loaded in the
   ExtensionRegistry and a callback function is executed
   if one was specified.

For ideal performance, a batch loading method is also provided:
 * The absolute path name to the JSON file is queued
   in the ExtensionRegistry instance.
 * When loadFromQueue() is called, it constructs a hash
   unique to the members of the current queue, and sees
   if the queue has been cached in APC. If not, it processes
   each file individually, and combines the result of each
   Processor into one giant array, which is cached in APC.
 * The giant array then sets various global settings,
   defines constants, and calls callbacks.

To invalidate the cached processed info, by default the mtime
of each JSON file is checked. However that can be slow if you
have a large number of extensions, so you can set $wgExtensionInfoMTime
to the mtime of one file, and `touch` it whenever you update
your extensions.

Change-Id: I7074b65d07c5c7d4e3f1fb0755d74a0b07ed4596
2015-01-08 01:40:01 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Aaron Schulz
7dba64f2c1 Revert "Remove deprecated profiling config parameters, clarify docs"
StatCounter still needs $wgUDPProfilerHost.

This reverts commit 88c42dc1df.

Change-Id: I4a56f6fb6bc454d15a9dc752f45dfb29b2b47a84
2014-12-04 21:40:13 +00:00
Chad Horohoe
88c42dc1df Remove deprecated profiling config parameters, clarify docs
We've already broken profiling completely in this release. Make
this abundantly clear in the RELEASE-NOTES and just remove the
awful back-compat attempt from I2af28cd3 and I49c0a83e.

Change-Id: Ib0b87192e2a6e87db19f7821906dd7b2063081e3
2014-12-04 12:51:19 -08:00
umherirrender
3f03ae6623 Set default value for $wgSharedSchema
Was added in I25df82065a307b9abc30c694f8c8afff0996d7c1 back in REL1_23

Change-Id: I291e770861751e037befe1db004e5e3f8b449f6c
2014-11-15 21:25:55 +00:00
Chad Horohoe
90d90dad6e Remove hitcounters and associated code
The hitcounter implementation in MediaWiki is flawed
and needs removal. For proper metrics, it is suggested to use
something like Piwik or Google Analytics.

RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: I0e5006a7e8a09c800f8fa4effa9399e8afdd7a57
2014-10-20 13:01:55 -07:00
jenkins-bot
596e959d23 Merge "Add API output skin" 2014-09-24 15:20:41 +00:00
Brad Jorsch
55071b5bd9 Add API output skin
The API output for help and 'fm' formats will soon have need of
including ResourceLoader modules on an otherwise-bare page. The easiest
way to do this is to use OutputPage, but that requires a skin. So let's
add a skin that outputs a basic page without any navigation elements or
other chrome (that may be added later, but that can wait for Design to
decide they want to design it).

Change-Id: Ifa95fae5acaa3cfbf2ca58a15f8d0c51d84b455a
2014-09-24 11:07:57 -04:00
Bartosz Dziewoński
96b3dd0ae3 Move default logo to resources/assets/ directory
The problem here is that the path to 'wiki.png' is saved in users'
LocalSettings.

We likely should not remap the path, like we did for footer license
icons in Ic7c32e56:

* It's likely that users changed their logo image by overwriting the
  file in skins/common/.
* If the normal upgrade process is followed (overwrite-uploading new
  files), the old file will still be there with the skins/common/
  directory.
* If it does cause problems, they'll be rather easy to notice and fix.

On the other hand, maybe we should?

* This is going to be annoying for git users.
* It will bite anyone who deletes all MediaWiki files when upgrading
  via tarball, which is more likely with the recent skin system
  changes encouraging users to remove old cruft from skins/ directory.

Bug: 69277
Change-Id: I175fe57048ebf9d348fb2fe67bf62cf5df389003
2014-09-20 20:45:50 +00:00
Roan Kattouw
ef26c7ad4f Followup 1cf5a6e: use $wgResourceBasePath to refer to resources/assets, not $wgScriptPath
Bonus: actually make $wgResourceBasePath default to $wgScriptPath, rather than
special-casing it in ResourceLoaderFileModule.

Change-Id: I608435cef00d3e77a5bbdb0a0122d3e7e1a4eb78
2014-09-17 16:21:28 -07:00
Bartosz Dziewoński
1cf5a6e9d3 Move assets/ to resources/assets/
While it's "semantically" incorrect (these files are not
ResourceLoader resources), putting them in that subdirectory is a lot
less hassle than introducing a new toplevel directory.

Follow-up to 2b4b9a3f. Discussion that resulted in the toplevel
assets/ took place on I6268d663 (now abandoned).

Change-Id: Iedbfd802457fe35803899e3479540177760ec30b
2014-09-17 21:39:03 +02:00
jenkins-bot
98f6ef4c22 Merge "Move footer icons to assets/ directory" 2014-09-14 12:19:10 +00:00
Aaron Schulz
16a9dd96bd Merge "Group E-mail settings stuff in Setup.php" 2014-09-12 22:37:05 +00:00
Bartosz Dziewoński
679bc3040c Move footer icons to assets/ directory
poweredby_mediawiki_88x31.png is straightforward, just need to update
some paths.

The six license icons are more problematic, as the paths to them are saved
in users' LocalSettings. We're remapping them in Setup.php.

Bug: 69277
Change-Id: Ic7c32e56043cfbf94ef2271de4ff41ef18fbeee7
2014-09-09 14:29:57 +02:00
umherirrender
b0cfcd0fcb Add missing @return and @param to doc blocks
Change-Id: I9d99ba1968ed8f97624d957754c8847dfe1b41da
2014-08-27 21:57:45 +02:00
umherirrender
63dc5abc9a Fixed spacing
- Added space after reserved words: function, foreach, if
- Combined 'else if' into elseif
- Added braces to one-line statements
- Added spaces after comma, before parentheses

Change-Id: Ie5bbf680d6fbe0f0872dab2700c16b1394906a72
2014-08-27 18:31:50 +02:00
Kunal Mehta
696a87d7f1 Deprecate $wgDeferredUpdateList
Callers should instead use DeferredUpdates::addUpdate. The
function is superior because it is able to enforce type-hinting
rather than throwing a fatal error. Also it's not a global :)

The only extension still using the global is FlaggedRevs,
for which I've submitted I1a7c6540b2.

Change-Id: Ic59c90c0d0131039295bd785280dc70ebde6e40f
2014-08-23 22:41:26 -07:00
Alexandre Emsenhuber
beacdcb55c Move debug log related settings up in Setup.php
Since this doesn't rely on functions defined in GlobalFunctions.php;
this can be in the first "defaults" section of the file.

Change-Id: I24f1a14322d90d053adf51716516001477364e16
2014-08-16 21:31:56 +02:00
jenkins-bot
ab972997ee Merge "Remove various functions and globals deprecated since 1.22 from RecentChange" 2014-08-14 18:06:35 +00:00
jenkins-bot
3c64eb81bd Merge "Don't set the session name in CLI or when sessions are deactivated" 2014-08-13 22:30:55 +00:00
Kunal Mehta
b683888119 Pass $name to default Skin constructor for backwards-compatability
This feature was necessary when it was only possible to specify the
name of the class a skin used, this was the only way for one class to
dynamically serve multiple skins (such as if the skins were purely
template based with no PHP or if one skin had different themes to it).
It also provided an option for other skins to set $this->skinname dynamically.

See code review on I5c442f3c9e.

Change-Id: I7315fadf2e26d164ccc4f47b6d883945fa2570da
2014-08-13 13:45:56 -07:00
jenkins-bot
17d17ea470 Merge "SkinFactory: register skins in Setup.php" 2014-08-13 18:56:53 +00:00
Kunal Mehta
1154e1848f SkinFactory: register skins in Setup.php
This un-makes $wgValidSkinNames a legacy thing, and is
more backwards-compatible friendly.

Change-Id: I5c442f3c9e4ee7a4a3980fd02138ee756ef9fa7a
2014-08-13 13:43:09 +02:00
withoutaname
557b2cf3ef Remove various functions and globals deprecated since 1.22 from RecentChange
Change-Id: I5200892e75ffa894133e2e386d53c09536547de9
2014-08-12 22:19:36 -07:00
withoutaname
0eed71b776 Remove deprecated $wgHTCPMulticastAddress, $wgHTCPMulticastRouting and $wgHTCPPort
Change-Id: Icfbc178d823e59f2e305cbc4bca0b194d2786026
2014-08-12 21:52:40 -07:00
Krinkle
8153489b57 Revert "Revert "Stop always loading MonoBook and Vector""
This reverts commit ad849a2b46.

Change-Id: Ibfed909ede8ad657326d23b02b9481ffaf44b026
2014-08-07 15:05:56 +00:00
Krinkle
ad849a2b46 Revert "Stop always loading MonoBook and Vector"
This reverts commit aef99727f6.

Change-Id: Ic2b1c8336fb4378db2a5012ad60f04869b20cb09
2014-08-07 15:03:29 +00:00
Bartosz Dziewoński
aef99727f6 Stop always loading MonoBook and Vector
Removing the hack added in Ib4bdda5e.

This will cause an error message to be shown to almost every MediaWiki
user who upgrades their installation (including us developers) until
they add entries for their skins to LocalSettings. This is deemed an
acceptable trade-off, and the message makes it easy to resolve the
issue.

Bug: 68402
Change-Id: I2596ef73088ce94d78ce3dc3ae4da9d81023a2cb
2014-08-07 14:06:34 +00:00
Bartosz Dziewoński
0b191ba970 Use a special fallback skin when selected skin is unavailable
It just displays a helpful message that explains why and how to
install and enable skins. There is no navigation nor other basic page
elements (like the logo or site notice), since this is not intended to
be a fully functional skin.

Bug: 68332
Change-Id: Id14fbb8733cd8fbb912a724ac658f5e7244364b5
2014-08-06 16:41:36 +00:00
Alexandre Emsenhuber
b87c3f8364 Group E-mail settings stuff in Setup.php
- Move the overrides of e-mail settings along with other
  configuration corrections instead of being near global object
  definitions
- Also force $wgUseEnotif to false if $wgEnableEmail;
  previously it could remain true since $wgEnotifUserTalk
  and $wgEnotifWatchlist were forced to false after they
  were checked to set $wgUseEnotif
- Also put the removal of 'enotifminoredits' preference nearby

Change-Id: I9af6bb78d34ce053fc36eaa7cc3852de3ecbee8e
2014-08-04 21:59:25 +02:00
Alexandre Emsenhuber
e71939297e Don't set the session name in CLI or when sessions are deactivated
It doesn't make much sense to set the session name in that case.

Change-Id: I4cf237d79061d146091c3409b7ac3e19136f3fb6
2014-08-04 21:51:58 +02:00
Alexandre Emsenhuber
bd0285ea85 Remove useless temporary variable in Setup.php
Also makes the definition of $wgLocalFileRepo consistent.

Change-Id: I6fc7a6e938699ded90eca577dd005a77466cbeee
2014-07-31 21:17:42 +02:00
umherirrender
4ee680a8b3 Fixed spacing
- Removed spaces after not operator (!)
- Removed spaces inside array index
- use tab as indent instead of spaces
- Add newline at end of file
- Removed spaces after casts

Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b
2014-07-24 11:53:04 +02:00
Rohan
3b57bd5fca Removes deprecated $wgUseCommaCount variable
Also sets the default value of $wgArticleCountMethod to 'link'

Bug: 60454
Change-Id: I31c3fe837b59e693d03ed403c8cb52e50beccddf
2014-07-11 07:34:03 +00:00
withoutaname
5842d0aa07 Remove $wgFileStore
Change-Id: I58cf67ac1f2754a472b49b0b6d7f2b289deb2d4a
2014-07-10 18:27:39 -07:00
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
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