| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I2c1bc3b4e0ee782076ddaeae133672b730d345d9
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Remove unused $db parameter and make the $cluster required. Update
the checkStorage.php callers to provide the cluster.
Use the getTable() method in trackBlobs.php to avoid duplication.
Mark this method as @internal to the class and /storage scripts.
Change-Id: I888040a536a60e22e780900a59e4c34b6c468cdf
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I7dec01892a987a87b1b79374a1c28f97d055e8fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: T361023
Change-Id: Ieb229d8088cb1ff3f03e44f7ac99eb612f48bc7b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid the call to internal constructor of AndExpressionGroup and
OrExpressionGroup by creating a factory function similiar as the
IReadableDatabase::expr function for Expression objects.
This is also a replacement for calls to ISQLPlatform::makeList with
LIST_AND or LIST_OR argument to reduce passing sql as string to the
query builders.
Created two functions to allow the return type to be set for both
expression group to allow further calls of ->and() or ->or() on the
returned object.
Depending on the length of the array argument to makeList() it is
sometimes hard to see if the list gets converted to AND or OR, having
the operator in the function name makes it easier to read, so two
functions are helpful in this case as well.
Bug: T358961
Change-Id: Ica29689cbd0b111b099bb09b20845f85ae4c3376
|
|
|
|
|
|
|
| |
Completely unused.
Bug: T363839
Change-Id: I041ab5ce57ef116076dcc07b2035b5336ceff032
|
|
|
|
| |
Change-Id: I74302c9b2818e02d7d5e67a728558ced5e8f0181
|
|
|
|
|
|
|
|
|
|
| |
* Change `$services->getDBLoadBalancerFactory()->waitForReplication()`
to `$this->waitForReplication()`
* Change various complicated expressions to `$this->getReplicaDB()`
and `$this->getPrimaryDB()`
* Remove unused variables
Change-Id: Ia857be54938a32bb6288dcdf695a35cd38761c3c
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This was somehow left out
Bug: T210206
Change-Id: I70851b5b99fa865dbfd629caf2c1866c85418350
|
|
|
|
|
|
|
|
|
| |
Tests are not checked.
There is nothing left as far I can check.
Bug: T353219
Change-Id: I1d58397118c7ab1110b9d7cf400c59c4bff7378c
|
|
|
|
|
|
|
|
|
|
| |
For readability. Allowed since PHP 7.4.
I searched for integer literals of 6 or more digits, and also changed
some nearby smaller numbers for consistency.
Bug: T353205
Change-Id: I8518e04889ba8fd52e0f9476a74f8e3e1454b678
|
|
|
|
|
| |
Bug: T210206
Change-Id: Ie7bf3701fa9d51a43167ce7ec0c1f30bc090296b
|
|
|
|
|
|
|
| |
Around fifty-ish. Found becuase of fixed MigrateSelect.
Bug: T344971
Change-Id: If85428d5a033822bfd8ee1f6ab730863bfad55bd
|
|
|
|
|
|
|
|
|
|
|
| |
Done semi-automatically via migrateselect[1]. The script only accepted
ascii chars until I found out and fixed it and now I can run it in more
places.
[1] https://gitlab.wikimedia.org/ladsgroup/migrateselect
Bug: T344971
Change-Id: I83b6c424c62a517a0ab3635b64488ea53fd88bab
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Reduce raw sql fragments on simple compares
Change-Id: I3f2340dfdbf5197cc22546911e6c5653dc5a6269
|
|
|
|
|
|
|
| |
Done semi-automatically via a php parser written on top of ANTLR4.
Bug: T311866
Change-Id: I33f5b6703c0aa9c80c907a21c2a770e30642edd3
|
|
|
|
|
|
|
| |
CommandLineInc is deprecated. This allows the scripts to be executed
from MaintenanceRunner.
Change-Id: I180605ea5cb47783670b28a6f01d98f0398c705d
|
|
|
|
|
|
|
|
|
|
| |
The motivation is to make the code less confusing. I hope this is the
case.
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.
Change-Id: Id807affa52bd1151a74c064623b41d950a389560
|
|
|
|
|
|
|
| |
Various variables are left from ealier refactor are now unused
and can be removed to make the code easier to read
Change-Id: Id51770af1f08e85c7e7a02234a2cd2ab5b47ee7a
|
|
|
|
|
|
|
| |
Hard-deprecating immediately as no known users in git outside of mainteance scripts.
Bug: T282894
Change-Id: I072f3d93a9598df719f76f635bfd477737097ad9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Queries that query a value "1" are expected to return either
that "1" (possibly as a string), or false. It's safe to simply
cast this to bool and use it as it is.
Queries for COUNT(*) are expected to return that number,
possibly as a string. It's not possible for such a query to
return false. And even if, casting to 0 is fine.
I found an existing code style where the table name and the
"1" are on the same line as the selectField() method name, and
applied it to all similar queries.
Change-Id: I9453196281871c03ef03f653f43762eb9284342f
|
|
|
|
|
| |
Bug: T282894
Change-Id: I30a600335af735a13a6ad2d3df56a5f17e05bfab
|
|
|
|
|
|
| |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Taint check checks for possible security issues by tracking html
escaping and more by using phan.
This slows done the phan-job a bit and requires more ram
Keep the DoubleEscaped issues out to make reviewer easier
Adds suppression for false positives
Adds taint-annotation to help taint-check
Removes suppression for code phan now understand better by the tracking
of keys in taint-check
Fix some small issues by adding int cast or htmlspecialchars calls
Bug: T216348
Bug: T268920
Change-Id: I849ac4f120fd15b483e8939d4db45c98dc351259
|
|
|
|
|
|
|
|
| |
all places detected as SecurityCheck-XSS by
mediawiki/phan-taint-check-plugin 3.1.0
Bug: T216348
Change-Id: Ib4c8295ad95c2c605fd2f0791e73322f747a00af
|
|
|
|
|
|
|
| |
… and fix the name to match the class.
Bug: T184782
Change-Id: Id3d0d0a6b3f2da6316d18eb57804c5a2b697108b
|
|
|
|
|
|
| |
Useful for logging
Change-Id: I79fe037abcd74f56c935abc118d706bef0198124
|
|
|
|
| |
Change-Id: I337147d61e2ec686a8672d0340dff4b6783f78cd
|
|
|
|
|
|
|
|
| |
NOTE: This was manually tested to ensure it does not
break updates, see T242764.
Bug: T198557
Change-Id: I1d9f5465018bae10124514bc38169e23e0e613e6
|
|
|
|
|
|
| |
Column names or other sql fragments are strings, not integer
Change-Id: I7950b6e7ce4fa3b97c8b8ed55c8d7d0119eaac7e
|
|
|
|
| |
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
|
|
|
|
| |
Change-Id: I44c82fbe65e1d002803ce065df6563f06dd39cd4
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following function are set to public in the parent class and cannot
have another visibility in subclasses
Maintenance::__construct
Maintenance::execute
Maintenance::getDbType
Maintenance::validateParamsAndArgs
Maintenance::setDB
Change-Id: I0cd6514642d479aca20f1221bf673b0713c21631
|
|
|
|
| |
Change-Id: I8944a052f51a1941ad3b76a40fc9c46d1363c426
|
|
|
|
|
|
|
|
| |
Field rev_text_id is being retired as part of MCR Schema Migration.
Remove references to this field from maintenance scripts.
Bug: T198341
Change-Id: I43ab93c44cbd0a2a2479baf848f50348e1e4762b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '
(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)
Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).
Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
|
|
|
|
|
|
|
|
|
|
| |
This should have been done long ago. Now it is being done.
This also changes ar_text_id to NOT NULL, since it should never be null
anymore, and DEFAULT 0 in preparation for MCR stopping writing it.
Bug: T33223
Change-Id: I18f1c740b7537c7dc3cfeba9b241d0a9f31caa34
|
|\ |
|
| |
| |
| |
| |
| |
| | |
@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
|
|
|
|
| |
Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
|
|
|
|
|
|
|
|
|
| |
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.
This includes renaming fixBug20757.php to fixT22757.php for similar consistency.
Change-Id: If81a590d658fbd82c20c54ac47dfdc8856745ca3
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ibd3d617901130378a935402326cd4eefbb382c9e
|
|
|
|
|
|
|
|
|
|
| |
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: I6b58d014a4bfd6600e4e6f80188fdcfce18482ca
|