Commit graph

133 commits

Author SHA1 Message Date
Kai_WMDE
f6879ea16e Enable users to watch category membership changes
Bug: T9148
Change-Id: I5a89d8f19804b1120f4c755d834e2da6ca12ceae
2015-08-13 17:58:06 +02:00
Aaron Schulz
6e283d394f Formally defined IDatabase and made a few Database methods protected
* IDEs can now make sense of IDatabase, which is useful for
  lazy connections. The interface might also help lower coupling.
* This also updates DBConnRef, which implements IDatabase
* Some discouraged methods are left out of IDatabase.
  These methods either encourage manual query building,
  are only needed by the updater, are obscure/unused,
  or either wise encourage bad practice. DBConnRef still
  supports these if called to avoid breakage though.

Change-Id: Ia83530820f185415725c1d5f54b5172121b4938f
2015-07-02 12:26:30 -07:00
Max Semenik
b1876e3dd7 API: Remove WDDX and dump formats
Per RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Ditch_crappy_API_formats

Change-Id: I4c9e64875be509906021255d70b90688f2e5ddf3
2015-07-01 11:43:39 -04:00
Kunal Mehta
fa31bf1675 Add Special:ChangeContentModel
Special:ChangeContentModel allows for users with the 'editcontentmodel'
right to change the content model of a page.

Visiting Special:ChangeContentModel will contain an input field for a
page title. The user will then be sent to
Special:ChangeContentModel?pagetitle=<input> where the page title is
read only, with a content model selector and optional reason field.

The special page only allows converting between content models that
extend TextContent for simplicity. Advanced conversions should be done
via the API.

All content model changes via the special page or API generate a null
revision in the page history and a log entry at
Special:Log/contentmodel. The log entry has a revert link for
convenience (like the move log).

Bug: T72592
Co-Authored-By: Lewis Cawte <lewis@lewiscawte.me>
Change-Id: I296a67c09fcbc880c8c3a648eb5086580725ea46
2015-06-30 13:14:50 -07:00
Roan Kattouw
85e7751452 Add a PHP implementation of TitleInputWidget
From the PHP side it's really just an infusable TextInputWidget.

Change-Id: I607339c2e967e502f85164c9b1ea79dc0a17c9cc
2015-06-30 00:03:27 +00: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
btongminh
9c8f333eb8 Basic support for WebP
Adds basic image size detection for WebP and support in the
MediaHandler. Currently renders WebP files as PNGs, because that
handles transparency.

Bug: T50519
Change-Id: I3c00653a8a034efc3f6b60fe62b7ac2e5391f921
2015-06-26 19:38:38 +00:00
Florian
fd10cd5b95 Use HTMLForm for Special:Export
* Transform all input fields to use HtmlForm as preparation for enabling
  MediaWiki UI eveywhere.
* Remove protected whitespace for HTMLCheckField (adds empty line to div-layout)
* Add a new HTMLForm input field "Text with Button" and "Namespaceselector with Button"

Bug: T73434
Change-Id: I53cc019c3ca94cec8f3c05500d0c604c1af7f688
2015-06-14 16:48:26 +00:00
Fred Emmott
c403d4838d Add LCStore implementation that uses static arrays in PHP files
Implementation written by Fred Emmott of Facebook. Quoting Fred:

As well as array access being faster, the main advantage is actually
that this significantly reduces the use of unserialize(), which does a
lot of memcpys when making the strings.

Benchmarks compared to LCStoreCDB:
* HHVM (no repo-auth): ~7% improvement
* HHVM (with repo-auth): ~12% improvement
* PHP7: ~1% improvement

My (Legoktm) brief testing noted that the generated PHP files were
noticiably larger than the CDB ones:
* 1.5M	en.l10n.php
* 932K	l10n_cache-en.cdb

Bug: T99740
Change-Id: Ib2c5856d40cd928cab4a79cb935b3ce08c598300
2015-06-11 18:14:51 +00:00
jenkins-bot
9ce9ca079f Merge "Password validity by policy per group" 2015-06-10 17:46:20 +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
Timo Tijhof
2dd9ec21dc mediawiki.jqueryMsg: Phase out redundant data module and minor clean up
Follows-up 4a3e50a54.

* Merge mediawiki.jqueryMsg.data and mediawiki.jqueryMsg modules.

  There's no need for this to be a separate module. The data is not for public consumption,
  it's provided to jqueryMsg only.

* Remove unused default-default values for 'allowedHtmlElements'.

* Remove conditionals around data providing at initial run-time. Instead, expose
  private method can call that. This way, we don't have two code paths claim
  ownership over the namespace. And it makes the module easier to test and re-use
  by not requiring the data to exist at first run time.

