| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same as Ia294bf4 did for 1-line comments. This patch removes slightly
more complex 2-line PHPDoc comments that don't add any new information
to the code, but literally repeat what the code already says.
They say "don't document the code, code the documentation", and we
are doing this more and more. We just tend to forget to remove the
obsolete comments.
Note I'm also removing a line of text in a few cases when it's very
short and literally says the same as the method name. Again, such
comments add zero new information.
Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I assume these are all either auto-generated by an IDE or the
language-level type declarations have been added later. In any case
the comments don't add any new information to what the code already
says. This is just extra clutter that makes the code harder to read,
I would argue.
There are many, many more comments like this. In this patch I
intentionally focus on the most trivial 1-line comments.
Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
|
|
|
|
|
|
|
| |
A–F. Still need to do F–Z.
Bug: T353458
Change-Id: Ieb4bad0658b9cddc9403c6a55ef3bd1245aa08ae
|
|
|
|
|
|
|
| |
This does not include use of MediaWiki\Maintenance\Maintenance,
assuming the maintenance scripts going into the same namespace
Change-Id: I488f95b537ce86eb5e463be7bce3653610dd13d9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Maintenance::finalSetup should have access to a SettingsBuilder so it
can manipulates config settings without resorting to global variables.
MaintenanceRunner will always provide a SettingsBuilder when calling
this method, so implementations should be able to rely on always getting
one.
The $settings parameter was introduced as optional in order to maintain
backwards compatibility with implementations that did not declare the
parameter. But these should all have been fixed since.
Depends-On: I8a3699b13bfb4dc15f3bed562731ed9d525651cc
Change-Id: I334a103e02fd905faafc43c7c5b95996bc91fd18
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass Authority to WikiImporter constructor, instead of looking at the
user from RequestContext::getMain(), and skipping this check if
$wgCommandLineMode is true.
Maintenance scripts now use UltimateAuthority, to match the original
intent of skipping permission checks, see 2ed55f42 / r96311.
The Authority parameter to WikiImporterFactory::getWikiImporter() is
optional for now for backwards-compatibility. It should become
required later after deprecation.
Change-Id: Iea1d03dcdcbda2f9a9adbff1b0d319efd22c4d86
|
|
|
|
|
|
| |
Most noisily, this enables MediaWiki.Arrays.OneSpaceInlineArray.
Change-Id: I8ab11399c67ce7e3ab1b6249b591452774393428
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
It has been deprecated since 1.31 and it is unused.
Change-Id: I695e7f5d253076829ba9b58bccd7bfc77624c393
|
|
|
|
|
|
| |
Found using IntelliJ's "Typo" code inspection.
Change-Id: I746220ebe6e1e39f6cb503390ec9053e6518cf16
|
|
|
|
|
|
|
| |
This should be the last of the usages in core, although I'm sure a few
are hiding somehow.
Change-Id: I7bf0b24bf23d3efb4c56a891830bbfe67945e899
|
|
|
|
| |
Change-Id: I80ba53bdeb730a115ab3eec4849a38a13a896cdb
|
|
|
|
|
|
|
|
|
|
| |
Sometimes, we need to force an exact value and bypass the default
behavior of merging config variables.
This also renames setConfigValue to putConfigValue, to avoid confusion
about the behavior of that method.
Change-Id: I82c606632b94f974e655a44a0b63394de7a0804b
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 4f7a4a2477ceeac68011d8f550a30d005c78dfdf.
Reason for revert: This change is good, just need some preparation in extensions.
Depends-On: I24221be2cedfa132fc94d39d72e4a133cc3cdb12
Depends-On: I5e6119b650e581c6aa5a1132aa071b49cff8b8ca
Change-Id: I5a5a9000751fa3914c9d432eb49475091b3bdb80
|
|
|
|
|
|
|
|
| |
This reverts commit a652f306a542c0efdfa0bef33cd68c8f6587e0bc.
Reason for revert: need to prepare extensions first
Change-Id: Iccedf38a8dc964db7c49fd51c971912655122081
|
|
|
|
|
|
|
|
|
|
|
| |
Maintenance scripts often need to manipulate configuration settings.
This introduces a way to do this cleanly via SettingsBuilder,
removing the need to rely on global variables.
Bug: T294739
Bug: T294742
Bug: T300128
Change-Id: Ibf443fd564bbbf388cce8ab4dabba55ebca0dfa4
|
|
|
|
|
|
|
|
| |
This patch injects services into WikiImporter. It also adds
a WikiImporterFactory service for creating WikiImporter
instances.
Change-Id: I2966297e5728fca1ae8280361f1008cef6c6041b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This script takes an offline XML dump file, containing wikitext pages, and
feeds them through the Preprocessor without actually importing any content
into the wiki as revisions or pages.
The documented purpose of the script is to "get statistics" or "fill the cache".
- I was unable to find any stats being emitted.
- I did find that the called Preprocessor method indirectly writes to
"preprocess-hash" cache keys, which have a TTL of 24 hours (e.g. Memcached).
I could not think of a use case for populating Memcached with parse results
for pages that do not exist on a given wiki.
It was created in 2011 with r80466 (ad8b42449d) without a use case described
or referenced. I suspect it may've been used to help inform the development of
a major change to the Preprocessor around that time, but it doesn't appear to
be needed for that any more, and does not appear to have been aimed at general
usage by site operators. If and when something it is needed for new
developments, it can be easily brought back rather than maintained as-is.
Change-Id: I139aa4ee8c2f92a40e94824c709556dda7ec74ff
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
|
|/
|
|
| |
Change-Id: I4646ce4890a89df34d3f8b6d055f9cedc9bda9fc
|
|
|
|
|
|
|
|
| |
with the reverse order, the content model of the rvision is null,
and it can't be gotten from the title, so dumpIterator dies when
the file option is used instead of a dump.
Change-Id: Ia67097565953f00068399da3225b939fb105ba4a
|
|
|
|
|
|
|
|
|
| |
Do not use bit operator on bool as it does not work the same way.
|= is not a short form of bool or (||) and assignment (=).
It is the short form of bitwise or (|) and assignment (=)
Change-Id: I64988cd3aeb8f4cbc53b0b866f1ac96f12976cca
|
|
|
|
| |
Change-Id: I95d1195f09a806910559a0c5106d472addd3dec4
|
|
|
|
|
|
|
|
| |
The only caller passes a WikiRevision, which does not extend the
Revision class; the parameter is a WikiRevision, not a Revision
Bug: T246284
Change-Id: Iaf25b692e6093eab6e12439864bae97c96a3b9db
|
|
|
|
| |
Change-Id: I44c82fbe65e1d002803ce065df6563f06dd39cd4
|
|
|
|
|
|
|
| |
All uses were checked with codesearch, and the visibility was chosen as
strict as possible.
Change-Id: I56666299cc04ccc418e05949422876583982eb3c
|
|
|
|
|
|
|
|
|
| |
Added spaces around .
Removed empty return statement which are not required
Removed return after phpunit markTestIncomplete,
which is throwing to exit the test, no need for a return
Change-Id: I2c80b965ee52ba09949e70ea9e7adfc58a1d89ce
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
|
|
|
|
|
|
|
|
| |
Make the default notice implementation of notice() function to
send the notice to wfDebug() instead of simply echo to prevent XSS
Bug: T177997
Change-Id: I9ffb597e0642afc1603cdd15e2d09c6f2584b448
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Relatedly, move lockTables()/unlockTables() to IMaintainableDatabase
Change-Id: Ib53e9fa948deb2f9a70f0ce16c002613d0060bf9
|
|
|
|
| |
Change-Id: If37a7909056bf2c31a8228cbc84f0fbbf5f1c517
|
|
|
|
|
|
|
|
|
|
| |
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: I3bd8e7c4d2dca465957a353cb7dc2a906699ff6a
|
|
|
|
| |
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
|
|
|
|
| |
Change-Id: I4d1a8c443cfa360c5d388364c580d48fa7124099
|
|
|
|
| |
Change-Id: I2b791d3bff0de464b6bdaaeae0622c065389c31c
|
|
|
|
| |
Change-Id: Icefd7660072aedb963fe3082ec40fb8ffcfd6286
|
|
|
|
|
|
|
|
|
| |
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I727deec35a712de0f0c676cc87dfa661f1ee965b
|
|
|
|
|
|
|
| |
These are only documentation fixes
http://www.mediawiki.org --> https://www.mediawiki.org
Change-Id: I62ad42be1a3aac410cc53e98ce79389ceddd8988
|
|
|
|
|
|
|
|
| |
iPart of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core, and are updated in
this change.
Change-Id: I432dc249d22053728013ae7d0d56c3c398021c5e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Idd4299d17f1fcf98ab1d635484cb4e880f35ee24
|
|
|
|
|
|
|
| |
Added spaces before if, foreach
Added some braces for one line statements
Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
|
|
|
|
|
|
|
|
|
| |
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
|