Commit graph

447 commits

Author SHA1 Message Date
jenkins-bot
90b02397d0 Merge "rdbms: make selectRowCount() use $var argument to exclude NULLs" 2018-03-21 16:45:33 +00:00
Aaron Schulz
b0ee0a8d9f rdbms: clean up DBO_TRX behavior for onTransactionPreCommitOrIdle()
* Make sure cancelled onTransactionPreCommitOrIdle() callbacks do not
  run if a transaction round is rolled back and then a second round is
  committed. LoadBalancer::rollbackMasterChanges() now always calls
  rollback(), which in turn always cleans up such callbacks.
* Remove error logging for rollback() calls when trxLevel = 0; this is
  harmless and is sometimes hard to avoid in error handling anyway.
* Add more related unit tests.

Change-Id: I6bdefe8bf8b6630fc252b5bbafe4808758ba1684
2018-03-20 01:11:24 +00:00
Umherirrender
a2bb8124b7 Remove @dataProvider and @covers from non-test functions
Only functions beginning with test* should have that annotation

Change-Id: I85cd795970205943aebe692d85434145b3cf3f5b
2018-03-18 22:22:43 +00:00
Kunal Mehta
2d5c742db3 Use SPDX 3.0 license identifier
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.

Bug: T183858
Change-Id: I4cbb98ea2bbacf46a57401dbba2bdb076fca1d3a
2018-03-18 18:08:22 +00:00
Aaron Schulz
d395dfb039 rdbms: make selectRowCount() use $var argument to exclude NULLs
If the $var argument is provided, then it will make the resulting
count exclude rows where the value for that column is NULL.

Also add buildSelectSubquery() method and Subquery
wrapper class for use with select() for calculated tables.

Change-Id: I549d629af99afdf370602de095f7fba6d1546c37
2018-03-18 01:34:33 +00:00
Umherirrender
2bedfa3f1e Make IPTest::isNotIPAddress a test function
Only functions starting with test* are running by phpunit

Change-Id: I91061fb3d5132c61e01e368fab0df0e511b1920d
2018-03-16 17:54:14 +01:00
jenkins-bot
ebf1570fd1 Merge "rdbms: allow construction of Database objects without connecting" 2018-03-14 09:57:18 +00:00
Aaron Schulz
4ccb228bde rdbms: inject the mysql index name aliases into Database
Also added LBFactory::setTableAlias() for consistency with this

Change-Id: Ie49003ff8fd5b99f75db9fae8fe0a184444254d4
2018-03-12 18:51:53 +00:00
Brad Jorsch
83731192b2 Remove useless use
A use declaration for a non-namespaced class in a non-namespaced context
causes a PHP warning.

Bug: T189302
Change-Id: I023e64c8194dd03cc3a1098e2d60c73f99bb02e3
2018-03-09 14:11:36 -05:00
Aaron Schulz
434d5a6321 rdbms: allow construction of Database objects without connecting
* Database::factory() supports a $connect parameter, that defaults
  to NEW_CONNECTED (current behavior) but can also be NEW_UNCONNECTED.
* Add tests asserting the type of various instances returned from
  Database::factory().
* Clean up sqlite "conn" field handling to handle cases of it
  not being set, just as other classes do.
* Add some comments about the return type of doQuery().

Change-Id: Ic0837cfdb35326c2045133d664abd29043d48c03
2018-03-08 19:47:35 -08:00
Timo Tijhof
a211db0f73 rdbms: Restore test for Database::setFlag()
Follows-up b4eb1feed0, which inadvertendly replaced the setFlag()
test with the clearFlag() test.

Also move the test to the DatabaseTest.php file given it's only
executing and covering base class.

Change-Id: I2f4ed6c4eeba845eb67013e1ab7d2b2bde863119
2018-03-08 04:32:21 +00:00
Aaron Schulz
b4eb1feed0 Remove FakeDatabaseMysqlBase test class
Improve some flag tests that did not seem to test much

Change-Id: Iecfc877645cc66cb696beb2b314a6d149745a530
2018-03-07 11:45:04 -08:00
addshore
0526f2d671 Introduce IDatabase::buildIntegerCast
Change-Id: Ib24856d1ebe017ff07ae497972c764b4a3f3c7df
2018-03-07 13:00:18 +00:00
addshore
f3df984c79 Introduce IDatabase::buildSubstring
Change-Id: I96f3e0c4920d52f63175cb6767c149f20a8a8cde
2018-03-07 12:32:50 +00:00
jenkins-bot
a4a25aeb26 Merge "rdbms: add missing hint check DatabaseMysqlBase::isInsertSelectSafe" 2018-03-02 19:10:28 +00:00
daniel
fa9f1aca87 rdbms: in Database::selectSQLText, do not treat $conds = "0" as no condition
This fixes an issue that arises because empty( "0" ) is true in PHP.

The new behavior rejects any conditions that are not strings or arrays,
and lets $conds = "0" be passed to the databases as WHERE 0.

Some databases may reject this as invalid syntax, which is the expected
behavior here, instead of silently ignoring the 0, causing no condition to
be applied to the query.

Bug: T188314
Change-Id: I5bc4d7f41221a886c85e54d9da67c4c095a7d9ce
2018-03-02 10:25:44 +00:00
Aaron Schulz
3b9e6bec3e rdbms: add missing hint check DatabaseMysqlBase::isInsertSelectSafe
This was lost when a bunch of other logic was split off in 671368a59e

Change-Id: I3d3f744f8fce007ecf88cbd2c9f99918b06f0573
2018-03-01 21:03:54 -08:00
Brad Jorsch
99b65649c0 rdbms: allow callers to hint that native insertSelect() is safe
An INSERT SELECT in MySQL/MariaDB is unsafe for replication if a column
is getting values from auto-increment, statement-based replication is in
use, and the default innodb_autoinc_lock_mode is set.

I9173f655 added checks to force non-native insertSelect for the
statement-based replication and innodb_autoinc_lock_mode != 2 case, but
determining whether a column is getting values from auto-increment is
too hard to do automatically there.

Instead, let's add a flag to let the caller hint that the query isn't
getting any auto-increment values. And use it in MysqlUpdater when
appropriate.

