Commit graph

475 commits

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