* Fix getDefinitionSummary() implementation to append data instead of setting
  arbitary keys in parent data. ResourceLoader documentation of getDefinitionSummary()
  has been updated to reflect this practice.

Change-Id: I40006d39514a997dce4930756a3dac84a0c9bb83
2015-06-09 19:14:20 +01:00
Kunal Mehta
ef5cf5268d Run generateLocalAutoload.php to sort entries in autoload.php
Will reduce dirty diffs in future changes.

Change-Id: I4f97c1e4f9eaf0dc807435209b6a0e8494b60db1
2015-06-07 22:27:24 -07:00
jenkins-bot
1823dca496 Merge "Move XmlSelect to its own file" 2015-06-03 03:34:35 +00:00
Geoffrey Mon
8007e25308 Move XmlSelect to its own file
Move the XmlSelect class to its own file to make it easier to find 
and utilize.  Helps prevent the use of unnecessary
Html::openElement, Html::element, etc.

Bug: T93234
Change-Id: I66119a2d0eda15569de06c493a0ee302f21deb3f
2015-06-03 03:26:01 +00:00
jenkins-bot
977f7ad8ad Merge "Combine deleteArchived{Files,Revisions}.inc into the .php scripts" 2015-06-03 00:05:52 +00:00
jenkins-bot
6ffdc1cdca Merge "OOUI theme support" 2015-06-02 17:28:09 +00:00
Kunal Mehta
06cf009d88 Remove deprecated MWFunction::newObj()
Change-Id: I180e9e1e0bcf17c9e72b607c69cae00f47de6579
2015-05-31 23:22:57 +00:00
Bartosz Dziewoński
1fc57830e2 OOUI theme support
* Split off OOjs UI's module definitions to a separate file from
  Resources.php.
* Extend ResourceLoaderImageModule to support per-skin images and
  variants.
* Allow skins to specify their preferred OOjs UI theme using new
  skin registry attribute 'SkinOOUIThemes'. The default remains the
  'mediawiki' theme, 'apex' can also be chosen now.
* Implement custom ResourceLoaderOOUIImageModule which implements some
  special sauce required to shoehorn OOjs UI image set definitions into
  ResourceLoaderImageModule with skin-specific styles support.

Bug: T100895
Change-Id: I3fbacbce95126a4cc29221352f3ef846f41e7b1b
2015-05-31 22:55:13 +00:00
jenkins-bot
5eda39e04b Merge "Implement OOUI display format for HTMLForm" 2015-05-24 12:22:29 +00:00
Brad Jorsch
4a3e50a541 Export allowed tags from Sanitizer to mediawiki.jqueryMsg
Specifically, we export only those that are allowed to be paired,
because its parser doesn't handle self-closing tags.

Bug: T66740
Change-Id: I9944f9af915715c57a7d9ce3c62c3e61e54a75ba
2015-05-24 10:25:02 +02:00
Bryan Davis
3354b3e0d0 Remove MWLogger and non-namespaced MWLogger* shim classes
These classes were introduced and deprecated during the 1.25 development
cycle.

Bug: 100098
Change-Id: I3a479d194bdf5137f99a7e27fc71c7b438b1e136
2015-05-23 22:28:12 +02:00
Mark Holmquist
e85bd04bcd Implement OOUI display format for HTMLForm
Bug: T85291
Change-Id: I6ffe93c16d6b209a0ab08d714ad8ddaefb6acd52
2015-05-23 16:10:08 +02:00
Kevin Israel
5fca8e5130 Combine deleteArchived{Files,Revisions}.inc into the .php scripts
Some of deleteArchivedFiles.php and deleteArchivedRevisions.php were
split off to deleteArchivedFiles.inc and deleteArchivedRevisions.inc
respectively in r62948 (04b2413aac) for use in tests.

The tests no longer use those methods, so I moved them back and inlined
them into execute(). I also did some minor cleanup -- changing direct
calls to tableName() and query() to use query builder functions and
clarifying/fixing some of the logic that was in deleteArchivedFiles.inc.

Change-Id: Ica49dcac18a9c702cffe02e562c6dff48d2d2784
2015-05-17 00:01:42 +00:00
Kevin Israel
eb11a00a1e Remove maintenance script deleteImageMemcached.php
This script is broken; it deletes an object cache key that 1.11
(r22850 / ed4303922f) and newer no longer use. The most similar
working script is probably refreshImageMetadata.php --force.

Change-Id: Icf2223dc87861e02f20422492d40994f5302ad15
2015-05-16 17:47:48 -04:00
jenkins-bot
fed9e3e163 Merge "ApiOpenSearch: Don't output warnings in JSON mode" 2015-05-15 20:23:00 +00:00
Timo Tijhof
d9fbce0b76 resourceloader: Implement ResourceLoaderRawFileModule for 'mediawiki.js'
When adding files to this module, they all imply a global scope.
While most files have their own closure, it is still inconsistent
with normal modules which always have a closure via mw.loader.implement.

