Commit graph

30 commits

Author SHA1 Message Date
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
b2a7aafbed Improve documentation of maintenance scripts.
Change-Id: I93e80edcfc3dc2d5630f7514808cafc22daf39f7
2012-07-25 21:35:53 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Antoine Musso
9780085753 wrong class name: JobQueue -> Job
Commit fb69ee48 used a wrong class name JobQueue instead of Job
Was https://gerrit.wikimedia.org/r/#/c/9116/

Change-Id: Ibe3e146e021a95376d2c57d0366645d8f5370431
2012-05-30 16:51:12 +02:00
Antoine Musso
fb69ee48d3 (bug 37072) - prevents infinite job loop
nextJob.php does not honor jobs types being excluded from the default
job queue by using $wgJobTypesExcludedFromDefaultQueue. Since those jobs
can never get processed, nextJob.php will always return a database which
might produce a nasty infinite loop while trying to process the whole
queue.

Job::pop did take in account wgJobTypesExcludedFromDefaultQueue to
filter the jobs out. So this patch factor out the code in a new method
and uses it for nextJob.php.

Change-Id: I15197ffcca00f229c9004e2abd87e009bc40f384
2012-05-29 13:50:44 +02:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Sam Reed
44696806fb Remove some unused getting of non existent arguments
Documentation
2011-10-18 17:32:20 +00:00
Tim Starling
31851e18cf Some bug fixes for r83634. 2011-03-10 04:47:21 +00:00
Tim Starling
ec277aed72 Rewrite the caching code in nextJobDB.php so that jobs-loop.sh has a chance of being able to exit from the "high-priority" loop.
The current syndrome is that when the cache expires, a small number of high-priority jobs are added. These jobs are quickly cleared, but the job runners do not continue on to other things, because the cache keeps returning the same small list of wikis for 5 minutes. After 5 minutes, there are a few more jobs in the high-priority list, so the cycle continues.
2011-03-10 04:10:27 +00:00
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
Roan Kattouw
c14a0bf429 Fix stupid get vs. set typo in nextJobDB.php 2010-11-16 16:48:20 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Sam Reed
659778619c Stylize maintenance folder.. 2010-05-22 16:50:39 +00:00
Alexandre Emsenhuber
d0e8b1f9ac removed trailing whitespaces 2009-11-23 18:20:26 +00:00
Alexandre Emsenhuber
ea9db3b303 * Update nextJobDB.php and cleanupSpam.php to work with wikis using a prefix for database tables
* Adding a note that nextJobDB.php doesn't work with PostgreSQL
* Pass the wiki through the --wiki option in cleanupSpam.php to not be Wikimedia-only and quote the sed regex to avoid errors due to spaces
2009-08-16 19:23:34 +00:00
Alexandre Emsenhuber
6ca45a1bde Make this script really work :)
* Fatal error: Call to undefined method DatabaseMysql::getTable()
* Fatal error: Cannot use object of type stdClass as array
* return $pendingDBs from nextJobDB::getPendingDbs()
2009-08-08 19:35:48 +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
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
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
Tim Starling
fbfb509df5 * Introduced LBFactory -- an abstract class for configuring database load balancers and connecting to foreign DBs.
* Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. 
* Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. 
* Added ForeignDBViaLBRepo, a file repository which uses LBFactory.
* Removed $wgLoadBalancer and $wgAlternateMaster
* Improved the query group concept to allow failover and lag control
* Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each.
* Removed the $fail parameter to getConnection(), obsolete. 
* Removed the useless force() function. 
* Abstracted the replication position interface to allow for future non-MySQL support.
* Rearranged Database.php. Added a few debugging features. 
* Removed ancient benet-specific hack from waitForSlave.php
2008-03-30 09:48:15 +00:00
Brion Vibber
5549172ef0 Tweak to nextJobDB: don't explode on a system where $wgAlternateMaster array isn't set up; just use $wgDBserver. 2008-01-29 00:23:28 +00:00
Brion Vibber
e735694341 Apply live hack from Wikimedia codebase: pass a database name when connecting to various masters. 2008-01-29 00:22:03 +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
River Tarnell
422f6fa21b fixes 2007-05-11 07:49:32 +00:00
River Tarnell
efc54ce3f1 nextJobDB should have a way to pick a db having specific type of job in the queue 2007-05-11 07:44:40 +00:00
Tim Starling
15d7ca5ab5 Proposed new method which will work with split master. Committing for test on server. 2007-02-26 00:19:17 +00:00
Tim Starling
2da522bc46 Job queue utility, currently Wikimedia-specific 2007-02-25 23:54:24 +00:00