aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/rebuildall.php
Commit message (Collapse)AuthorAgeFilesLines
* add `use MediaWiki\Maintenance\Maintenance` to some maintenance classesNovem Linguae2024-12-051-0/+2
| | | | | | | | | this patch changes P–Z. still need to do subfolders in one file, I also deleted an errant line break that was disconnecting the class docblock from the class. Change-Id: I3b60c2a5817f12c47490e78e36cc18bfeeb98af9
* Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* maintenance: Introduce getReplicaDB() and getPrimaryDB()Amir Sarabadani2024-01-181-1/+1
| | | | | | | | | | | | And start using them instead of wfGetDB(), LB/LBF connection methods or worse, $this->getDB(). $this->getDB() reuses the database object regardless of whether you're calling a replica or primary, leading to returning a replica on a primary and other way around. Bug: T330641 Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
* Use ::class to resolve class names in maintenance scriptsUmherirrender2018-01-231-4/+4
| | | | | | | This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
* Rename DB_SLAVE constant to DB_REPLICAAaron Schulz2016-09-051-1/+1
| | | | | | | | | 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
* Use addDescription() instead of accessing mDescription directlyMax Semenik2016-01-301-1/+1
| | | | Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
* Update wfGetDB calls in Maintenance scripts to use getDB()Reedy2016-01-021-1/+1
| | | | Change-Id: I9ad6745d84506b736dae94747256caac89715899
* Pass phpcs-strict on maintenance/ (3/8)Siebrand Mazeland2014-04-221-2/+4
| | | | Change-Id: I453ecc474139c7a5f1d0d20306ad28c2cee80ec9
* (bug 50025) rebuildall.php script needs database admin rightsAlexandre Emsenhuber2013-06-251-0/+4
| | | | | | | It calls rebuildtextindex.php, which use the ALTER command. Bug: 50025 Change-Id: Ifbd1d1d1d9c0d6f53ce13b92d94824beee67963f
* 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-091-0/+6
| | | | Change-Id: I21b4fb873e88026108754eb7206e62c82648df0e
* 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
* Get rid of a bunch of $wgDBtypes in maintenance/Chad Horohoe2010-12-101-2/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78183
* Whitespace fixup under tha maint directory.Mark A. Hershberger2010-12-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77711
* Stylize maintenance folder..Sam Reed2010-05-221-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66751
* Now that rebuildtextindex.php is not MySQL-only, rebuildall.php should also ↵Max Semenik2009-11-071-1/+1
| | | | | | | take it into account Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/58730
* * Rewrote commandLine.inc to be a simple wrapper around Maintenance.phpTim Starling2009-09-041-3/+3
| | | | | | | | | | | * Don't show help if the first argument is "help", only show it if there is a "--help" option. That makes more sense for the scripts that accept filenames as parameters and is the backwards-compatible behaviour. * Renamed spawnChild() to runChild(), spawn implies creating a new process to run simultaneously with the old one * Removed error_reporting override, that's a matter for local policy * s/private/protected Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55810
* 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
* Merge maintenance-work branch (now with less errors!):Chad Horohoe2009-08-021-32/+46
| | | | | | | | | | | * 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
* (bug 17948) Maintenance scripts now exit(0) or exit(1) as appropriateChad Horohoe2009-04-061-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/49247
* WARNING: HUGE COMMITAlexandre Emsenhuber2008-05-201-1/+3
| | | | | | | | | | | | | | | | | | Doxygen documentation update: * Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group. * Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file. * Removed some empty comments * Removed some ?> Added following groups: * ExternalStorage * JobQueue * MaintenanceLanguage One more thing: there are still a lot of warnings when generating the doc. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35098
* Fix for bug 13251, allows some rebuld scripts to work with Postgres.Greg Sabino Mullane2008-03-141-6/+9
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/31958
* Cleanup from r28400: avoid duplication between manually calling multiple ↵Brion Vibber2007-12-201-3/+1
| | | | | | | passes of recent changes rebuild by giving them a nice wrapper function. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/28689
* There is a pass three now (may be a four in the future)...don't really like ↵Aaron Schulz2007-12-111-0/+1
| | | | | | | this duplication here Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/28400
* Remove ?>'s from files. They're pointless, and just asking for people to ↵Aryeh Gregor2007-06-291-1/+1
| | | | | | | mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/23531
* Use Doxygen @addtogroup instead of phpdoc @package && @subpackageAntoine Musso2007-01-201-2/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/19502
* Revert to r15092; massive breakage, unable to connect to MySQL at allBrion Vibber2006-06-271-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/15094
* Add concept of a distinct port separate from a server.Greg Sabino Mullane2006-06-271-1/+1
| | | | | | | Add some functions to DatabasePostgres.php. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/15093
* typoBrion Vibber2005-09-171-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/11050
* Phpdoc comments and place holder. Part of the subpackage "maintenance", ↵Antoine Musso2004-09-031-4/+9
| | | | | | | archives in subpackage "maintenanceArchive" Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/5060
* Fix rebuildall on case-sensitive unix filesystems.Brion Vibber2004-08-141-1/+1
| | | | | | | | Bug 52: rebuildall.php maintenance script fails http://bugzilla.wikipedia.org/show_bug.cgi?id=52 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/4764
* Fix some of the rebuild scriptsBrion Vibber2004-08-111-10/+12
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/4669
* * Moved content from liveCmdLine.inc into commandLine.inc, obsoleting the ↵Tim Starling2004-06-151-21/+11
| | | | | | | | | | | | former. * Put some option handling code in commandLine.inc which is untested and unused (for the moment). * Converted all existing command line scripts to use the standard header and argument array. * Did a quick test of compressOld.php, rebuildall.php and rebuildMessages.php to check for breakage. * rebuildall.php was broken due to the unmaintained rebuildlinks.php, so I converted it to use refreshLinks instead. Required splitting into refreshLinks.inc and refreshLinks.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/4083
* include_once -> require_onceTim Starling2004-05-071-6/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/3502
* Fix for compatibility with short_open_tag = OffBrion Vibber2004-02-181-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/2485
* Changed function call to use new function rebuildLinkTables(), replacing the ↵Mr. E232003-11-281-2/+1
| | | | | | | old rebuildLinkTablesPass1() and rebuildLinkTablesPass2() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/2096
* Maintenance script fixesBrion Vibber2003-11-171-1/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/1983
* Completed several maintenance scripts for index rebuilding.Lee Daniel Crocker2003-05-021-0/+39
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/1307