| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Found via disabling phan's alias support for a run (and ignoring wgLang's
hard-coded state of being a \Language, alas).
Change-Id: I4753bcd84d72d6de111fc7ffc5841fa417bf7333
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* Maintenance scripts in core have bolierplate code that is
added before and after the class to allow directly running
the maintenance script.
* Running the maintenance script directly has been deprecated
since 1.40, so this boilerplate code is only to support a now
deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
coverage reports as it cannot be marked as covered and also
is for deprecated code.
What:
* Wrap the boilerplate code (requiring Maintenance.php and then
later defining the maintenance script class and running if the
maintenance script was called directly) with @codeCoverageIgnore
comments.
* Some files use a different boilerplate code, however, these
should also be marked as ignored for coverage for the same
reason that coverage is not properly reported for files.
Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
|
|
|
|
|
|
|
|
|
|
|
|
| |
And start using them instead of wfGetDB(), LB/LBF connection methods or
worse, $this->getDB().
$this->getDB() reuses the database object regardless of whether you're
calling a replica or primary, leading to returning a replica on a
primary and other way around.
Bug: T330641
Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
|
|
|
|
|
|
|
| |
Around fifty-ish. Found becuase of fixed MigrateSelect.
Bug: T344971
Change-Id: If85428d5a033822bfd8ee1f6ab730863bfad55bd
|
|
|
|
|
|
|
|
|
|
|
| |
Maintenance class provides a method for getting a fresh reference
of the MW services container instance. Let's make use of these in
maintenance scripts now that we have it.
NOTE: There are still some static methods like in refreshLinks.php
that makes use of services that we can't use this method for now.
Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
|
|
|
|
|
|
|
| |
Done semi-automatically via a php parser written on top of ANTLR4.
Bug: T311866
Change-Id: I33f5b6703c0aa9c80c907a21c2a770e30642edd3
|
|
|
|
|
|
|
|
|
| |
The function getDB is called with DB_REPLICA and with a string
(cluster), which looks broken.
Found by phan strict checks
Change-Id: Id3af4fec2661902590ace91c2b1631584bf8f8b6
|
|
|
|
|
|
| |
Useful for logging
Change-Id: I79fe037abcd74f56c935abc118d706bef0198124
|
|
|
|
|
|
|
|
| |
This allows us to remove many suppressions for phan false positives.
Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
|
|
|
|
| |
Change-Id: I8944a052f51a1941ad3b76a40fc9c46d1363c426
|
|
|
|
| |
Change-Id: Iced52ae65d31d1ca0cd2c64ebc9ab56b2aef9617
|
|\ |
|
| |
| |
| |
| |
| |
| | |
@deprecated since 1.27
Change-Id: I11a7253cebe525948a55cebee183e6de128fdc39
|
|/
|
|
|
|
|
|
|
| |
Per documentation on IDatabase, $conds must be a string or an array.
Passing false for conds is confusing, since it's unclear whether this
should match everything or nothing.
Bug: T188314
Change-Id: I8be1ac4cbdaafc41aadc2a658be8a99b754b0268
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
|
|
|
|
|
|
|
|
| |
Deprecate the second argument to Maintenance::error() in favor of a new
Maintenance::fatalError() method. This is intended to make it easier to
review flow control in maintenance scripts.
Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
|
|
|
|
|
|
|
|
|
| |
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.
The old constant is an alias now.
Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|
|
|
| |
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
|
|
|
|
| |
Change-Id: I9ad6745d84506b736dae94747256caac89715899
|
|
|
|
| |
Change-Id: I6b58d014a4bfd6600e4e6f80188fdcfce18482ca
|
|
|
|
| |
Change-Id: Ia39b316e01797ddedd71885c2f05fe57ba4b89e9
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.
Also updated usage in text in documentation and the
installer LocalSettingsGenerator.
Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;
Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Squiz.WhiteSpace.LanguageConstructSpacing:
Language constructs must be followed by a single space;
expected "require_once expression" but found
"require_once(expression)"
It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.
Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.
It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.
Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
|
|
|
|
| |
Change-Id: Id86d06d3c22a69f7e378bf6e75b5c78ef8b47c51
|
|
|
|
|
|
| |
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)
Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
|
|
|
|
|
|
|
|
| |
Was throwing Strict Standards: Declaration of OrphanStats::getDB()
should be compatible with that of Maintenance::getDB()
in maintenance/storage/orphanStats.php on line 25
Change-Id: I7451ada12a8c45aa37883b4b3803fbf505eec15b
|
|
|
|
| |
Change-Id: I8ed3f3bad954dd03bd80d23954e31ee5429c04fe
|
|
|
|
|
|
|
|
|
|
|
| |
maintenance rewrite). Right now, including a maintenance script causes it to execute. This is bad when you want to reuse the particular class but not have it start executing all by itself.
Until now, we relied on setting MW_NO_SETUP which was a) hacky, b) irreversable, and c) likely to be forgotten if you didn't use one of the wrappers like runChild().
Instead, move the freaky magic to doMaintenance and have *it* check if it's in a specific call stack that indicates this is being run from the file scope and should be executed. Rename DO_MAINTENANCE to RUN_MAINTENANCE_IF_MAIN so it's nice and clear what magic happens behind the require_once().
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/80205
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/77711
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/69920
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/66751
|
|
|
|
|
|
|
| |
out early if blob_orphans doesn't exist. dumpRev could use a nice description.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/55403
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/45355
|
|
dropping the tracked orphans.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/44799
|