Bug: T160993
Change-Id: If70450a64aa3bcbf763c62838bb21306d124ae3d
2018-02-28 13:58:37 -05:00
Brad Jorsch
aefb143a8e Database: Add batching to non-native insertSelect()
It would be easy for a call to nonNativeInsertSelect() to generate an
INSERT that's too big for the database to actually process. Add batching
to try to avoid that.

Bug: T160993
Change-Id: I1de994208d95926f0d75c0d7cab7b5fe1dd565c3
2018-02-28 13:58:37 -05:00
Aaron Schulz
26d87a26fe rdbms: make DBMasterPos implement Serializable
ChronologyProtector uses these classes to briefly store positions
and everytime the fields change then errors can happen when old
values are unserialized and used. Use a simple two-element map
format for serialized positions. The fields are recomputed back
from the data map.

Values from before this change will issue the warning
"Erroneous data format for unserializing". To avoid that, bump
the ChronologyProtector key version. Future field changes will
not require this.

This change should be deployed on all wikis at once.

Bug: T187942
Change-Id: I71bbbc9b9d4c7e02ac02f1d8750b70bda08d4db1
2018-02-23 12:46:28 -08:00
Fomafix
5ca659b287 CSSMin: Trim whitespace from attribute selectors and url tokens
* Trim whitespaces after opening and before closing parentheses and
  brackets.
* Ensure by test case that the invalid "url (" will not become the
  valid "url(" by minification.

This change also prevents the parsing problem in Firefox 57.0
https://bugzilla.mozilla.org/1418152 which is fixed in Firefox 57.0.1.

Change-Id: I804477ba7c6363f0e964fc8c7c0bc74d2d4c1a0d
2018-02-22 23:41:14 +00:00
Aaron Schulz
a9af460c3d rdbms: make sure non-native replace() uses one transaction
This is similar to what upsert() already does

Change-Id: Ide83eefe0d937fb2cdc20aa3c7dc9654c4d34beb
2018-02-20 19:21:38 -08:00
jenkins-bot
cefb552df4 Merge "build: Updating mediawiki/mediawiki-codesniffer to 16.0.0" 2018-02-19 19:07:12 +00:00
Umherirrender
63d96c15fd build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: I59b59f79bbf3ce4feff3b3a20c1c31bc16370531
2018-02-17 13:29:13 +01:00
Aaron Schulz
9b5b407a1b rdbms: make DatabaseMysql::masterPosWait() handle inactive GTIDs
Change-Id: I543deef24f6cbf99094a4f3bee7cabe768fa221a
2018-02-16 19:27:42 +00:00
Aaron Schulz
c9ad7037ce rdbms: do not bother making DBO_TRX transactions in IDatabase::lock()
Named locks are session-level constructs and this transaction agnostic.
Also make lockIsFree() a bit more consistent when the thread has the
lock itself.

Change-Id: Ief51196161bbc50c798740f3c738fd0e39880508
2018-02-15 16:32:35 -08:00
Aaron Schulz
ab46e904fe rdbms: make MySQLMasterPos handle inactive GTIDs
Change-Id: I328142a9fe10bccb2717a0a392e0c50d0c070390
2018-02-15 22:55:29 +00:00
jenkins-bot
bed43f5255 Merge "rdbms: avoid "SHOW MASTER/SLAVE STATUS" queries in the GTID case" 2018-02-14 23:37:34 +00:00
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00:00
Aaron Schulz
a114bd9f4d rdbms: avoid "SHOW MASTER/SLAVE STATUS" queries in the GTID case
The binlog file/pos where only being used in __toString() for the GTID
case. Make that method use the GTID set instead and avoid querying the
old-fashioned binlog fields all together in that case. The STATUS
queries involve some global lock contention.

Bug: T180918
Change-Id: I18123a702e4f554b87bf5f90017b248062e73049
2018-02-08 09:26:48 -08:00
Kunal Mehta
79de8fd02f Use wikimedia/object-factory 1.0.0
Deprecate the unnamespaced version and move it to includes/compat.

Bug: T147167
Depends-On: I39c805bfb98b32f32f3d0dc1eee9e823afe1c21a
Change-Id: I3780c7adf51683f3f7adb35a88f9a25a0a2e2530
2018-02-04 12:52:44 -08:00
jenkins-bot
a5f91ac24f Merge "JavaScriptMinifier: Fix "Uninitialized offset" in regexp char class parsing" 2018-02-02 23:54:28 +00:00
jenkins-bot
b6af56e2cc Merge "rdbms: Bump TransactionProfiler log entries to WARNING" 2018-02-02 04:00:28 +00:00
Aaron Schulz
f6c9b7a7b7 rdbms: Bump TransactionProfiler log entries to WARNING
Change-Id: I4816cfb8c8cd3b8e3dd2fe10c028c4654cc82854
2018-02-02 03:52:31 +00:00
Aaron Schulz
7206bd3468 objectcache: use region prefixes for mcrouter-backed WAN cache
This allows for mcrouter to have proper cross-DC and intra-DC timeouts.

Change-Id: If48f740f435d266a2050839f34611c0c8f36b3a7
2018-02-01 10:09:44 -08:00
jenkins-bot
04f94a57ad Merge "Move @group and @covers tags in tests close to class" 2018-01-31 14:51:26 +00:00
Aaron Schulz
6237fd11b6 rdbms: make affectedRows() work more consistently
* Update replace()/upsert() to combine the affected row
  count for the non-native case
* Also make replace() atomic in the non-native case,
  similar to how upsert() already works

Change-Id: I6c9bcba54eca6bcf4a93a9b230aaedf7f36aa877
2018-01-30 20:02:07 -08:00
Timo Tijhof
3316a00c26 JavaScriptMinifier: Fix "Uninitialized offset" in regexp char class parsing
Bug: T75556
Change-Id: I0bb63212dd44aec3c6b40477553dbf6a471bc7b3
2018-01-30 19:55:15 -08:00
Aaron Schulz
a3f51001c0 rdbms: clean up non-native Database::replace() code
* Make sure all unique keys specified have all their values
  provided to avoid large bogus DELETEs. Do not ignore them
  in such cases either, as that would cause inconsistencies
  between the native and non-native case. Use an exception.
