Commit graph

462 commits

Author SHA1 Message Date
jenkins-bot
c9cf1b2763 Merge "Move FileBackendStore and FileOp classes to /libs" 2016-09-23 22:52:46 +00:00
jenkins-bot
305499a998 Merge "Move RedisLockManager to /libs" 2016-09-23 22:09:31 +00:00
jenkins-bot
5680b24b3e Merge "Move RedisConnectionPool to /libs/redis" 2016-09-23 21:57:36 +00:00
Aaron Schulz
6e5329cd8e Move FileBackendStore and FileOp classes to /libs
Change-Id: If490f64bec282e5dfcdaf7feb1cbf46d3dce1064
2016-09-23 14:46:53 -07:00
jenkins-bot
5c529ac835 Merge "Add HTTPFileStreamer class" 2016-09-23 21:28:52 +00:00
Aaron Schulz
24aa72de84 Add HTTPFileStreamer class
* Move most StreamFile code to this new class
* Remove StreamFile depedency from FileBackendStore

Change-Id: I4a272ef49497b589114fc2b37ba800bc26d9161f
2016-09-23 14:22:04 -07:00
jenkins-bot
b9ad2beaba Merge "Move FileBackendMultiWrite to /libs" 2016-09-23 21:08:57 +00:00
jenkins-bot
1319754d66 Merge "Add IMaintainableDatabase for non-OLTP type methods" 2016-09-23 20:37:59 +00:00
Aaron Schulz
616fabe05a Move FileBackendMultiWrite to /libs
Change-Id: I8079693a62db390028cd9f72b2bd7a81ae1164c3
2016-09-23 20:19:11 +00:00
Aaron Schulz
44705ce9dd Add ILBFactory interface for completeness
Also fixed comment indentation.

Change-Id: I535d320b63477302b06fd634b3ab47eef6868ffc
2016-09-23 12:12:47 -07:00
jenkins-bot
43885ef092 Merge "Add HTMLFormField class for MWRestrictions and use it for bot passwords" 2016-09-23 15:25:11 +00:00
Aaron Schulz
49e0691b71 Move RedisLockManager to /libs
Change-Id: Ia476f117243cf0f6984e373d460b24db18584704
2016-09-23 00:30:47 -07:00
Aaron Schulz
10593ffaab Move RedisConnectionPool to /libs/redis
Change-Id: Ied4a85d7172ab76b90f6d9ce4d47a83c3fd7d111
2016-09-23 00:20:19 -07:00
Aaron Schulz
2073a25695 Move more LockManager classes to /libs
Change-Id: I4bfa79f430827b8717a57bb61cb7c36bc7fcb489
2016-09-22 22:26:18 -07:00
Aaron Schulz
3caf63e016 Add IMaintainableDatabase for non-OLTP type methods
Change-Id: I4cbdfd7a40af17269c527df6e1c3c5644672b8a7
2016-09-23 04:03:11 +00:00
Reedy
a0fa3e4dc0 Rename includes/Services to includes/services for consistency
Change-Id: I900fab26a7cf5a339233f55c31168f8c2963bc8c
2016-09-23 00:08:15 +00:00
Aaron Schulz
c2acd8f642 Simplify and clean up FileBackend exceptions
Use standard exceptions for unexpected errors and remove
FileBackendException class, leaving FileBackendError. The
later is actually intended to be caught in some cases.

Change-Id: I735a525e0b14e518b2da5f18762e0f293064dfc2
2016-09-22 15:28:08 -07:00
Gergő Tisza
3090a1d1f8 Add HTMLFormField class for MWRestrictions and use it for bot passwords
Change-Id: Ib50238e3be5eec63eb5df97154b60dc4ca33d581
2016-09-22 20:50:36 +00:00
Aaron Schulz
aa9d1c91b6 Split up DBError classes into their own files
Change-Id: I671f1a88f0192a5199cfc9c6d7fbde1bff5c4ac8
2016-09-22 13:32:08 -07:00
Kunal Mehta
8e9d2e93ca Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp
Per the dictionary.

