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
Updating name & email addresses for Brooke Vibber.
Re-ran updateCredits.php as well so there are some new entries in
there as well.
There are a couple of files in resources/libs that will have to
be changed upstream to keep tests happy, I will do patches
later. :D
Change-Id: I2f2e75d3fa42e8cf6de19a8fbb615bac28efcd54
This makes BackupDumper compatible with the new mechanism for accessing
revision content.
This requires some changes to the way database connections are re-used,
since RevisionStore/SqlBlobStore needs to be able to run queries against
the database while the overall result set is being streamed.
This change does not yet add handing for extra slots to BackupDumper.
That first needs a spec for how extra slots will be represented in the
XML schma (T174031).
NOTE: this changes the output of fetchText from using integer text_id
values to using content_address values (e.g. "tt:4567" for text row
with old_id 4567). It also changes fetchText to accept such addresses
as input, for forward-compatibility. XML stub dumps still use the
numeric format in the id attribute, pending T199121.
Bug: T198706
Change-Id: If4c31b7975b4d901afa8c194c10446c99e27eadf
Broken since 4abb459392 (2015) but
hidden since maintenance scripts would pass through all opts,
even those not specifically added.
Bug: T201803
Change-Id: Ic55bf3d970d768b796848a77abf7b0eb6616c013
There's no reason for this to have to live in Maintenance land. It's
generally useful and lets us avoid some random require/include calls
Change-Id: I60419c7f9fc52313905053bbeb3aa81666c9160c
The insertId() method was returning a string, which caused the
returnValueMap not to trigger due to int/string mismatches.
Also add sanity integer cast to WikiPage::insertOn().
Added a few more type docs.
Bug: T75174
Change-Id: Id1090f3e3d0481272a3d13c3af8f2588f06dc912
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
Found by applying etsy/phan to the mediawiki codebase, in preparation
for getting it running more regularly via CI. Has no effect on how the
code runs, simply does a better job of documenting the code.
Change-Id: I4c844a51df3ffe4fbb96cac25f3eff2f7a9faca2
Use the Maintenance class's new $orderedOptions and support for
passing options multiple times. This allows for option "chaining".
The BackupDumper and TextPassDumper class now extend Maintenance, but
should continue to function as before. The public function processArgs()
has been removed and replaced by processOptions(), which takes no
parameters. It is unlikely that users of these classes were calling
processArgs.
Inheritors of these classes that overrode processOption() will now need to
override processOptions() and use Maintenance::getOption() and friends.
The maintenance/backupTextPass.inc file has been deleted. Users should
include maintenance/dumpTextPass.php instead.
Bug: T122587
Change-Id: I2473ee119c185d1b2b00ac4b1e70ee8a6cafe4a3
The default buffer size of 512KB seems to unconveniently high for
checkpoint tests. To be able to speed up tests in a follow-up commit,
we allow callers to set the buffer size to use for reads of the stub.
Bug: T70653
Change-Id: Ib63e89fac2abaac8feb542839d4d8e53c917ebe1
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
By PSR2 PHP Standard, the files should ends with exactly one newline.
Some of our files have 2 or more and some other were missing a newline.
Fix almost all occurences of CodeSniffer sniff:
PSR2.Files.EndFileNewline.TooMany
I have not fixed the selenium files, I believe we will drop them.
Change-Id: I89fca8c1786fee94855b7b77bb0f364001ee84b6
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