* Make ChangeTags caller clearer that the list of indexes
  is not a list of fields for a single index. Also, avoid
  mentioning indexes for values not defined in the new
  records, as this causes errors or inconsistencies with
  the native vs non-native case.
* This also fixes the "Undefined index: ts_log_id" error
  when running unit tests on postgres.

Change-Id: I30263df22066bd6d4836202b1bcad5d1aa1e7383
2018-01-30 03:19:28 +00:00
Umherirrender
67d420b302 Move @group and @covers tags in tests close to class
For @group and @covers tags there should be no newline between the
comment and the class

Change-Id: I7277df13a332cf4d74ffdd8748e3fbdc259610dc
2018-01-28 13:30:07 +01:00
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
jenkins-bot
6bf34ad9c1 Merge "JavaScriptMinifier: Fix "Uninitialized offset" in string and regexp parsing" 2018-01-18 03:29:10 +00:00
Seb35
0ff2b7a776 Remove support for PHP extension 'mysql' (not mysqli!)
This PHP extension was deprecated in PHP 5.5 and removed in PHP 7.0.
The newer MySQL driver 'mysqli' is the default driver since MediaWiki
1.22 and 'mysql' was deprecated in MediaWiki 1.30.

Bug: T120333
Change-Id: Icff7a63ab47ae1483de87ba6486945974699362b
2018-01-17 10:48:47 -08:00
jenkins-bot
b3dc5c17af Merge "CSSMin: Remove XML declaration from SVGs" 2018-01-12 20:19:11 +00:00
Timo Tijhof
bee9f4db96 Remove various redundant '@license' tags in file headers
Redundant given this is the project-wide license already,
especially in file headers that already include the GPL license
header.

This and other minor fixups based on feedback from Ie0cea0ef5027c7e5.

* Add @file where missing.
* Move @ingroup and @deprecated from file to class doc where needed.

Change-Id: I7067abb7abee1f0c238cb2536e16192e946d8daa
2018-01-12 18:15:11 +00:00
Volker E
cdf11dff65 CSSMin: Remove XML declaration from SVGs
Removing unnecessary XML declaration prolog when embedding SVGs
as data URI and adding more complex elements & attributes to test.

Bug: T175318
Change-Id: Ibec8c2ab498554a6ad33b4420ae6258dcc80fcdf
2018-01-11 19:28:15 -08:00
Timo Tijhof
f2ef535e39 JavaScriptMinifier: Fix "Uninitialized offset" in string and regexp parsing
When parsing an incomplete string literal or regex literal at the end of a file,
$end would be set to an offset higher than $length, because the code
speculatively increases $end without correcting for this scenario.

This is due to the assumption that the strcspn() search will end because
an end character was seen, instead of simply ending because the string
doesn't have any further characters.

Bug: T75556
Change-Id: I2325c9aff33293c13ff414699c2d47306182aaa6
2018-01-11 17:47:59 +00:00
jenkins-bot
9b0f952442 Merge "Added tests for ComposerInstalled" 2018-01-10 06:04:37 +00:00
ryan10145
7d05534e88 Added tests for ComposerInstalled
Bug: T183899
Change-Id: Id822caad044a079884795dbea37baf10514bcf5c
2018-01-10 05:55:47 +00:00
Volker E
239ea7fe9f CSSMin: Re-introduce whitespace mangling in embedded SVGs
Convert newlines and tabs to spaces (which can be unencoded),
and consolidate runs of multiple spaces into a single space.
Also remove any leading and trailing spaces that might result
(most files end in a newline, for example).
Follow-up to Iddc98332d. This was reverted as dependency for the
original issues causing patch, but works perfectly fine.

Bug: T175318
Change-Id: Ic25d73caeb42ba7a32ef304806d401047b5a1997
2018-01-09 17:35:22 +00:00
Umherirrender
9954607848 Use namespaced version of IDatabase
Change-Id: I49c9b462d316763f90ebf5a95caa388716d6a278
2018-01-04 23:18:55 +01:00
daniel
33164b828f Add test for DBConnRef
Change-Id: I510b2ed22b3866392592a5df53aa0f3ff6aab750
2018-01-02 15:25:17 +01:00
jenkins-bot
4ad03aa11d Merge "Add @covers tags for more tests" 2018-01-02 12:19:02 +00:00
Kunal Mehta
823a96e2ce Add @covers tags for more tests
Change-Id: If2254b3a9e61e056091779a1ea14237aa7b42eb6
2018-01-02 11:52:42 +00:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00
Kunal Mehta
75160bdd3b Use MediaWikiCoversValidator for tests that don't use MediaWikiTestCase
Change-Id: I8c4de7e9c72c9969088666007b54c6fd23f6cc13
2018-01-01 08:28:02 +00:00
Kunal Mehta
bb9e1c1aa9 tests: Complete test coverage of HtmlArmor
Change-Id: I3c50ea56721226ddb37bcf4778a7d71e9b56d0f7
2017-12-28 00:56:12 -08:00
Kunal Mehta
cf0ebed65a Add @covers tags to objectcache tests
Change-Id: I5db623a582a0424f50d939aaa14fe29da9358b4f
2017-12-24 23:29:00 -08:00
Timo Tijhof
201c1d226c resourceloader: Improve JavaScriptMinifier code coverage
Change-Id: I234b996cfec8ef48ce3dc48aabbdf88bc9439c15
2017-12-22 18:36:09 +01:00
Umherirrender
29323f5622 Fix test class names to match convention
The test class should have Test at end
and same name as the testing class

Change-Id: Id0c90994d257fb325834e123b462f7f0849ac556
2017-12-10 11:41:59 +01:00
jenkins-bot
d965b71fbf Merge "objectcache: Fix HashBagOStuffTest test in PHP 7.1" 2017-12-01 22:30:15 +00:00
Aaron Schulz
b29ee7a960 objectcache: add WANObjectCache::getMultiCheckKeyTime method
Change-Id: I5675fabc5aa70f72659ce02d68caae88be20e06d
2017-12-01 21:45:32 +00:00
Timo Tijhof
7dbc5b0fe6 objectcache: Fix HashBagOStuffTest test in PHP 7.1
> There was 1 error:
>
> 1) HashBagOStuffTest::testEvictionAdd
> A non-numeric value encountered
>
> tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php:106