Base modules like 'mediawiki' are lacking such a closure, thus making
it hard to share variables within the different files that make up the
module without making it a globally public.

The use case is 13203c0a2180e5, where we could expose the sha1()
library within the scope of this module only.

Change-Id: I93fcd045f47ec6a595b26f739939e1d371832ac9
2015-05-14 22:44:36 +01:00
Timo Tijhof
2e81697565 Add ActivityUpdateJob to autoloader
Follows-up 836ad263c. Ran generateLocalAutoload.php.

Change-Id: I12f597aa0d8100a60f2c631797a76627acbaa2ec
2015-05-13 19:23:52 +01:00
Brad Jorsch
663d555abd ApiOpenSearch: Don't output warnings in JSON mode
The OpenSearch JSON format doesn't have any way to report warnings. So
by default we just drop them, but a new option will cause them to be
converted to errors instead.

Bug: T97617
Change-Id: I632bbb99a3d0f04baa5aff211fc52c3f34b13b78
2015-04-30 15:40:46 -04:00
Aaron Schulz
63c132e050 Refactored ReplicatedBagOStuff to use generic factory methods
* Moved the class to /libs as is possible now

Change-Id: I6b724cf4b2ea627d485acb1e1882a5a04772d6f6
2015-04-29 20:08:19 -07:00
Aaron Schulz
c7bf955bca Moved WAN cache and relayer to /libs
Change-Id: I9586d22890ce1cda7f74869ff701de73d65eaaef
2015-04-27 12:35:58 -07:00
Aaron Schulz
fb10df98df Moved DBConnRef to a separate file
Change-Id: I9c8570aefb8927a3d69b7fd446165f6e8661e84d
2015-04-24 18:02:50 +00:00
Aaron Schulz
3a1f8b1111 Added WANObjectCache class
This class handles caching across distance sites where purges
must reach both. It also aims to make purging more reliable in
the face of network glitches and node consistent hash ejection.

bug: T88492
Change-Id: I686811b3075bf22e2f4de45127e8461e54648ead
2015-04-23 21:36:42 +00:00
Brad Jorsch
61233fc847 API: Move parameter formatting into LogFormatter
This allows for extensions to format their log entry parameters, and
keeps the code for formatting API log entry parameters in the same place
as for other formatting.

This also takes the opportunity to rearrange the output format slightly
to avoid conflicts like what's happening in T73020.

Bug: T35235
Bug: T73020
Bug: T91466
Change-Id: I6846ce09322eb404c506b5a51780a44ce9279fe2
2015-04-17 04:59:41 +00:00
Aaron Schulz
48f6aa6d2f Moved ChangeTags to /changetags
Change-Id: I55a8f00d3aa2717d0bf6480ab1a694f29b429de0
2015-04-16 10:40:14 -07:00
Aaron Schulz
f6d1bbb8ee Moved MessageBlobStore to /cache
Change-Id: Ib628cc2f5d9079f4538561d585725fd79876d6f2
2015-04-15 20:36:03 -07:00
jenkins-bot
4fa0240228 Merge "API: Overhaul ApiResult, make format=xml not throw, and add json formatversion" 2015-04-16 01:05:51 +00:00
This, that and the other
5c4681012e UI for adding and removing change tags on revisions and log entries
There is a new special page, Special:EditTags, which is very similar to
Special:RevisionDelete in a lot of ways. In fact, the SpecialEditTags class
started off as a copy-paste of SpecialRevisiondelete.

You invoke this special page by going to an article history page, checking
some revisions, and clicking "Edit tags of selected revisions". Then you
pick the modifications you want to make and click "Apply". Very much like
the revision deletion workflow.

I had to restructure some of the Action routing code, which was only
designed to handle revision deletion. Also removing some code from
SpecialRevisiondelete which didn't work as advertised in the first place,
and definitely doesn't work now.

Change-Id: I7d3ef927b5686f6211bc5817776286ead19d916b
2015-04-15 18:31:12 +00:00
This, that and the other
ae3ab9eef0 Allow users to add, remove and apply change tags using the API
You can add tags at the same time as performing action=edit, as long as you
have the "applychangetags" right. Also, you can add or remove tags after
the fact from revisions and log entries using the API action=tags.

No UI is provided for either of these changes. The target audience is user
scripts, gadgets and similar tools.

Includes a new log parameter format type: "list", for a comma-separated
list of values.

Logging of change tag events is limited to those that do not accompany an
edit (i.e. those done after the fact), and is hidden from Special:Log by
default, similar to the patrol log.

