Commit graph

105 commits

Author SHA1 Message Date
Mark Holmquist
e85bd04bcd Implement OOUI display format for HTMLForm
Bug: T85291
Change-Id: I6ffe93c16d6b209a0ab08d714ad8ddaefb6acd52
2015-05-23 16:10:08 +02: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
aude
aded554d70 Split SiteLookup interface from SiteStore
* SiteLookup interface is added, and SiteStore extends
  it. (any SiteStore type hints can be changed to use
  SiteLookup if all they need is lookup functionality)
* Memcached based SiteStore code is split from the
  database SiteStore, and SiteSQLStore is deprecated.
  If no caching is desired when using a SiteStore, then
  use a SiteDBStore instance, instead of passing $source
  parameter in SiteStore::getSite and SiteStore::getSites.
* SiteListFileCache renamed to FileBasedSiteLookup and
  implements SiteLookup.

Bug: T77990
Change-Id: I36b599884c211580ea6806a8a190c65c4f9087cf
2015-03-18 21:31:48 +01:00
Timo Tijhof
6b03627584 Regenerate autoload.php
Follows-up 87dfc20b1e.

It recently started generating dirty output because
BufferingStatsdDataFactory was manually placed – in a different
position than script would (i.e. not alphabetical).

Change-Id: I030a6ec9eb6f3a9b6cb54c9646acf2a898b93a80
2015-03-17 01:08:01 +01:00
jenkins-bot
0c9dc0f8f9 Merge "Ignore phpcs in autoload.php" 2015-03-16 22:00:51 +00:00
Timo Tijhof
e5f0884ec4 Ignore phpcs in autoload.php
Causes 20 warnings for line length
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-HEAD/13849/console

As being autogenerated, migth as well ignore so we can have
mediawiki-core pass.

Change-Id: Iedbe527456144c9b09b7ba93a8ce67edf0b47015
2015-03-16 19:09:28 +01:00
jenkins-bot
d3efb28185 Merge "Clean up $wgSQLiteDataDir handling and removed standalone sqlite class" 2015-03-16 17:22:10 +00:00
jenkins-bot
3823118cd8 Merge "Introduce the Restbase Virtual REST Service class" 2015-03-10 17:08:14 +00:00
Ori Livneh
87dfc20b1e Add StatsD metric logging
This patch adds a metric data service object to the IContextSource interface,
with full support for StatsD meters, gauges, counters and timing metrics, via
the liuggio/statsd-php-client, which this patch also introduces.

Usage example:

    $stats = $context->getStats();
    $stats->increment( 'resourceloader.cache.hits' );
    $stats->timing( 'resourceloader.cache.rtt', $rtt );

The metrics are flushed to a StatsD server, which may be specified via the
'StatsdServer' configuration key. If no such configuration key exists, the
metrics are discarded.

The StatsD client supplants MediaWiki's StatCounter class. wfIncrStats()
will continue to work, but it will delegate to the StatsD data object.

Change-Id: Ie10db1c154d225971398e189737de7c560bf0f90
2015-03-09 16:57:14 -07:00
Marko Obrovac
b13bd0996c Introduce the Restbase Virtual REST Service class
Restbase, the REST content API service, is to be queried instead of
Parsoid by current Parsoid users (most importantly VE). This patch
introduces the Restbase virtual REST service class and transparently
maps Parsoid calls into Restbase ones if parsoidCompat is set when
creating the service object.

Additionally, $wgVirtualRestConfig is introduced in DefaultSettings.php. This
is a first step towards global service configuration and management.

Bug: T89066
Change-Id: I4d4043e5052327bbd789331f1c05b607c45fe7cb
2015-03-09 22:05:58 +01:00
Aaron Schulz
46cf4f1e30 Clean up $wgSQLiteDataDir handling and removed standalone sqlite class
* The data directory can now be set via the construction params
* A standalone factory method now replaces the subclass
* Also made mDatabaseFile protected

Change-Id: I1791fd4f630e5c121fa7f68f473411a7c12d0c97
2015-03-09 18:35:24 +00:00
Aaron Schulz
8e3721a2b9 Added EnqueueJob class that handles routing jobs to queues
Bug: T89308
Change-Id: Iadb34f24d8bbe94c0f9f119e530c0bbe1060df0a
2015-03-04 13:55:54 -08:00
Stanislav Malyshev
750e4eb9d9 Allow dumping raw xhprof data for consumption by xhprof GUI
Change-Id: Iab90cef1c61b92ffc6d46a6bc93a03cf7bc2adb9
2015-03-04 01:29:02 +00:00
jenkins-bot
0d604ca809 Merge "resourceloader: Implement '$pages' parameter to ResourceLoaderWikiModule constructor" 2015-03-03 22:52:22 +00:00
jenkins-bot
5a00a50635 Merge "Removed pointless memcached JobQueueAggregator class" 2015-03-03 20:56:02 +00:00
Aaron Schulz
b15ac8eb48 Removed pointless memcached JobQueueAggregator class
* On a basic/default install there is only a single wiki 
  and nothing uses this. Larger wikis would want to use redis.