This warning is new in PHP 7.1, however the behaviour is not new.
This code was already not behaving as it should have. Concatenation
preceeds addition/multiplication. As such, this was producing
(int)-10 each time instead of (str)"key0" through (str)"key10".

Change-Id: Ibb1a59e373740772f02dfec77ee7ebd9d181d852
2017-12-01 13:28:36 -08:00
Aaron Schulz
73b928750c objectcache: Run preemptive WAN cache refreshes post-send
This keeps HTTP request time consistent in case of expensive keys

Change-Id: I0746fde29a6e2f27d1b92f1af599c741d5972f46
2017-12-01 08:15:26 +00:00
Aaron Schulz
e90eafdf61 objectcache: Make WANObjectCache interim caching not interfere with ChronologyProtector
Also removed useless line from testLockTSE(). That would have needed
to be using $this->internalCache and those locks are freed immediately.

Bug: T180035
Change-Id: Ida1a923f779aaf8410da76643457d2200da6cb20
2017-11-30 23:54:22 +00:00
jenkins-bot
b419ffba19 Merge "Database: Fix degenerate parenthesized joins" 2017-11-30 04:30:28 +00:00
Aaron Schulz
e0805d32e4 Disallow setting DBO_IGNORE in Database for sanity
In the off chance something called this, it would break all
sorts of code that expects that either query result functions
either succeed or throw an error.

Callers are not expected to have to check if the result of
a query is meaningful or false due to an error.

Change-Id: I0b4fe1403f55a399ffd40817ed12f857087d6f83
2017-11-29 21:31:03 +00:00
Brad Jorsch
2b2f9e229d Database: Fix degenerate parenthesized joins
The SQL standard supports parenthesized joins like

    a JOIN (b JOIN c ON (...)) ON (...)

But it doesn't support parenthesizing a single table name, i.e. a
one-table "join", like

    a JOIN (b) ON (...)

Detect the degenerate single-table case and omit the parentheses.

Bug: T181674
Change-Id: I82cacd80465092aa67ff19bdcfd6682001bf12ab
2017-11-29 15:42:27 -05:00
Aaron Schulz
ea22e3d1f6 objectcache: only give current format keys getWithSetCallback() callbacks
Callback code that happens to make use of $oldValue might not be able
to handle missing, new, or changed fields due to key version changes.

Overhaul testGetWithSetCallback_versions() to be cleaner and cover the
case of unversioned => versioned keys.

Change-Id: If108a73078c530c985d30bdadcbfa9ddd53dc2be
2017-11-28 21:26:06 +00:00
Aaron Schulz
300c655377 Use time forcing methods to avoid WANObjectCacheTest flakeiness
Use of microtime() is now just for baselines, and it is no longer
assumed to be increasing with each call. Such an assumption is
particuliarly bad on Windows.

I've done 100X run rounds with now failures on Windows.

Change-Id: Ica2a47982495bc95b10ca507414972744ea9507e
2017-11-28 06:50:44 +00:00
Aaron Schulz
0d7137099a objectcache: add "graceTTL" option to WANObjectCache::getWithSetCallback()
Also made worthRefreshExpiring() fully match the method documentation.

Change-Id: I48a4b1b9d006de100389b47c03c1185a9316abfc
2017-11-27 17:11:13 -08:00
Aaron Schulz
fce6862e46 objectcache: add "staleTTL" into WANObjectCache::getWithSetCallback()
This simply involves passing it through to the set() call

Also added some related commons to adaptiveTTL() involving
usage of this option.

Change-Id: Id5833a5d4efb6cad2eb646832e5b0188e86e12fc
2017-11-26 21:49:47 +00:00
Aaron Schulz
1772c4fe34 objectcache: add some WAN cache preemptive refresh tests
Added some extra sanity checks to WANObjectCache

Change-Id: Iac511b0cc1fc8d57ac98e9d7f2cacbcddc1c6db9
2017-11-22 18:38:53 -08:00
Aaron Schulz
4432e898be Add statsd metric support to WANObjectCache
Bug: T178531
Change-Id: I3037281d09cd5195347789f544deae89711f128b
2017-10-25 01:41:31 +00:00
Aaron Schulz
6b2f13b055 objectcache: Always use interim values on WAN cache tombstones
This stores values for very short times while the main
value is a tombstone in case of particularly high traffic.

Also make mutex keys expire immediately on unlock.

Change-Id: I4ec5cf7f8b49239fdd2518e5d955534877a0f7ee
2017-10-24 00:32:06 +00:00
Aaron Schulz
0fe50ad759 objectcache: Split off some code in WANObjectCache::getWithSetCallback
This makes it a bit easier to follow

Change-Id: I67968814ab046473eb8eca4086a8600c77417b82
2017-10-20 17:12:21 +00:00
Brad Jorsch
4bd3e80e7a Database: Support parenthesized JOINs
SQL supports parentheses for grouping in the FROM clause.[1] This is
useful when you want to left-join against a join of other tables.

For example, say you have tables 'a', 'b', and 'c'. You want all rows
from 'a', along with rows from 'b' + 'c' only where both of those
exist.

 SELECT * FROM a LEFT JOIN b ON (a_b = b_id) JOIN c ON (b_c = c_id)

doesn't work, it'll only give you the rows where 'c' exists.

 SELECT * FROM a LEFT JOIN b ON (a_b = b_id) LEFT JOIN c ON (b_c = c_id)

doesn't work either, it'll give you rows from 'b' without a
corresponding row in 'c'. What you need to do is

 SELECT * FROM a LEFT JOIN (b JOIN c ON (b_c = c_id)) ON (a_b = b_id)

