Commit graph

426 commits

Author SHA1 Message Date
Aaron Schulz
8a573aa1f5 Move some FileBackend related classes to /libs
Change-Id: I0c3a84c2ed8b869519f4d38475a77539c24a88a8
2016-09-19 07:31:25 +00:00
Aaron Schulz
25a1651aad Make LockManager use StatusValue and move classes to /libs
Change-Id: Ifa41fc2939f3515d4a056746b0fcbff79786d25b
2016-09-19 04:34:28 +00:00
Aaron Schulz
e4948970dd Fix file/class name mismatch from e2adcc89bb
Change-Id: Ieac65f29a13612cecd421b62e1cb3a3f47552bb6
2016-09-17 19:00:01 -07:00
jenkins-bot
72953cd703 Merge "Move LoadBalancerSingle to /libs/rdbms" 2016-09-18 01:27:50 +00:00
Aaron Schulz
e2adcc89bb Move LoadBalancerSingle to /libs/rdbms
Change-Id: I2e8177ca8fa6b9fcdec87e44f0cfeb11bb71f2bc
2016-09-17 18:04:42 -07:00
jenkins-bot
2155a01fd1 Merge "Move LBFactoryMulti to /libs/rdbms" 2016-09-18 00:57:01 +00:00
Aaron Schulz
57ba462e4b Move LBFactoryMulti to /libs/rdbms
Also rename $wiki => $domain and lastWiki => lastDomain.

Change-Id: I2a30f42721715c56f5cddf9f07c10e8de70addd1
2016-09-17 17:16:23 -07:00
Aaron Schulz
fd224eac76 Move mysql database classes to /libs/rdbms
Change-Id: I1ba1799deec10e5a8ab8829b69e0708626e723e2
2016-09-17 23:38:51 +00:00
Aaron Schulz
d175b391ae Move LBFactorySimple to /libs/rdbms
* Refactored LBFactory a bit to make this possible.
* Move newChronologyProtector() up to LBFactory and
  make a lazy-loading method instead.
* Move appendPreShutdownTimeAsQuery() up to LBFactory.
* Inject the web request values for LBFactory from Setup.php.
* Remove unused laggedSlaveUsed() method.

Change-Id: Ie8a38a6f4d6359680eb6a5be24a34e30b9816479
2016-09-17 23:13:00 +00:00
Aaron Schulz
847b91bf1f Make database classes handle hyphens in $wgDBname
* Add DatabaseDomain class to handle passing domains around.
It also can be cast to and from strings, which are of the same
format as wfWikiId() except with hyphens escaped.
* Make IDatabase::getDomainID() use these IDs so they can be
passed into LoadBalancer::getConnection() and friends without
breaking on sites with a hyphen in the DB name.
* Add more LBFactory unit tests for domains.

Bug: T145840
Change-Id: Icfed62b251af8cef706a899197c3ccdb730ef4d1
2016-09-17 15:29:21 -07:00
Aaron Schulz
5bc9b990ac Cleanups to DatabaseMysqlBase
* Avoid global methods
* Inject global variables
* Remove $wgAllDBsAreLocalhost hack

Change-Id: I54b23654def1f83518764ad697434aebfc6cef73
2016-09-17 06:01:19 +00:00
Aaron Schulz
403a1ea178 Move all of the reasonable DatabaseBase methods to Database class
The Database class was previously just a short-hand for "Database::",
and such calls should still work. The class now resides in /libs/rdbms.

The subclasses now extend DatabaseBase to avoid breaking type hints
that use that (hints use either IDatabase or DatabaseBase).

Also, use CASCADE with DROP TABLE for MySQL as with other DBs.
Keep SQLite excempt due to lack of support.

Added getDomainID() methods to avoid mentioning the word "wiki".

Change-Id: Ibd05d786cb26c21dcc9cb9601f6b2b52056af9ae
2016-09-17 03:38:05 +00:00
jenkins-bot
231278d0cb Merge "Split out ConvertableTimestamp class" 2016-09-16 03:07:28 +00:00
Aaron Schulz
e10f272a05 Split out ConvertableTimestamp class
* Make TimestampException a regular exception.
* Make DatabaseBase use ConvertableTimestamp.

Change-Id: I849737c9c187e8e0c6e080887ec0656e034f80d2
2016-09-16 03:00:09 +00:00
Aaron Schulz
21a9bb06b4 Move LoadMonitorMySQL to LoadMonitor
* The LoadMonitor interface is now ILoadMonitor.
* Nothing in this code was MySQL specific.
  Now any DB type can benefit from a LoadMonitor.

Change-Id: I272a72cd55a70f99a866d518d44cb3bcaca91b9e
2016-09-15 23:56:39 +00:00
Stanislav Malyshev
7e18cfc3b5 Infrastructure for augmenting search results
Bug: T117493
Change-Id: Ia5413a7846cc961026a2dc3542b619493bc76a23
2016-09-15 15:44:03 -07:00
jenkins-bot
0387ce5cc6 Merge "Rename LBFactory => LBFactoryMW and make LBFactory in /libs" 2016-09-15 17:39:35 +00:00
Aaron Schulz
0e5cd18b74 Rename LBFactory => LBFactoryMW and make LBFactory in /libs
The former extends the later with MW-specific logic.

