| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
A–F. Still need to do F–Z.
Bug: T353458
Change-Id: Ieb4bad0658b9cddc9403c6a55ef3bd1245aa08ae
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These help with the basic pattern of running loop of transaction
rounds, each of which should handle deferred updates and possible
replication wait barriers.
Add Maintenance::newBatchIterator() helper method for easily wrapping
an iterator with an batching iterator. This is useful for grouping the
writes in transaction rounds and avoiding the slowness of excessive
waitForReplication() calls.
Update some maintenance scripts to use these methods, including:
* makeTestEdits.php
* importSiteScripts.php
* cleanupSpam.php
* protect.php
* undelete.php
* rollbackEdits.php
* namespaceDupes.php
* uppercaseTitleForUnicodeTransition.php
Deprecate the single-connection transaction wrappers.
Bug: T373057
Change-Id: I42256f9e775bad102e6e5d47c512e0b5cc60d070
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ia13c319cef766dd345b828c5f0bc8e40ede06863
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: T166010
Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Use DeletePage instead.
Change-Id: Icf064d6f8ce609d1119b45377af037ed03e464a4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Bug: T328220
Change-Id: Ib619ead0f397188d828e6e5dfc80ed1fa7175c7d
|
| |
| |
| |
| |
| |
| | |
Use inline suppression for known exception from eval/passthru/query call
Change-Id: Ie85ea5698a615adf07e4e391bf06d102149effd5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Unnecessary regex modifier. I agree with this inspection which flags
/s modifiers on regexes that don't use a dot.
* Property declared dynamically.
* Unused local variable. But it's acceptable for an unused local
variable to take the return value of a method under test, when it is
being tested for its side-effects. And it's acceptable for an unused
local variable to document unused list expansion elements, or the
nature of array keys in a foreach.
Change-Id: I067b5b45dd1138c00e7269b66d3d1385f202fe7f
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's one-class namespace and I know it's not great but:
- I hope to add more classes with the redesign of externallinks table
- It's not named very well either, it's a collection of URL-related
functionalities
- Making it clear LinkFilter is about external links, not internal or
interwiki or templatelinks etc.
Bug: T321882
Change-Id: I0dd530237f45e4fec786178ec03ee941c6bcd982
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
| |
| |
| |
| |
| | |
Bug: T166010
Change-Id: Idcf0e9dc6e0841e4f132207bce0f96774dad898c
|
| |
| |
| |
| |
| |
| |
| | |
Part 1 of migrating files in `maintenance/` from IDatabase::select()
to SelectQueryBuilder.
Change-Id: Idfe83b900de3fbc6a251a5a78d8af1a4cd88970f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
|
|/
|
|
|
| |
Bug: T286694
Change-Id: I6e34e7cccdeb30022863122d39824c742f6fb236
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch deprecation warnings will be emitted
if $wgUser is accessed or written into. The only pattern
of usage still allowed is
$oldUser = $wgUser;
$wgUser = $newUser;
// Do something
$wgUser = $oldUser;
Once there is no deprecation warnings, we know that nothing
legitimately depends on $wgUser being set, so we can safely
remove the code that's still allowed as well.
Bug: T267861
Change-Id: Ia1c42b3a32acd0e2bb9b0e93f1dc3c82640dcb22
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) The following methods were hard deprecated:
- User::addAutopromoteOnceGroups
- User::getEffectiveGroups
- User::getAutomaticGroups
- User::getFormerGroups
2) User ::getGroups, ::getGroupMemberships, ::addGroup,
::removeGroup were replaced in the production code,
but they were not hard deprecated because of conflict
with UserRightsProxy class.
Bug: T275148
Change-Id: Ia69598316f5dc5dd9511f6112b5b13e1aa07575a
|
|
|
|
|
|
|
|
| |
Results in passing a user where previously the fallback
to $wgUser was being used, mostly in tests.
Bug: T255507
Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
|
|
|
|
| |
Change-Id: Ib86399445a77d3005f23ae87d87f3cf742b13b1f
|
|
|
|
|
|
| |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|
|
|
|
|
|
|
| |
Avoid fallback to $wgUser (see T255507 for work on deprecating
that fallback)
Bug: T243708
Change-Id: I188fec7b31c327815d2f92861ead8c79d06a3b5b
|
|
|
|
| |
Change-Id: I5b2d4313f986484368da9b63c9a19892c2328dae
|
|
|
|
|
| |
Bug: T243708
Change-Id: I6a607dd1acb3b29c053ce933faf91e75cf27e068
|
|
|
|
|
|
|
|
| |
Only use `wgUser` when setting or retrieving the global, not for
the user object that it is set to
Bug: T243708
Change-Id: Ie962192f1dbc066ba71b9abb48dc9d522d472c78
|
|
|
|
|
|
|
| |
Also fixed a use of ::newFromId in benchmarkParse and Parser
Bug: T249183
Change-Id: I3219a72f1085836205dc497e2236b52db24d7c16
|
|
|
|
|
| |
Bug: T248000
Change-Id: I48bcf68e90209c5cfc2b7fedbf70fdffc374ec64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added:
- ContentHandlerFactory
Tests:
- PHPUnit
Changed
- Calls of changed and deprecated
- DI for some service/api
Deprecated:
- ContentHandler::* then similar to ContentHandlerFactory
- ContentHandler::getForTitle
- ContentHandler::$handlers
Bug: T235165
Change-Id: I59246938c7ad7b3e70e46c9e698708ef9bc672c6
|
|
|
|
|
|
| |
It is enabled for b/c in extensions, but not needed in core
Change-Id: I51dca12be9c77049f77563d9bf0edd07928c2300
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ide4518292bd9392d09f701b2c301673687d19f3b
|
|/
|
|
|
|
|
| |
Update deprecated Revision::* constants to use RevisionRecord::*
equivalents.
Change-Id: Icae1ebb088e4efadbc7c2806127a2073d337fa05
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace
@var $foo type
by
@var type $foo
Change-Id: Iec8b90ffea4028a1005daef422b7c4ec38c2715f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Benefit of keeping the parameter optional:
- In maintenance scripts that really only have one parameter, it's a
little more convenient to be able to ask for *the* parameter via an
empty getArg().
Disadvantages:
- It's unclear what getArg() means when there is no indication *which*
argument the code asks for. This might as well return the last
argument, or an array of all arguments.
- In scripts with two or more arguments, it's confusing to see
getArg( 1 ) next to an empty getArg().
- The methods are more complex and a bit more complicated to use with
the extra feature of this parameter being optional. Users need to
look up what the default is to be able to use it safely.
Change-Id: I22a43bfdfc0f0c9ffdb468c13aba73b888d1f15e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a method to LinkFilter to build the query conditions necessary
to properly use it, and adjusts code to use it.
This also takes the opportunity to clean up the calculation of el_index:
IPs are handled more sensibly and IDNs are canonicalized.
Also weird edge cases for invalid hosts like "http://.example.com" and
corresponding searches like "http://*..example.com" are now handled more
regularly instead of being treated as if the extra dot were omitted,
while explicit specification of the DNS root like "http://example.com./"
is canonicalized to the usual implicit specification.
Note that this patch will break link searches for links where the host
is an IP or IDN until refreshExternallinksIndex.php is run.
Bug: T59176
Bug: T130482
Change-Id: I84d224ef23de22dfe179009ec3a11fd0e4b5f56d
|
|
|
|
|
| |
Bug: T186795
Change-Id: I9e350306f85d3d3ca4daba626e49a0792605acc7
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Spam cleanup activities, mostly when it comes from automated processes
(the so called 'spambots') can involve a fair ammount of edits and log
actions to accomplish.
As such, to avoid flooding Special:RecentChanges, this script will now
set a bot flag on the script run so its edits and actions won't show
up in that special page.
To prepare this patch I had the help of Bartosz Dziewoński which I'd
also like to thank and I'll credit as co-author as well.
Bug: T176206
Co-Authored-By: Bartosz Dziewoński <matma.rex@gmail.com>
Change-Id: Ifde08056a7481b877b4b82699cc0a5ea3f962dd9
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add transaction methods to complement getDB().
This makes it easy to grep for direct begin()/commit()
calls to IDatabase by having script use their own
wrapper. Maintenance scripts are one of the few places
that can (and need to) use begin/commit instead of the
start/end atomic methods.
Eventually, there should be almost no direct callers
and those methods can be made stricter about throwing
errors on nested calls.
Change-Id: Ibbfc7a77c0d2a55f7fc2261087f6c3a19061e0aa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AuthManager is coming, which will make it easier to add alternative
methods of authentication. But in order to do that, we need to finally
get around to ripping the password-related bits out of the User class.
The password expiration handling isn't used anywhere in core or
extensions in Gerrit beyond testing for expired passwords on login and
resetting the expiry date on password change. Those bits have been
inlined and the functions removed; AuthManager will allow each
"authentication provider" to handle its own password expiration.
The methods for fetching passwords, including the fact that mPassword
and other fields are public, has also been removed. This is already
broken in combination with basically any extension that messes with
authentication, and the major use outside of that was in creating
system users like MassMessage's "MediaWiki message delivery" user.
Password setting methods are silently deprecated, since most of the
replacements won't be available until AuthManager. But uses in unit
testing can be replaced with TestUser::setPasswordForUser() immediately.
User::randomPassword() and User::getPasswordFactory() don't really
belong in User either. For the former a new PasswordFactory method has
been created, while the latter should just be replaced by the two lines
to create a PasswordFactory via its constructor.
Bug: T47716
Change-Id: I2c736ad72d946fa9b859e6cd335fa58aececc0d5
|
|
|
|
| |
Change-Id: I2b791d3bff0de464b6bdaaeae0622c065389c31c
|
|
|
|
| |
Change-Id: Ibb03a775055c687a4c5bc6864172e043d3a7e3d8
|