This patch implements this by extending the syntax for the $table
parameter to IDatabase::select(). When passing an array of tables, if a
value in the array is itself an array that is interpreted as a request
for a parenthesized join. To produce the example above, you'd do
something like

 $db->select(
     [ 'a', 'nest' => [ 'b', 'c' ] ],
     '*',
     [],
     __METHOD__,
     [],
     [
         'c' => [ 'JOIN', 'b_c = c_id ],
         'nest' => [ 'LEFT JOIN', 'a_b = b_id' ],
     ]
 );

[1]: In standards as far back as SQL-1992 (I couldn't find an earlier
 version), and it seems to be supported by at least MySQL 5.6, MariaDB
 10.1.28, PostgreSQL 9.3, PostgreSQL 10.0, Oracle 11g R2, SQLite 3.20.1,
 and MSSQL 2014 (from local testing and sqlfiddle.com).

Change-Id: I1e0a77381e06d885650a94f53847fb82f01c2694
2017-10-13 19:12:16 +00:00
VolkerE
bd370e658f Revert "CSSMin: Improve encoding of quotes in embedded SVGs"
This reverts commit 5e3165f008.

Bug: T176884
Change-Id: I8bd9af67aeb11cb478ba402205ce834b1bec17a7
2017-09-29 14:45:27 +01:00
Esanders
ae336d89ef Revert "CSSMin: Mangle whitespace in embedded SVGs"
This reverts commit dfd42d2653.

Bug: T176884
Change-Id: Iddc98332d0b5a31d3a1c56c14014a53a06393f21
2017-09-29 14:45:14 +01:00
Timo Tijhof
6c8f3b9683 objectcache: Improve WANObjectCache test coverage
class WANObjectCache (methods: 40% -> 67%, lines: 65% -> 88%)

* Allow indirect coverage of protected/private utility methods from
  existing tests.
* Add basic test for setLogger().
* Add basic test for newEmpty().
* Add basic test for getQoS().

Change-Id: Ifb79ed2ff1febbd2f5477b8ed6319992ce88eb29
2017-09-28 18:59:09 +01:00
Timo Tijhof
71f7b56520 objectcache: Improve WANObjectCache test coverage
class WANObjectCache (methods: 30% -> 40%, lines: 62% -> 65%)

* doGetWithSetCallback: 98% -> 100%
 - Add case: Throw for invalid callback.
* getWithSetCallback: 86% -> 100%
 - Cover case: Else branch for `$cur[self::VFLD_VERSION] === $version`.
* getMulti: 91% -> 98%
 - Cover case: If branch for `$this->warmupCache`.
* set: 93% -> 100%
 - Cover case: If branch for `lockTSE >= 0`.
* reap: 84% -> 100%
 - Add case: Error when changeTTL() fails.

Change-Id: I4844ab0ebdd4d3ec9acc9cd4500721b04cfda317
2017-09-26 00:22:23 +01:00
Aaron Schulz
01307b2cc9 Allow two-queue style insertion in MapCacheLRU
Change-Id: I1cd98ea8965b51e43371efd990fb9302bb507928
2017-09-25 21:28:38 +00:00
Roan Kattouw
dfd42d2653 CSSMin: Mangle whitespace in embedded SVGs
Convert newlines and tabs to spaces (which can be unencoded),
and consolidate runs of multiple spaces into a single space.
Also remove any leading and trailing spaces that might result
(most files end in a newline, for example).

Bug: T175318
Change-Id: Ic66c6acb37079cae84dd80ab2d5f2c829cf2df96
2017-09-19 18:52:54 +00:00
Roan Kattouw
5e3165f008 CSSMin: Improve encoding of quotes in embedded SVGs
When a URL (data: or otherwise) contains quotes, don't wrap it in
double quotes (") but in single quotes ('). This then allows
us to unencode double quotes (") in the data URI embedding of SVGs.

Bug: T175318
Change-Id: I3e7eab64e1c3e82066014fb594f82d786983ce90
2017-09-19 18:04:27 +00:00
Roan Kattouw
a4631b92e7 Improve encoding of embedded SVGs
Unencode spaces, slashes, colons and equals signs.

Bug: T175318
Change-Id: Idebdfca8f93d5e090deba5bf5a256d7054e2d6c8
2017-09-14 11:39:57 -07:00
Umherirrender
86463f3df6 build: Updating mediawiki/mediawiki-codesniffer to 0.12.0
Change-Id: Iefaae5043fa77d5d556c31079549dab8f61bd3ef
2017-09-10 21:11:37 +02:00
MusikAnimal
a23183010e Rename IP::isValidBlock to isValidRange, deprecating the former
This is to remove confusion with the MediaWiki Block class.

All instances of isValidBlock within MediaWiki core have been updated.

Usage of this function will be more widespread with this patch:
https://gerrit.wikimedia.org/r/#/c/349457/

Change-Id: Ice1bdae3d16cf365da14c6df0e8d91d2b914e067
2017-08-29 18:26:12 +00:00
Umherirrender
3f1a52805e Use short type bool/int in param documentation
Enable the phpcs sniffs for this and used phpcbf

Change-Id: Iaa36687154ddd2bf663b9dd519f5c99409d37925
2017-08-20 13:20:59 +02:00
Umherirrender
5544cef16b Add missing type to @param documentation
Change-Id: I6b2c9c7af9a281fe457099cc3a336a60a25e74aa
2017-08-11 20:37:35 +02:00
Umherirrender
43e8cd0579 Make phpcs pass
Reenable MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace,
because the mentioned bug is fixed

Bug: T172933
Change-Id: I1593bdba2295ebed401b921f2beabed69dba7638
2017-08-11 16:22:42 +02:00
jenkins-bot
3639515010 Merge "MimeAnalyzer: Add testcases for mp3 detection" 2017-08-09 16:36:23 +00:00
jenkins-bot
225c233192 Merge "rdbms: Complete coverage for Database::selectSQLText()" 2017-07-28 21:02:54 +00:00
Timo Tijhof
da6235ce3a resourceloader: Fix @covers for CSSMin tests
Change-Id: Idb451d244fbdfbb218a56c2953298b7fe29ed3d4
2017-07-27 21:40:21 -07:00
Timo Tijhof
9491b74d00 rdbms: Complete coverage for Database::selectSQLText()
Only missing cases where 'USE INDEX' and 'IGNORE INDEX'.
The test doesn't do much since the underlying methods are no-ops
by default, but at least it ensures there are no PHP errors from
these branches.

We can later re-use some of these test cases in tests specific
to one backend.

Change-Id: Id004a2ae41efaa7a367f964013e25d98ecc591ff
2017-07-27 21:30:07 -07:00
Aaron Schulz
f4e0c720a8 rdbms: Ensure onTransactionPreCommitOrIdle() callbacks don't lead transactions
If no writes started a transaction yet, the callback would run
but not commit (by design, joining the request round). Later
writes will then pile on top of it.

The point of this method is to avoid such cases, so this edge
case has been fixed.

Change-Id: I9b44b19261d679de4aff6e44a9cfeb4f684ce02e
2017-07-26 14:28:48 -07:00
jenkins-bot
07917cd2dd Merge "rdbms: Increase coverage for Database::selectSQLText()" 2017-07-25 10:20:35 +00:00
jenkins-bot
8f75b093da Merge "rdbms: Add more @covers to DatabaseSQLTest" 2017-07-25 10:20:32 +00:00
Timo Tijhof
f357c5194c rdbms: Increase coverage for Database::selectSQLText()
* Add case for `$tables[0] == ' '`.
* Add case for `$tables == ''`.
* Add case for 'DISTINCT' option.
* Add case for 'FOR UPDATE' option.
* Add case for 'LOCK IN SHARE MODE' option.
* Add case for 'EXPLAIN' option.

Change-Id: I4a5f4754bc30d31ec35a085f39321fd358b6aa49
2017-07-24 19:49:17 -07:00
Timo Tijhof
b70a3bb821 rdbms: Add more @covers to DatabaseSQLTest
Many of the main methods here have, over the years, been split up
into several protected/private methods.

Change-Id: I1b8489b1c61c0294288442a0a0cd28c9fa77f82e
2017-07-24 19:44:06 -07:00
Brad Jorsch
edf69e62d8 MultiWriteBagOStuff: Fix async writes of mutable objects
If someone writes an object into a BagOStuff, they typically expect that
later changes to the object will not affect the value stored.
MultiWriteBagOStuff's async write handling was violating this
expectation, which is potentially causing T168040.

Bug: T168040
Change-Id: Ie897b900befdc8998614af06f9339cd07665703e
2017-07-25 02:08:00 +00:00
jenkins-bot
4a5f646a7f Merge "CSSMin: Skip #default#behaviorName when detecting local files" 2017-07-24 19:49:32 +00:00
Julien Girault
032f0ce8cb CSSMin: Skip #default#behaviorName when detecting local files
Bug: T162973
Change-Id: If76869910f308f8a91c73f287e7e74c214f02e9b
2017-07-23 01:05:39 +02:00
Timo Tijhof
7928eca292 rdbms: Complete DatabaseDomain code coverage
Add missing coverage for:
* DatabaseDomain::equals()
* DatabaseDomain::newUnspecified()
* DatabaseDomain::__toString()

Change-Id: I38863c5652ec395e7194bfb85b3485e3343a3b7e
2017-07-21 20:21:39 -07:00
Timo Tijhof
ddb7575e4e rdbms: Refactor DatabaseTest
* Move DatabaseTest and DatabaseSQLTest to libs,
  and remove MediaWikiTestCase dependency.

* Refactor DatabaseTest to be a test of the Database abstract class,
  not of whatever current DB backend is configured by LocalSettings.

  - Remove most switches/conditionals and other tests for specific
    database backends. Move those to individual test classes for
    those backends instead.
  - Some tests appear to have been integration tests for the PHP driver
    and/or the db backend itself. Moved to a new DatabaseIntegrationTest.
  - Now that only the abstract Database is invoked, the test runs a bit
    faster (no real connections/queries).

* Add missing @covers tags, and remove or fix broken ones
  (follows-up 26e52f0c49).

Change-Id: I9dc4a558e701d00e95789e7eb8e02926783b65ad
2017-07-20 18:23:37 -07:00
Timo Tijhof
b857284f71 rdbms: Move DatabaseMysqlBaseTest to libs tests
* Remove MediaWikiTestCase dependency.
* Add missing @covers tags.
* Add missing visibility/static declarations.

Change-Id: I2d81a9265016174e7b4ff810f140f7d031ce9f14
2017-07-20 17:15:25 -07:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
jenkins-bot
b4ba469f26 Merge "Record TransactionProfiler violations beyond the first-by-type" 2017-06-28 01:13:14 +00:00
Aaron Schulz
e447f90896 Record TransactionProfiler violations beyond the first-by-type
Beyond giving a more complete picture, this can be used to adjust
the PostSend criteria to log master queries under the restInPeace()
entry point.

Bug: T166199
Change-Id: If5cf704ba10291d0eba63e66b388666fde3ca649
2017-06-27 16:44:33 -07:00
jenkins-bot
bc213a9d46 Merge "build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0" 2017-06-27 08:57:28 +00:00
jenkins-bot
8ddf721b6f Merge "Remove "@author Bryan Davis" and "Brad Jorsch" annotations" 2017-06-27 06:02:23 +00:00
Bryan Davis
aaf1e17088 Remove "@author Bryan Davis" and "Brad Jorsch" annotations
Undo traces of a practice we carried over from past projects and
existing examples that is neither universal nor actively encouraged in
the MediaWiki codebase.

Bug: T139301
Change-Id: I5c9c89b72a45a44aa4264a5e57b003c1a86cdf6e
Co-Authored-By: Brad Jorsch <bjorsch@wikimedia.org>
2017-06-26 15:25:46 -06:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
Timo Tijhof
dd629564df objectcache: Forward MultiWriteBagOStuff::makeKey to primary backend
Similar to what WANObjectCache and CachedBagOStuff are already doing.

Also add missing tests for WANObjectCache (similar to those for CachedBagOStuff).

Bug: T167465
Change-Id: I1a0c9324726aa6a1b221def985773b1b819181fd
2017-06-14 18:11:55 +01:00
Amir Sarabadani
bc74afc67e Move HttpAccept* to libs
Bug: T163923
Change-Id: I4984f6b77843669950afeff82351827cd416a80d
2017-06-12 18:28:25 +04:30
Derk-Jan Hartman
c6235442b4 MimeAnalyzer: Add testcases for mp3 detection
This is a follow-up to change Ie1a63aa

Bug: T115170
Change-Id: Iab5e19e1dd26b0d88c72ad7253cd11e865c5e008
2017-06-08 00:27:33 +00:00
Aaron Schulz
83fcb86dfa objectcache: add getMultiWithUnionSetCallback() method
This supports callbacks that fetch all the missing values at once.

Change-Id: I74747cc06f97edc9163178180597e6651743b048
2017-05-30 23:34:28 +00:00
Aaron Schulz
6ddaf52d32 objectcache: respect process cache in getMultiWithSetCallback()
Backend cache queries are now avoided if they are fresh in memory.

Also factor out some code into private methods for clarity.

Change-Id: Ib343fde3dbf63f39e8cb09eca6278811a7d9738b
2017-05-26 15:34:45 -07:00
Aaron Schulz
0c24cefa12 objectcache: fix cache warmup bug in getMultiWithSetCallback()
The warmup cache was not properly prefixed and was also using the entity
IDs instead of the cache keys. Thus, it effectively just wasted a
getMulti() query and resulted in the usual separate GETs anyway.

Added some unit tests for this.

Change-Id: I75b7a31214b515511856f9d95db32e8881d80ccc
2017-05-26 04:28:13 +00:00
Derk-Jan Hartman
f441e09c9a Tests: correct order of assertEquals arguments
Change-Id: Ib8d1e8aa92172a9abc0495dc0c18ea5df850dd5e
2017-05-19 13:41:16 +02:00
jenkins-bot
dca600fe7c Merge "CSSMin: Support parenthesis and quotes in url references" 2017-05-05 18:58:22 +00:00
Timo Tijhof
bb36c7b32a CSSMin: Support parenthesis and quotes in url references
Previously they were often being cut short due to the url pattern
ending at the first single quote, double quote or closing parenthesis
regardless of which of those started the url match.

Running benchmarkCSSMin.php before and after the change doesn't seem
produce consistent improvement or regression. Repeated runs with count=100
with and without this change both have a median between 2.6ms and 2.9ms
using PHP 5.6, and between 2.6ms and 2.8ms using HHVM 3.12.

Bug: T60473
Change-Id: I6d6a077ad76588f3ed81b1901a26b7e56d2157ee
2017-05-05 18:33:24 +00:00
Paladox
54c56da85a Fix php code style
Preparation change for updating mediawiki code sniffer to 0.8.0

Change-Id: Ib0b3fe4afea9096ffa3a1347b4f7e07d3398b0b2
2017-05-05 12:03:54 +00:00
Gergő Tisza
525bfbc8df Switch to librarized version of TestingAccessWrapper
Replaces \TestingAccessWrapper (defined in core) with
\Wikimedia\TestingAccessWrapper (defined in the composer package
wikimedia/testing-access-wrapper).

See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper
for downstream patches.

The core version of the class is kept around for a while to avoid
circular dependency problems.

Bug: T163434
Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8
2017-04-20 14:15:57 +00:00
Timo Tijhof
0977b6c1f6 phpunit: Avoid use of wmf-production host names
* Remove used of 'eqiad' and 'wmnet' in unit tests.

Change-Id: I5bf19b63876e4dc8deaca8cd9907dca0bfa15455
2017-04-12 02:53:33 +00:00
Aaron Schulz
9b459d29e0 Add EtcdConfig class
Bug: T156924
Change-Id: I60914d31c21484bfb935fe3d8c3168b51a2d5d1b
2017-04-10 07:36:33 +00:00
Timo Tijhof
8e81621dcf objectcache: Complete code coverage for CachedBagOStuff
Change-Id: I8a228d68701f1ad4d37f60de53d105c32898dc8b
2017-04-07 23:31:41 +00:00
Timo Tijhof
a116bc58b5 objectcache: Fix CachedBagOStuff to use backend makeKey()
Follows-up 25dbd91513.

Change-Id: Ib727c57cb27f05c0462bfdfee89a185ef6603ddd
2017-04-07 23:31:25 +00:00
Timo Tijhof
447ce7e39a phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat
The default will remain PHPUnit 4.x due to PHP 5.5 support.

But, we should allow developers to run tests with newer PHPUnit
versions which are noticably faster (especially for code coverage
reports).

* <https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0>
  PHPUnit 5 deprecates the getMock() shortcut for getMockBuilder()->getMock().
  It instead introduces the shortcut createMock() which has better defaults
  than getMockBuilder(). For example, it sets 'disableArgumentCloning' and
  other things by default.

  Going forward, code should either use getMockBuilder directly and configure
  it using the setter methods (instead of the confusing variadic arguments
  of getMock) or simply use the new minimalistic createMock method. This patch
  backports the createMock method to MediaWikiTestCase so that we can start
  using it.

Change-Id: I091c0289b21d2b1c876adba89529dc3e72b99af2
2017-04-06 00:44:32 +00:00
jenkins-bot
eca93b7c40 Merge "Add class for service discovery using DNS SRV records" 2017-04-04 22:26:39 +00:00
jenkins-bot
4d11ecc013 Merge "ObjectFactory: Complete code coverage for ObjectFactoryTest" 2017-04-01 02:59:01 +00:00
Timo Tijhof
8bada02a0f ObjectFactory: Complete code coverage for ObjectFactoryTest
Cover missing case of expandClosures() where the array contains
both a closure and a non-closure.

Change-Id: I30ea8cf3fb909a499a95bf9bd24792f4dd6b5c64
2017-03-31 18:07:59 -07:00
Timo Tijhof
751f2b9d25 objectcache: Complete code coverage for HashBagOStuff
Change-Id: I06cb9778df8239706bf82c0c39cccb419eade4b2
2017-03-31 18:03:38 -07:00
Kunal Mehta
c186794722 Add class for service discovery using DNS SRV records
The SrvDiscoverer class can be used to find services (e.g. etcd) using
DNS SRV records.

Change-Id: Ia636d02535a3bb592eb896137cfb787a9ce6442a
2017-03-29 12:59:51 -07:00
Thiemo Mättig
549c1f6dd7 Add tests for CSSMin::getMimeType
Direct follow up for I1768646. The tests are copied from my patch
If985f33, with one important difference: Now the file extension always
wins. Mismatches are not fixed any more by this code. This is intended.
See the discussion at I1768646.

Change-Id: I06b873a808d58ae7e53272765b156ac0fa293c2c
2017-03-26 18:08:06 +02:00
Kunal Mehta
a57b64436c Use wikimedia/timestamp
Bug: T100924
Depends-On: I0a067367cda6885fa45631ed7c18799d653dc9bf
Change-Id: I69ba64e364df8af089c1c918cdf32f99454e693a
2017-02-28 21:15:38 -08:00
Aaron Schulz
64df456b39 Move remaining LoadBalancer classes to Rdbms
The old names are left as aliases.

Change-Id: I52a327f2463a2ba7437324047b5b00d28cd1d758
2017-02-23 20:38:31 -08:00
James D. Forrester
1e9c361960 tests: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I46261416f7603558dceb76ebe695a5cac274e417
2017-02-21 02:14:34 +00:00
Aaron Schulz
38b31bc8db Move DatabaseDomain to Rdbms namespace
Change-Id: Ifb06e792a36b5123ec3596933d0d394711ee5d08
2017-02-07 13:21:40 -08:00
Aaron Schulz
2e5eb693de objectcache: add WANObjectCacheReaper for assuring purges
* This fixes keys based on some sort of change log.
  Updates are wrapped in a mutex and keep track of the
  last known good position.
* Make WANObjectReapUpdate class that cleans up title
  related keys using the recentchanges table. This triggers
  as a deferred updates on RC view.

Change-Id: I7f14b9ca2533032147e62b1a3cc004a23da86579
2017-01-27 02:21:06 +00:00
Brion Vibber
bf2c7b02b8 Add test case for Opus file check
Test case for Opus file check so we don't regress!
Confirms the fix for T151352 that Opus files return
type 'audio' and not 'multimedia'.

Bug: T151352
Change-Id: Ib868793d90b60609ccec25726e6fbaa28bffebaf
2017-01-17 13:24:16 -08:00
addshore
05ab20fcc6 Remove Atomic methods from ConnectionManagers
Change-Id: I697f63f45975b13af52bc22fced6e4d07e35115f
Depends-On: I4341a1b4ff6a67e4c1770faae38e9b126f1bf0bf
2016-12-02 04:50:29 +00:00
addshore
a4bd573142 Fix SessionConsistentConnectionManagerTest class and file name
Change-Id: If60f081946b8f3bb564f2bb17fd1261af0cb7e3a
2016-12-01 00:15:57 +00:00
addshore
c3c3cf9696 Add DB ConnectionManagers
This moves and refactors the ConsistentReadConnectionManager
from Wikibase into the core rdbms lib.
The refactoring also creates a generic ConnectionManager.

This relates to Iff20a22f9f2bc7ceefd6defc0ed9a494a6fe62c0
which introduced a DB factory / connection manager in
an extension revealing the need for this in multiple places.

Change-Id: I0c58e15aed5bed88323d18cb95e5008f8d3381c5
2016-11-30 11:43:22 +00:00
Hashar
4d487d1942 Revert "objectcache: detect default getWithSetCallback() set options"
Causes HHVM 3.12.7 to segfault and or:
Fatal error: Stack overflow in includes/libs/objectcache/BagOStuff.php on line 754

This reverts commit b47ce21cec.

Bug: T150833
Change-Id: Ia52fdf65f5e386c0eaa1046328680fb5c8a9081a
2016-11-16 10:35:27 +00:00
Aaron Schulz
b47ce21cec objectcache: detect default getWithSetCallback() set options
This works by setting a callback to return the cache set
options. The callback will watch DB reads and create a
merged result from said usage.

This handles callers that are missing getCacheSetOptions().

Change-Id: Ia264f011e45e8cf105480955dad7e2c4c2357b73
2016-11-16 04:53:53 +00:00
Bartosz Dziewoński
c48e061f67 CSSMin: Correctly avoid fallbacks when embedding SVG files
The check for file existence before checking its MIME type was
building the path incorrectly, causing this piece of code to always
think the file does not exist. (The code to actually embed the file
was correct.)

This was not caught by the tests before of a bug in the test code,
which cancelled out this one.

Bug: T100958
Change-Id: I4469079f41d48052d0a02f98bb1ed02407abd54c
2016-11-02 10:26:21 +01:00
Aaron Schulz
43ff2a83b5 objectcache: avoid using process cache in nested callbacks
Because the process cache can be lagged by virtue of blind TTL,
the HOLDOFF_TTL might not be enough to account for it, so avoid
using it when already inside a callback.

Also split of the tests from the MediaWiki test class, so this
does not require DB access anymore.

Change-Id: I743a1233a5efc7f036fad140a9ff8a30b32f8f27
2016-10-20 22:13:29 +00:00
Kunal Mehta
75fefc066b checkComposerLockUpToDate: Always check dependencies
Upstream composer has replaced the 'hash' with a smarter 'content-hash',
but instead of re-implementing (or copy-pasting) all of that in MediaWiki
we can just compare the dependencies themselves, since that's all we
care about.

Bug: T147189
Change-Id: Ic2f22a82699e2b707b6ccb355605999a183a56a0
2016-10-16 12:49:41 -07:00
Aaron Schulz
0d87d67d61 Move MimeMagic code to libs/mime/MimeAnalyzer.php
* The later resides in /libs with related files.
* Explose MimeAnalyzer as a service.
* Keep MimeMagic::singleton() as a b/c alias.
* MimeMagic::applyDefaultConfig() will bootstrap the service
  with all of the old config, extension hook handler, and
  detector command shell-out behavior.

Change-Id: Ie2695a52e7a3bcfda9f7fa83659a9ff31b372bc3
2016-10-15 00:05:16 +00:00
Timo Tijhof
1cdecd581d objectcache: Fix test coverage
Follows-up 24200e8, 37df4f8. Test coverage still broken.

> Trying to @cover not existing method
> "WANObjectCache::getMultitWithSetCallback".

Change-Id: Ie4c9a998ea352f93f3c7dcdea25ea5c017ffbab5
2016-10-11 21:48:44 +02:00