Change-Id: Ie5bf1a644ae60b2c6ca72b165fa5510113717611
2015-03-03 20:46:52 +00:00
Kunal Mehta
870f50d45c resourceloader: Implement '$pages' parameter to ResourceLoaderWikiModule constructor
This makes it easier for subclasses to use ResourceLoaderWikiModule. Currently
many subclasses of this simply need to override the getPages() method.

UserModule and SiteModule keep their getPages override due to the set of pages
being dependent on context.

Change-Id: I388531398671afacfec36c6c5746d72267b5bdac
2015-03-03 17:17:02 +00:00
aude
df3ac3d09e Introduce HashSiteStore, mainly for use in tests
HashSiteStore comes from Wikibase (see I783bd95), where it was
called MockSiteStore.

This enables some phpunit tests, related to Site objects, to no longer
depend on a database, memcached or other external storage. This makes
tests faster and more simple.

Bug: T90874
Change-Id: I048d37bd2aaa5f17c9fe16b2855df8bf9fe7bc8c
2015-02-27 10:14:48 +01:00
jenkins-bot
bd5fd843d6 Merge "Always decode Blob objects from Database::addQuotes" 2015-02-25 21:17:06 +00:00
Brad Jorsch
b5ac439ee6 Run maintenance/generateLocalAutoload.php
I thought a unit test was supposed to fail if this hadn't been run, but
I3936417b and I40fd6aaa recently got merged despite it.

Change-Id: Idb9b4b77a4a1c82ed74ec829fad8c12a9c39af09
2015-02-25 13:18:27 -05:00
Kunal Mehta
1e3888de00 Start moving objectcache into libs/
The base BagOStuff class and some of the implementations are
not dependent on MediaWiki and can be in the libs folder.

Change-Id: I299f9abb778abc65a70461a2aff3015c02a1f04d
2015-02-25 00:22:50 -08:00
Aaron Schulz
3817818aca Add a ReplicatedBagOStuff class
Bug: T88634
Change-Id: I1f7cccd6ac376055ff2b84641ff38a85571c65b0
2015-02-23 05:09:08 +00:00
jenkins-bot
8888bac668 Merge "Migrate block log to new log system" 2015-02-22 00:46:35 +00:00
Kevin Israel
ec314922b5 Remove maintenance script dumpSisterSites.php
This script would perhaps better belong in the SisterSites extension, as noted
on the extension's MW.org description page. However, that extension was never
actually developed to a usable state (first commit was r16390, no substantial
changes since) or imported into Git, so apparently the feature (or at least
its implementation) is of only limited, possibly historical interest.

Change-Id: Ia4c3b0316815f06b7e82f013edfd1798ed07d9a3
2015-02-20 10:09:53 -05:00
jenkins-bot
b767edc892 Merge "Maintenance script for exporting site definitions" 2015-02-20 11:16:18 +00:00
daniel
ca3be1e13d Maintenance script for exporting site definitions
Bug: T87178
Change-Id: I40fd6aaa8f47bad3d595d5c190036bf04d13c12a
2015-02-20 12:09:34 +01:00
jenkins-bot
0b10f2191e Merge "Maintenance script for importing site info." 2015-02-20 10:45:16 +00:00
jenkins-bot
94d47e4979 Merge "API: Add authz features for RESTBase" 2015-02-20 05:51:56 +00:00
kaldari
2ec0272218 Adding TemplateParser class providing interface to Mustache templates
The TemplateParser class provides a server-side interface to cachable
dynamically-compiled Mustache templates. It currently uses the
lightncandy library to do compilation (which is already included in
the vendor repo).

Also converting NoLocalSettings.php to use it as a proof-of-concept.

Bug: T379
Change-Id: I28cd13d4d1132bd386e2ae2f4f0d1dd88ad9162b
2015-02-19 17:41:45 -08:00
Brad Jorsch
4b8b0358eb API: Add authz features for RESTBase
The RESTBase team has requested the ability to check the validity of a
CSRF token and to interface with Title::userCan().

The former is accomplished by the new action=checktoken module. The
latter by a new parameter ('testactions') to the existing prop=info.

Bug: T88010
Change-Id: I2530f1315ec93f5be9fb437137992150fdc305f2
2015-02-19 16:45:03 -05:00