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
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
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case passing by reference
Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
A title object must be passed to refreshCategory(), which is created in
the above lines, not the string representation received as a parameter.
bug: T172061
Change-Id: Id579a86a26cb438c1866351064c6887dbcea23b0
We already do this in many places, but there were also still plenty
of getOption(, false) calls. Change these to hasOption() for consistency.
Change-Id: I74f91a5bf5a8036496ab1f493e5862a04d27ec0f
Needed for selective updates of pages using a particular feature.
Intended to be run in production, so needs to scale.
Bug: T149723
Change-Id: If20fb1f91de8d4227def5b07d6d52b91161ed3fd
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
It made perfect sense when I introduced this line in June 2005, but now
that we have <ref> etc., we need to use the normal parser configuration.
Change-Id: I5a32e4e38badff85fe6d7d63c3fa158dc6fd5336
these sometimes lead to issues with database deadlock loops
and probably are not needed here.
Bug: T75456
Change-Id: Iad03f6076d8e319ff02cb26259ec9705105e92a7
* Split tidy implementations into a class hierarchy
* Bring all tidy configuration into a single associative array and
deprecate the old configuration.
* Remove $wgAlwaysUseTidy
This is preparatory to replacement of Tidy (T89331). I used the name
"Raggett" for things relating to Dave Raggett's Tidy, since if we use
"tidy" to mean the new abstract system as well as Raggett's tidy, it
gets confusing.
Change-Id: I77af1a16cbbb47fc226d05fb9aad56c58e8910b5
Since 40e300b827, the last deletion batch is no longer handled
separately, so the wfWaitForSlaves() call added in 7492e90cc6
should no longer be necessary.
Also moved the remaining wfWaitForSlaves() call after the DELETE
query, as is the case in most other maintenance scripts.
Change-Id: I2c3c5ce20f81aed28b4b4c7ecf4eaaca7b9791d1
After checking a chunk of one of the links tables, the script failed
to restore the original chunk start when checking the next table.
Follows-up a1e0051559.
Bug: T107632
Change-Id: I21678bc3c83946f2e62afe3fdc69c7e84678ceeb
This also makes the -e and [start] options apply to --dfn-only, making it
possible to restart the script other than at the beginning if necessary.
Bug: T38195
Change-Id: I828b522039290b5700faa89fb8ad4075e50332e7
Instead of exiting the do...while loop only once a query returns zero
rows, exit whenever fewer rows than the batch size are returned. This
could save quite a bit of time when the highest nonexistent page_id
found is a relatively low one.
Follows-up 40e300b827.
Bug: T44180
Change-Id: I14d2d48c2405fcc0bd05a3181ba6293caef5298c
... instead of making an unbuffered query, which is discouraged in the
doc comment for DatabaseBase::bufferResults().
Also used NOT IN for the antijoin instead of LEFT JOIN...IS NULL; when
combined with DISTINCT, the latter causes MySQL to use a temporary
table rather than an appropriate index, according to EXPLAIN. (Using
GROUP BY instead of DISTINCT also avoids this problem. I don't know why.)
Bug: T44180
Change-Id: Idca85fac7dd7879f9fbef2712b6aa83343099e02
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
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
This makes this script actually useful when updating namespaces by
making sure the target registred in the "redirect" is the correct one.
Consider the following example:
- Create a redirect page pointing to a page "Extra:Target"
- Add $wgExtraNamespaces[100] = 'Extra'; in LocalSettings.php
- run refreshLinks.php
Previously the redirect target of that page was not updated and still
pointing to (0, "Extra:Target") which no longer a valid title.
Now it will be updated correctly to point to (100, "Target").
The value of the page_is_redirect field will also be updated to be
sure it has the correct value, which might be wrong when the target
becomes valid or invalid, e.g. by changing $wgInvalidRedirectTargets.
Change-Id: I458ca63550df56ca96b35749daf4e7b866ab9d93
Obviously null === false will never return true,
and what we actually want here is to check whether
we have a content or not.
Change-Id: Id78897e80ba2553c925e10d67c0fce2186aa11fd
On Tim's request, this change moved getParserOutput() and getSecondaryDataUpdates()
from the ContentHandler to the Content interface.
Change-Id: Ia654aa8710a242ba5fe7a4eb528e6a6449035f59
This merges the latest core patch into the Wikidata branch,
implementing suggestions collected on gerrit. Most importantly:
* Methods in the Content class no longer rely on a IContextSource
* createArticle and createEditPage were removed from Contenthandler