Bug: T20670
Change-Id: I37275e0f73fa3127f55da0c320b892551b61ee80
2015-04-15 18:30:45 +00:00
Brad Jorsch
1c57794e37 API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.

ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.

So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
  arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
  Formatters are responsible for stripping it if necessary. "raw mode"
  is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
  question, and so on.
* New class for formatting warnings and errors using i18n messages, and
  support for multiple errors and a more machine-readable format for
  warnings. For the moment, though, the actual output will not be changing
  yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
  between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
  modules currently returning booleans will need to use
  ApiResult::META_BC_BOOLS to preserve their current output.

Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.

Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2015-04-10 16:57:15 -04:00
Aaron Schulz
4e695d370a Removed unusable maintenance script
* Change left out of 4bdbfe6c1b

Change-Id: I2169586742653d0b43e2f581f28f79af960e7ada
2015-04-08 15:41:36 -07:00
Bryan Davis
6bf78b3274 Separate Monolog shims from other logging shims
Move the non-namespaced classes referencing external Monolog classes to
an isolated PHP source file so that they aren't brought into scope by
the need to load another shim class.

Bug: T95220
Change-Id: I8270b8d5cd25db5a0f84fa94f59a6555052ae1ae
2015-04-06 20:28:13 +00:00
Bryan Davis
1195e11a8a Move MWLogger classes to MediaWiki\Logger namespace
Move the MWLogger PSR-3 logging related classes into the
MediaWiki\Logger namespace. Create shim classes to ease migration of
existing MWLoggerFactory usage to the namespaced classes.

Bug: T93406
Change-Id: I359cc81fbd2dcf8937742311dcc7d3dee08747b0
2015-04-03 11:32:24 -07:00
Aaron Schulz
4bdbfe6c1b Removed BloomFilter classes
* This ends up being more complex than its worth
  and even more so for multi-DC support

Bug: T93006
Change-Id: Iaa774fe69061e42955b11dc82d30dba93208e606
2015-04-03 09:10:04 +00:00
Ori Livneh
1b6f70089d Introduce ProfilerOutputStats
* Associate Profiler objects with a request context by adding a $context
  property with a getter and a setter.
* Introduce ProfilerOutputStats, which writes profiling data to the stats
  buffer associated with the current request context.
* Make it the Profiler class's responsibility to enforce $wgProfilerLimit.
* Deprecate $wgProfilerLimit in favor of the (more aptly named, IMO)
  $wgProfiler['threshold'] config setting.
* Tidy up Profiler instance creation code in Profiler::instance().
* Add Profiler::getOutputs, which returns an array of ProfilerOutput instances
  which are configured for the current profiler and whose canUse() method
  returns true.
* Make ProfilerStub not log by creating a stub ProfilerStub::logData() method
  which does not call the parent. Previously the parent class checked if $this
  was an instance of ProfilerStub and returned early if so.

Task: T90623
Task: T85641
Change-Id: Icf644ad3435c1f30d0a49957a97b481808a3153d
2015-04-02 01:32:46 +00:00
Bryan Davis
7ab9e6ed0c Remove MWLoggerMonologSamplingHandler
The Monolog\Handler\SamlingHandler class available since Monolog v1.12.0
is an upstreamed equivalent of MWLoggerMonologSamplingHandler.

Requires: I8790da95fd658234e35b2d846af35993ebcd80e9
Change-Id: I3841cbab95382a66098d90f5570fa0bf3521578a
2015-03-27 20:27:32 +00:00
Alex Monk
ec2330f7f9 Move WikiEditor's special character data and messages into core for use in other extensions
Using a ResourceLoader module to send the data to the client

For I3fafc561

Message changes:
wikieditor-toolbar-characters-page-.* -> special-characters-group-
wikieditor-toolbar-characters-(endash|emdash|minus) -> special-characters-title-

Bug: T91608
Change-Id: If9c5cdbe077e8796e1ebae99f759331251b5c4b1
2015-03-27 17:40:09 +00:00
umherirrender
50b1cd2fbc Remove never thrown UploadStashNotAvailableException
Also move creation of UploadStash to main entry point of the special
page to avoid use of context before it is set (by called getUser).

Change-Id: Ibcb17b6ee1b853d807f91104ba428b307e9a5208
2015-03-25 19:29:49 +00:00
Kevin Israel
cbfd6cff6d Remove unused class DBObject
This was left over from a previous attempt at Oracle support,
which was removed in 1.10 (r19196 / ccf91e827a).

Change-Id: I5f9b82fffc0b4f84286b697be8d504020fe22547
2015-03-23 20:09:47 -04:00
jenkins-bot
65294205a1 Merge "Split SiteLookup interface from SiteStore" 2015-03-19 11:32:27 +00:00