Commit graph

492 commits

Author SHA1 Message Date
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