Change-Id: I3dcef9fb020c8c6764ee073111ed8c032e4c5a63
2016-09-21 21:43:32 -07:00
jenkins-bot
e8985f2338 Merge "Move IP class to libs/" 2016-09-22 03:30:06 +00:00
jenkins-bot
07d5f507ae Merge "Remove MimeMagic depedency from FSFile and move it to /libs" 2016-09-22 03:25:20 +00:00
jenkins-bot
57711e7e13 Merge "Move IP::isConfigured/TrustedProxy() to ProxyLookup service" 2016-09-22 03:19:27 +00:00
Kunal Mehta
04dfd9b6bc Move IP class to libs/
Also fix some misplaced parenthesis in IPTest.

Change-Id: I84d6120c49f733ec45e7e0005259871808b7568b
2016-09-21 20:18:08 -07:00
Aaron Schulz
724b2cf912 Remove MimeMagic depedency from FSFile and move it to /libs
Change-Id: Ieaae909b49c798b6e9bed65d15961cefbdaec49b
2016-09-22 03:17:04 +00:00
jenkins-bot
ae4a435159 Merge "Move SamplingStatsdClient into stats/ subdirectory" 2016-09-22 03:02:14 +00:00
Kunal Mehta
39ee83f388 Move IP::isConfigured/TrustedProxy() to ProxyLookup service
This creates a new ProxyLookup service to house the
IP::isConfiguredProxy() and IP::isTrustedProxy() functions. The main
purpose of this refactoring is to make the IP class entirely independent
from MediaWiki, so it can be split into a separate library.

Change-Id: I60434a5f3d99880352bc0f72349c33b7d029ae09
2016-09-21 20:02:09 -07:00
Aaron Schulz
ff5abb66b4 Migrate callers to new MWFileProps::getPropsFromPath() method
* FSFile should not be responsible for handling this much logic.
* Make more MediaHandler classes aware of the fact that an object
  other than File might be passed in. Use the FSFile instead of a
  useless empty stdClass object.
* Also added more fields to FSFile::placeholderProps to make it
  more complete.

Change-Id: I9fe764b2a7261af507c6555e6a57273cf7d00d36
2016-09-22 00:33:46 +00:00
Kunal Mehta
5f56f08dfa Move SamplingStatsdClient into stats/ subdirectory
Change-Id: Ib871aa5cd674d58da3d19bfbb5660539afc863b3
2016-09-21 00:47:55 -07:00
jenkins-bot
21dd35ab86 Merge "Move XMP* classes to includes/libs" 2016-09-21 03:57:31 +00:00
Kunal Mehta
8669bced5a Move XMP* classes to includes/libs
These no longer have any dependencies upon MediaWiki and can be split
out into a separate library.

Tests were updated for the new location and to no longer depend upon
MediaWikiTestCase.

Bug: T100922
Change-Id: I6ad507fa883d5934b807f9e31c507659d0730b52
2016-09-20 20:20:10 -07:00
jenkins-bot
60c869b070 Merge "Move some FileBackend related classes to /libs" 2016-09-20 23:17:08 +00:00
Aaron Schulz
adfd1b93d9 Move DatabasePostgres to /libs/rdbms
Fixed all IDEA warnings in the postgres classes too.

Change-Id: I06b4c5b2c581fb65552d980cc106aa10fed40285
2016-09-19 14:55:31 -07:00
jenkins-bot
3f55fc521f Merge "Move LBFactorySingle to /libs/rdbms" 2016-09-19 16:15:15 +00:00
Aaron Schulz
b979fca240 Move DatabaseSqlite to /libs/rdbms
Change-Id: Ibda20041803deb922b7e3803cba6fc8d15214169
2016-09-19 00:52:54 -07:00
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
896a4c74de Move LBFactorySingle to /libs/rdbms
Also add newFromConnection() methods for cleaner looking construction
since the IDatabase is fundamental and required.

Change-Id: Ife478d045cee92a30c91e9004833a557488bd512
2016-09-17 19:13:21 -07: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