Commit graph

10 commits

Author SHA1 Message Date
Umherirrender
ad776c7d5f Use ::class to resolve class names in maintenance scripts
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
2018-01-23 17:40:16 +00:00
Bryan Davis
9e34eeff23 Maintenance: add fatalError() method
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
2017-11-21 21:34:16 -07:00
addshore
b12086b618 Get ConfigFactory & MainConfig from MediaWikiServices
Change-Id: Iafdd7e00747060572463ffb05aae4543f3a06163
2016-11-23 00:12:38 +00:00
This, that and the other
628e3ce69c Fix importation of weird file names in importTextFiles.php
When importing a file whose name contains a #, the script would call
e.g. Title::newFromText( '#foo' ), which succeeds (because titles
are allowed to contain fragments) but causes problems when trying
to create the revision.

Also avoid fatals on actual invalid titles.

Bug: T142675
Change-Id: I6b4c8fd8dd09db14c0704c74137e112b292c964a
2016-09-21 12:32:22 +08:00
This, that and the other
b84905bb85 Make importTextFiles.php work with wildcards on the Windows shell
The Windows command line doesn't automatically expand wildcards, unlike
Unix shells. So the script tried to run function calls like
file_get_contents( '*.txt' ), which do not work. This patch uses glob()
to simulate the behaviour of the Unix shell.

This was reported at https://www.mediawiki.org/wiki/Topic:T7hf8bz8u2p4ryol

Change-Id: I002344a19cb08cc8ac8ee75214339b2379b04dbe
2016-07-16 12:29:11 +00:00
Bartosz Dziewoński
c6defb358d Fix typo in 'log-action-filter-suppress-block'
And some other instances of 'ppp'.

Bug: T137960
Change-Id: I3926873a79f297e0369d3c6c3300c29d2196d68f
2016-06-16 15:10:30 +02:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
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
2016-02-17 01:33:00 -08:00
Max Semenik
59db24e90b Use addDescription() instead of accessing mDescription directly
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
2016-01-30 01:28:32 -08:00
Andrew H
0202c55e3a Add parameters to importTextFiles.php
- Add --bot to mark edits as bot edits when --rc is specified
- Add --overwrite to overwrite existing pages with changes.
This respects the --use-timestamp option by only overwriting if
the file is newer than the latest revision on the destination page.
- Add --prefix for specifying a prefix
- Add --rc to add an edit entry to Special:RecentChanges

This is a GCI task.

Change-Id: I5acf829409853e2b311ae6c1c75a009fef91ceeb
2016-01-12 02:25:13 +00:00
Andrew H
c812fa3cb3 Add maintenance script importTextFiles.php
importTextFiles.php can be used to import pages from text files
containing wikitext.

Also, added $userObj to WikiRevision so that it can accept a User
object instead of just a username.

This is a GCI task.

Change-Id: I20eaf2005bdd3d041f55d8c0b108f001c064d638
2016-01-08 00:57:11 +00:00