Also removed a wf* method call from ChronologyProtector.

Change-Id: I325f59b7467ab9c2137731d1ce69816f5a020f03
2016-09-15 17:14:32 +00:00
jenkins-bot
efe855145d Merge "Move Linker::formatTemplates() to separate class, remove global usage" 2016-09-15 16:52:10 +00:00
Aaron Schulz
aeedfb8526 Remove unused LBFactoryFake class
Change-Id: I88acf72fc32c7e3c9bead81d11c5adfd8dff6151
2016-09-14 22:02:43 -07:00
Aaron Schulz
0bbba6e0d4 Move various DB helper classes to /libs/rdbms
Change-Id: I0724f1acce4f6c43b1f0983fa119e628e7c53ba5
2016-09-14 20:40:12 -07:00
Aaron Schulz
c1c68c92f2 Move LoadBalancer to /libs/rdbms
Change-Id: Ic87f1cc84ba44be20f345944406e1d8a34be1c96
2016-09-14 20:27:08 -07:00
jenkins-bot
21e3f9ca43 Merge "Exception cleanups for LoadBalancer" 2016-09-15 02:19:03 +00:00
Aaron Schulz
5820c6dcac Exception cleanups for LoadBalancer
* Make the error message itself be dumb/raw.
* Make the exception exposer show the same GUI message.
* Remove overzelous wgLang check in MWExceptionRenderer.

Change-Id: Ifffff3b3cc785ea3080e4975efe33b3c2cf304d6
2016-09-15 01:32:43 +00:00
jenkins-bot
7813e93a1c Merge "Move DBConnRef and ChronologyProtector to /libs/rdbms" 2016-09-15 00:46:03 +00:00
jenkins-bot
c78b405080 Merge "Move TransactionProfiler to /libs/rdbms" 2016-09-15 00:43:34 +00:00
Aaron Schulz
4f509e92ab Move DBConnRef and ChronologyProtector to /libs/rdbms
Change-Id: If2c4b314a5c39311328843f534d91bf90823e179
2016-09-14 17:29:54 -07:00
Aaron Schulz
9d419f69b1 Move IDatabase/ILoadBalancer to /libs/rdbms
Change-Id: I71f980b1024dc2fbca9cafbad2c9daebb6f28c9b
2016-09-14 16:34:50 -07:00
Aaron Schulz
048da5273b Move DBError to /libs/rdbms/exception
Change-Id: I2ad40db66a68f03fb34a63278a652e0505195076
2016-09-14 11:55:33 -07:00
Aaron Schulz
00bee02971 Add MWExceptionRenderer class and decouple DBError
* This handles the work of showing exceptions so that
  MWException does not have too.
* Simplify the DBError classes to regular Exception
  classes. Lots of pointless prettification has been
  removed, but DBConnectionError still gets the usual
  special treatment of a fallback page and Google form.
* Remove hacky file cache fallback code that probably
  did not work.
* Make MWExceptionHandler::report() wrap
  MWExceptionExposer::output().
* Make MWException::runHooks() wrap
  MWExceptionExposer::runHooks().

Change-Id: I5dfdc84e94ddac65417226cf7c84513ebb9f9faa
2016-09-14 11:53:55 -07:00
Aaron Schulz
531aa2906e Move TransactionProfiler to /libs/rdbms
Change-Id: I13173facc9f101bca69e3bf3e85f292f8468e855
2016-09-14 05:18:57 -07:00
Aaron Schulz
9c8d885060 Move LoadMonitor classes to libs/rdbms/loadmonitor
Change-Id: Ib18108f24ff8b9d05dc324bad132f597b3e2ddef
2016-09-14 10:56:52 +00:00
Aaron Schulz
6e014bb753 Add ILoadBalancer interface
Remove redundant LoadBalancer docs (those without @since).

Change-Id: I981177b6854cfdbea4a51b6db7e365dac0da258a
2016-09-13 19:53:36 -07:00
Kunal Mehta
b16f897a05 Move Linker::formatTemplates() to separate class, remove global usage
Linker::formatTemplates() was a static function that depended upon
global state like $wgLang (explicitly), $wgUser & $wgTitle (implicitly).
Moving it to a separate class allows us to clean it up a little bit and
use modern things like RequestContext and LinkRenderer.

Bug: T145177
Change-Id: Icdea8a2b299b4876feb3df3d66df3e4c104dd928
2016-09-08 22:56:57 -07:00
Aaron Schulz
05589cad6b Move PECL memcached class to /libs
Remove IP class dependency, which is simple enough here

Change-Id: I3aed6ae6747d8d2b9e75b492e5d5293ba4ce9edd
2016-09-07 22:55:11 -07:00
Timo Tijhof
b2585a95b2 filecache: Remove unused ObjectFileCache class
This was originally intended for use by ResourceLoader but it was
incomplete and not actually used by ResourceLoader at first.

Then 93d358cd added support for FileCache to ResourceLoader with
a separate ResourceFileCache class.

