aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/renameDbPrefix.php
Commit message (Collapse)AuthorAgeFilesLines
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-2/+2
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* Use ::class to resolve class names in maintenance scriptsUmherirrender2018-01-231-1/+1
| | | | | | | This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
* Maintenance: add fatalError() methodBryan Davis2017-11-211-1/+1
| | | | | | | | 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
* Update wfGetDB calls in Maintenance scripts to use getDB()Reedy2016-01-021-1/+1
| | | | Change-Id: I9ad6745d84506b736dae94747256caac89715899
* phpcs: More require/include is not a functionTimo Tijhof2013-05-211-1/+1
| | | | | | | | | | | | | 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
* phpcs: Fix WhiteSpace.LanguageConstructSpacing warningsTimo Tijhof2013-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Use __DIR__ instead of dirname( __FILE__ )jeroendedauw2012-08-271-1/+1
| | | | | | 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
* Improve documentation of maintenance scripts.Alexandre Emsenhuber2012-08-111-0/+7
| | | | Change-Id: I29dd0d4d18ea3d1b9795fac2f0b74b04ef2d955a
* Remove usage of $dbw->escapeLike in RenameDbPrefix (per bug 270042)Sam Reed2011-01-301-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/81215
* Fix concern raised by Brion in r74108 (but has really existed since the ↵Chad Horohoe2011-01-131-1/+1
| | | | | | | | | | | maintenance rewrite). Right now, including a maintenance script causes it to execute. This is bad when you want to reuse the particular class but not have it start executing all by itself. Until now, we relied on setting MW_NO_SETUP which was a) hacky, b) irreversable, and c) likely to be forgotten if you didn't use one of the wrappers like runChild(). Instead, move the freaky magic to doMaintenance and have *it* check if it's in a specific call stack that indicates this is being run from the file scope and should be executed. Rename DO_MAINTENANCE to RUN_MAINTENANCE_IF_MAIN so it's nice and clear what magic happens behind the require_once(). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/80205
* Whitespace fixup under tha maint directory.Mark A. Hershberger2010-12-041-4/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77711
* Big attack on unused variables...Sam Reed2010-10-141-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/74797
* Add a few globals.Platonides2010-07-251-1/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/69892
* Stylize maintenance folder..Sam Reed2010-05-221-11/+11
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66751
* Fix child class visibilityChad Horohoe2010-03-101-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/63549
* Make DB_STD the normal DB access level. Some scripts need DB_ADMIN, so ↵Chad Horohoe2009-08-091-1/+5
| | | | | | | return that in them. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54657
* Revert r54244 which was stupid and fix this properly. Require ↵Chad Horohoe2009-08-031-1/+1
| | | | | | | commandLine.inc/Maintenance.php using the full path every time. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54312
* Don't put \n on the end of every error() call, just do it in error() itself. ↵Chad Horohoe2009-08-021-1/+1
| | | | | | | Still have to use on output(), because people like "Something...done" stuff. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54240
* Merge maintenance-work branch (now with less errors!):Chad Horohoe2009-08-021-57/+71
| | | | | | | | | | | * Docs have been updated to indicate the standard on how to write maintenance scripts (MW.org docs will follow) Have ported vast majority of maintenance scripts to new format. Remaining ones (mostly FiveUpgrade-related) are a bit more tricky. commandLine.inc is untouched for now. Many have gotten code-style updates as well. Deleted .inc files were only used by their .php counterparts, and have been merged into single files. * (bug 11867) Lock error on redirect table when running orphans.php * (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params * (bug 18566) Maintenance script to un/protect pages * initStats overhaul, now uses class SiteStatsInit. Also fixes bug 18930 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54225
* Revert r52336 "Merge maintenance-work branch:"Brion Vibber2009-06-241-53/+56
| | | | | | | | Seems to have broken a bunch of stuff. Don't commit giant non-critical changes that break Setup.php and all maint scripts. Thanks! Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52340
* Merge maintenance-work branch:Chad Horohoe2009-06-241-56/+53
| | | | | | | | | | | | * (bug 16322) Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php * (bug 18768) Remove AdminSettings.php from MediaWiki core * (bug 19157) createAndPromote error on bad password * (bug 14201) Create AdminSettings.php during wiki installation, in the same way as LocalSettings.php * Introduce new Maintenance class framework and port a good number of scripts over; the ones that are left are a little more complicated. Read the docs. * Not deleting "unused" files yet, don't want to break everything at once :) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52336
* renameDbPrefix.php tweaks: corrected script name in help message (this is ↵Jack Phoenix2009-03-291-11/+10
| | | | | | | not updateSpecialPages.php ;) + added spacing Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/48998
* Add a little script I use to change db prefixAaron Schulz2008-12-251-0/+68
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/45014