Commit graph

23 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
Max Semenik
dac20d0ffa Introduce Maintenance::getBatchSize()
Just to isolate the internals. Fix most of usages in the core.

Change-Id: I8b3e9ca1f42b7c49ee57f17b88ca2fc7b404f342
2017-11-05 13:26:12 -08: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
Reedy
44cebea941 Update wfGetDB calls in Maintenance scripts to use getDB()
Change-Id: I9ad6745d84506b736dae94747256caac89715899
2016-01-02 16:58:23 +00:00
Aaron Schulz
4452e759d4 Avoid query error with odd parameter combination
Change-Id: I1fc4495d665ff2c1e0cbf274ee2081a06c4e603b
2014-04-24 15:48:28 -07:00
Siebrand Mazeland
5a77286a1e Update formatting in maintenance/ (3/4)
Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
2014-04-23 20:09:13 +02:00
Siebrand Mazeland
0619388d87 Pass phpcs-strict on maintenance/ (3/8)
Change-Id: I453ecc474139c7a5f1d0d20306ad28c2cee80ec9
2014-04-22 21:25:52 +00:00
Aaron Schulz
d35063273c Added --multiversiononly option to image SHA1 population script
* A portion of files have bad SHA1 values due to re-upload bugs.
  This adds an option to just force updates for files with re-uploads.

Change-Id: I24bd9a8f19bafc3e794cf32c78ce7f720f302627
2014-04-22 11:44:47 -07:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
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
2013-05-21 23:26:28 +02:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
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
2013-05-09 05:56:26 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
Alexandre Emsenhuber
e9d31f5949 Improve documentation of maintenance scripts.
Change-Id: I52ebe4d741109aef19cd8fa252243e2b6440565f
2012-08-02 21:34:23 +02:00
Aaron Schulz
b22063a6f9 When file sha1 populator fixes wrong values, make it fix the other metadata.
Change-Id: Ie03af8b97dc76d2ab4990108b9189693fcf81697
2012-05-23 12:04:29 -07:00
Aaron Schulz
7a1c2de0bb In populateImageSha1.php:
* Added 'force' parameter to run the script on rows with sha1 existing values (and where the file exists)
* Do the all the old versions of files after doing their current versions
* Broke long line and made a few minor cleanups
2012-02-29 22:45:17 +00:00
Tim Starling
4055b64afa Fix comment from r54410, add rationale for using MySQL command line pipe 2012-02-29 22:30:23 +00:00
Aaron Schulz
4b216bfed4 FU r106752: updated populateImageSha1.php script as needed 2012-01-12 20:50:14 +00:00
Aaron Schulz
9b6aa05145 Fixed totally broken --file parameter (running the sha1 for one file) 2011-11-16 20:38:24 +00:00
Sam Reed
44696806fb Remove some unused getting of non existent arguments
Documentation
2011-10-18 17:32:20 +00:00
Chad Horohoe
41f7e84068 Tweaks to LoggedUpdateMaintenance:
* Reduce some duplication
* Prefix skipped steps with "..." per updater convention
* Make PopulateLogUsertext, PopulateLogSearch and PopulateParentId use LoggedUpdateMaintenance -- now they will properly log when there was "Nothing to do" and we can skip the clutter on future update runs
* Docs, etc.
2011-09-08 15:52:00 +00:00
Aaron Schulz
7cb4d69d9d Changed PopulateImageSha1 to use LoggedUpdateMaintenance and added it to $postDatabaseUpdateMaintenance 2011-08-12 20:37:35 +00:00
Aaron Schulz
4e507929fb Renamed image sha1 population script to be more concise 2011-08-11 22:00:42 +00:00
Renamed from maintenance/populateSha1.php (Browse further)