Commit graph

29 commits

Author SHA1 Message Date
Chad Horohoe
26505b170a Fix concern raised by Brion in r74108 (but has really existed since the 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().
2011-01-13 22:58:55 +00:00
Mark A. Hershberger
617a5b1e15 Whitespace fixup under tha maint directory. 2010-12-04 03:20:14 +00:00
Sam Reed
659778619c Stylize maintenance folder.. 2010-05-22 16:50:39 +00:00
Chad Horohoe
291efd30f2 Followup r60051, with the rest of the callers and removing a useless subclassing from DatabaseMssql 2009-12-14 23:18:03 +00:00
Alexandre Emsenhuber
44729064cd * batch change for "while ( $row = $db->fetchObject( $res ) )" and similar to "foreach ( $res as $row )"
* identation fix in nukeNS.php
2009-08-17 21:15:31 +00:00
Chad Horohoe
567f244e36 Revert r54244 which was stupid and fix this properly. Require commandLine.inc/Maintenance.php using the full path every time. 2009-08-03 21:56:41 +00:00
Chad Horohoe
30468dbcf7 Don't put \n on the end of every error() call, just do it in error() itself. Still have to use on output(), because people like "Something...done" stuff. 2009-08-02 21:55:10 +00:00
Chad Horohoe
a1c51e18af Merge maintenance-work branch (now with less errors!):
* 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
2009-08-02 19:35:17 +00:00
Brion Vibber
1c9773bd01 Revert r52336 "Merge maintenance-work branch:"
Seems to have broken a bunch of stuff. Don't commit giant non-critical changes that break Setup.php and all maint scripts. Thanks!
2009-06-24 02:49:24 +00:00
Chad Horohoe
59b60fc311 Merge maintenance-work branch:
* (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 :)
2009-06-24 02:02:37 +00:00
Chad Horohoe
221967100c (bug 17948) Maintenance scripts now exit(0) or exit(1) as appropriate 2009-04-06 14:41:33 +00:00
Siebrand Mazeland
e2570e98d1 (bug 14929) Add two command line switches to removeUnusedAccounts.php:
--ignore-touched=x   : Ignore accounts touched within the lasts x days\n" );
--ignore-groups=x,y  : Ignore accounts within these groups\n" );

Patch submitted by: Louperivois
2008-08-11 10:06:54 +00:00
Chad Horohoe
3f443c7e25 Ignore sysops+bcrats and accounts touched in the last week. Patch by Louperivois. 2008-07-26 23:42:29 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
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.
2008-05-20 17:13:28 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to 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.) 2007-06-29 01:19:14 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Rob Church
c43b92ece5 Update site_stats.ss_users after deleting unused accounts, to keep the internal statistics tables consistent 2006-06-20 14:03:58 +00:00
Rob Church
84e93509fc Rewritten removeUnusedAccounts to be more efficient, print names of inactive accounts 2006-05-05 01:38:22 +00:00
Rob Church
971d902bd4 * Count log entries too, for uber-anal-completeness' sake
* Fix oversight in counts
2006-04-04 02:54:55 +00:00
Rob Church
ed30476e70 Check that accounts have no uploads prior to calling them unused 2006-04-04 02:50:58 +00:00
Rob Church
7a37b57920 * Comment userFunctions.inc
* Replace uses of raw queries with appropriate database wrapper functions
* Correct some interface inconsistencies in removeUnusedAccounts.php (was referring to deleting users even when no editless users were found)
2006-01-18 01:29:07 +00:00
Rob Church
3236f915eb Make user functions more generalised so other maintenance scripts can use them 2006-01-16 13:57:29 +00:00
Brion Vibber
266d41f165 * Added wfDie() wrapper, and some manual die(-1), to force the return code
to the shell to return nonzero when we crap out with an error.
2006-01-14 02:49:43 +00:00
Antoine Musso
0267db9c42 fix logic, accounts were always deleted! 2006-01-07 13:11:17 +00:00
Rob Church
755140c57c * Cleanup main code
* Correct a couple of major oversights in the commenting (no, they aren't arrays of User objects, that would be mad, and to what avail?)
2006-01-05 23:52:18 +00:00
Antoine Musso
bc0b47fa05 * use the $option system
* add '--help' (and die after showing the message)
* clean up parameter handling a bit
2006-01-05 23:16:11 +00:00
Rob Church
bd5588a445 Tweak script to allow just reporting of the number of inactive accounts 2006-01-04 13:02:04 +00:00
Rob Church
799244ec2f Maintenance script to delete unused accounts 2006-01-04 12:33:45 +00:00