Also fixed typo in HTMLFileCache from 6559b8bf.

ObjectFileCache is not mentioned anywhere else in Wikimedia Git.

Change-Id: I69cca27ee7cd922da12f1793660432709c273be6
2016-09-06 17:09:50 -07:00
jenkins-bot
a206443c0e Merge "Change "slave" => "replica DB" in /maintenance" 2016-09-06 01:05:50 +00:00
Aaron Schulz
c0a9ab0f6d Change "slave" => "replica DB" in /maintenance
Change-Id: Ibd3d617901130378a935402326cd4eefbb382c9e
2016-09-06 00:13:08 +00:00
Aaron Schulz
e99bb1b7dc objectcache: allow for callbacks to mask SYNC_WRITE latency
Change-Id: I908222ad3788ebe330aa58831cda139da32becd8
2016-09-01 13:44:18 -07:00
Aaron Schulz
9b81de7960 Move some DB error classes with the rest as type DBUnexpectedError
Change-Id: I97d61d32495e6d88ce274772369390c76d7ff3c4
2016-08-29 23:22:21 +00:00
Bartosz Dziewoński
3b84eb02c2 Implement NumericUppercaseCollation
This collation orders text with numbers "naturally", so that
'Foo 1' < 'Foo 2' < 'Foo 12'.

Note that this only works in terms of sequences of digits, and the
behavior for decimal fractions or pretty-formatted numbers may be
unexpected.

This is only expected to work mostly correctly for English-language
text. Consider it a proof of concept. You probably want to use
an UCA collation with '-u-kn' suffix rather than this.

Bug: T8948
Change-Id: Ie268f2d92c5c75d0aaecf54ede2bdda1af3b309d
2016-08-23 18:41:01 +00:00
Aaron Schulz
420efbfb61 Move EnqueueableDataUpdate to a separate file
Change-Id: Iabc291cd1f3c5390ca8bcc5da64a0ff01a082575
2016-08-22 21:20:49 -07:00
Aaron Schulz
f16eb73ecf Move invalidatePages() to new PurgeJobUtils class
This does not really belong in SqlDataUpdate.

Change-Id: I7166e50696483371f95db3a8b6bce44b0f866ccd
2016-08-23 01:09:08 +00:00
jenkins-bot
6a72a63e31 Merge "Split DBLockManager classes into their own files" 2016-08-22 17:37:34 +00:00
Bartosz Dziewoński
89107070d1 Support 'hide-if' parameters in OOUI HTMLForm
For plain HTML forms, we just put the required data in the 'data-hide-if'
attribute. For OOUI, it's not so easy - while we could just call
->setAttribute(...) on the FieldLayout, this would disappear when
infusing (since it's not part of the config), and we have no control over
when some piece of JavaScript decides to infuse the element. Even if we
managed to handle it first, infusing replaces the DOM nodes for elements
with new ones, which would "disable" our event handlers.

To solve this, I'm creating two new layouts HTMLFormFieldLayout and
HTMLFormActionFieldLayout (subclassing FieldLayout and ActionFieldLayout)
with a common trait (mixin) HTMLFormElement. This is all implemented both
in PHP and JS. Right now it only serves to carry the 'hide-if' data from
PHP to JS code, but I imagine it'll be extended in the future for other
HTMLForm features not yet present in the OOUI version (e.g. 'cloner'
fields).

The code in hide-if.js has been modified to work with jQuery objects or
with OOjs UI Widgets with minimal changes. I had to duplicate the map of
HTMLFormField classes to modules they require there (from autoinfuse.js),
which is ugly - I'm fixing this in a follow-up commit
I3da75706209cbc16b19cc3f02b355e58ca75fec9.

Bug: T141558
Change-Id: I3b06a6f75eed01d3e0bdc5dd33e1b40b7a2fc0a2
2016-08-22 15:42:22 +00:00
Aaron Schulz
7f3faf091f Split DBLockManager classes into their own files
Change-Id: If903a90a5be2d6ff11504d34eb125e86c1ab1191
2016-08-20 10:33:37 -07:00
jenkins-bot
4b70bc2b28 Merge "Extract ParserOutput search index data fields from WikiTextContentHandler" 2016-08-19 18:40:17 +00:00
aude
64ee3d3269 Extract ParserOutput search index data fields from WikiTextContentHandler
Bug: T142491
Change-Id: I69b010b893135e53fac7f16f4b927b8fbcba06d2
2016-08-19 09:26:17 -04:00
Tim Starling
535501ed62 Add a script to build an HHVM RepoAuthoritative bytecode file
This script compiles a list of known MW sources, including core and
extensions, and generates a RepoAuthoritative bytecode file. Some ideas
were taken from Bryan Davis's scap-hhvm-compile shell script.

Also, renamed the old maintenance/hiphop directory to maintenance/hhvm,
respecting the rename of the upstream project.

Change-Id: I55798729d0553d2840e8099e81d604a814e8664c
2016-08-16 13:32:19 +10:00
jenkins-bot
3cfcd55011 Merge "resourceloader: Move queue formatting out of OutputPage" 2016-08-11 14:09:58 +00:00