Commit graph

122 commits

Author SHA1 Message Date
Alexandre Emsenhuber
2b6b4f9a0e Fix erroneous check in refreshLinks.php
Obviously null === false will never return true,
and what we actually want here is to check whether
we have a content or not.

Change-Id: Id78897e80ba2553c925e10d67c0fce2186aa11fd
2013-01-13 22:13:55 +01:00
Alexandre Emsenhuber
d85239a186 Use ResultWrapper::numRows() instead of DatabaseBase::numRows()
Change-Id: I87f059aaff72bf06ebc72ad3a7904cca8e11fab9
2013-01-06 11:52:40 +01:00
Platonides
6882ff0d75 The class is named Revision, no need to shout its name :)
Remove a couple of unused globals.

Change-Id: I750536bc05ed7a5433840b916b17df93d30da5bf
2012-10-26 23:41:24 +02:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
daniel
8d280dde9b Moved getParserOutput to Content interface.
On Tim's request, this change moved getParserOutput() and getSecondaryDataUpdates()
from the ContentHandler to the Content interface.

Change-Id: Ia654aa8710a242ba5fe7a4eb528e6a6449035f59
2012-07-23 23:52:34 +02:00
daniel
3d58f903d8 Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata 2012-06-11 17:45:59 +02:00
Reedy
7492e90cc6 Add a bit more slave waiting...
Change-Id: I329219bfdd56b57609237fc9f907f2b31628d282
2012-06-09 03:37:38 +01:00
daniel
48d0bedd78 cleanup and fixes for secondary data updates 2012-06-07 14:57:43 +02:00
daniel
684178dfb6 Use Title, not IContextSource; remove createArticle, etc.
This merges the latest core patch into the Wikidata branch,
implementing suggestions collected on gerrit. Most importantly:

* Methods in the Content class no longer rely on a IContextSource
* createArticle and createEditPage were removed from Contenthandler
2012-05-23 08:53:01 +02:00
daniel
96b4779ebd introducing Content::getSecondaryDataUpdates() 2012-05-16 20:14:14 +02:00
daniel
87385643c5 fix: SecondaryDataUpdate -> DataUpdate 2012-05-15 15:21:08 +02:00
daniel
af28c6f55a merged from master 2012-04-29 21:41:03 +02:00
Alexandre Emsenhuber
b23194ab0e Use WikiPage::newFromID() instead of Title::newFromID() in refreshLinks.php.
Avoids having to load twice the same row from the database.

Change-Id: I3099dbd290e44f21677990e69200694c70aac63b
2012-04-26 09:54:28 +02:00
daniel
a990fd78ff merged from master 2012-04-25 19:49:09 +02:00
Alexandre Emsenhuber
5208ddbaac Use $wgContLang and an anonymous user in refreshLinks.php to parse pages.
Normally it should already be correct, but just in case it gets broken for some reason.

Change-Id: Ia38df1ba1f4a6224296bfd837a515ce0ccdf55cb
2012-04-23 09:11:24 +02:00
daniel
c536e3db65 use ParserOutput::getSecondaryDataUpdates() as the primary method of getting pending updates 2012-04-17 17:54:00 +02:00
Jens Ohlig
10e91851b2 Merge branch 'master' into Wikidata
Conflicts:
	.gitreview
	includes/Article.php
	includes/AutoLoader.php
	includes/EditPage.php
	includes/LinksUpdate.php
	includes/WikiPage.php
	includes/installer/Ibm_db2Updater.php
	includes/installer/MysqlUpdater.php
	includes/installer/OracleUpdater.php
	includes/installer/SqliteUpdater.php
	maintenance/refreshLinks.php
2012-04-11 14:24:29 +02:00
daniel
e67a39f37f use ParserOutput::getLinksUpdateAndOtherUpdates() in order to get all necessary update objects
Change-Id: I69c50e0bd59371a6a34b04d2762a882c6e7e60cb
2012-04-05 17:35:15 +02:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Sam Reed
f3f180850a Fixing up undefined types in maintenance documentation 2012-02-09 21:08:06 +00:00
Alexandre Emsenhuber
9c0ba20be8 * Use WikiPage instead of Article
* Use getRedirectTarget() instead of followRedirect(); the latter may return a string, which is not wanted here
* No need to call updateRedirectOn(); getRedirectTarget() already populates the redirect table if needed
2012-01-07 15:43:05 +00:00
Sam Reed
00d361886a * (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent 2011-08-18 23:16:11 +00:00
Sam Reed
66e01d1bb7 Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00
Sam Reed
4fc982ebd9 Fix whitespace, documentation 2011-07-09 03:49:25 +00:00
Sam Reed
a65d263fed * (bug 28630) Add iwlinks, langlinks, redirect to RefreshLinks::deleteLinksFromNonexistent 2011-07-09 03:47:43 +00:00
Sam Reed
4e4a717984 Followup r86183 and per bug 28628
Might awell make refreshLinks remove dead iwlinks from the table
2011-07-09 03:43:22 +00:00
Platonides
62053ac8fd Merge r86398 into the old wfWaitForSlaves. Update core calls.
maintenance/waitForSlave.php still calls the old prototype.
Most instances were replaced with 
sed -i 's/wfWaitForSlaves( [0-9]* );/wfWaitForSlaves();/' ./maintenance/initEditCount.php ./maintenance/updateRestrictions.php ./maintenance/updateSpecialPages.php ./maintenance/importDump.php ./maintenance/moveBatch.php ./maintenance/storage/resolveStubs.php ./maintenance/storage/trackBlobs.php ./maintenance/storage/fixBug20757.php ./maintenance/storage/moveToExternal.php ./maintenance/storage/compressOld.inc ./maintenance/populateSha1.php ./maintenance/deleteDefaultMessages.php ./maintenance/migrateUserGroup.php ./maintenance/importImages.php ./maintenance/runJobs.php ./maintenance/archives/upgradeLogging.php ./maintenance/deleteBatch.php ./maintenance/populateLogSearch.php ./maintenance/populateLogUsertext.php ./maintenance/gearman/gearmanWorker.php ./maintenance/populateRevisionLength.php ./maintenance/refreshLinks.php ./maintenance/deleteSelfExternals.php ./maintenance/upgrade1_5.php ./maintenance/rebuildFileCache.php ./includes/job/RefreshLinksJob.php ./includes/installer/MysqlUpdater.php ./maintenance/convertUserOptions.php ./maintenance/populateParentId.php ./maintenance/runBatchedQuery.php ./maintenance/upgrade1_5.php ./maintenance/waitForSlave.php ./maintenance/populateCategory.php ./maintenance/importImages.php
2011-04-20 00:12:06 +00:00
Sam Reed
3112302c73 Remove unused globals 2011-04-11 13:53:57 +00:00
Brion Vibber
8ee5e02054 Followup to r85706 and friends: now that Math messages have been moved to extension, move out the settings list and constants.
* MW_MATH_* constants are now defined in Math extension
* Language::getMathNames() is removed
* mathNames section in message files is removed
* A hardcoded preference override in refreshLinks moved to MaintenanceRefreshLinksInit hook
2011-04-09 19:57:35 +00:00
Sam Reed
993c5d1188 Rebuild raw sql
Remove old method_exists

Add braces
2011-02-09 20:09:22 +00:00
Sam Reed
2526cee7d1 Explicitally define $i = 0; 2011-02-09 19:54:23 +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
Alexandre Emsenhuber
9f5d06527c Part of bug 26280: added license headers to PHP files in maintenance 2010-12-16 19:15:12 +00:00
Alexandre Emsenhuber
29a787739c Changed global variables ($wgTitle and $wgArticle) to local ones 2010-12-13 15:13:06 +00:00
Mark A. Hershberger
617a5b1e15 Whitespace fixup under tha maint directory. 2010-12-04 03:20:14 +00:00
Chad Horohoe
9251469edd Fix undefined $max when doing --dfn-only 2010-11-13 16:32:40 +00:00
Chad Horohoe
804e18faf4 Get rid of php4ism 2010-09-19 17:42:15 +00:00
Chad Horohoe
74d859364f Make fixLinksFromArticle public and static 2010-08-20 16:49:17 +00:00
Chad Horohoe
44229b50e6 Fixed a bunch of silly instances of [^!=]==\s*(true|false) 2010-06-09 11:44:05 +00:00
Sam Reed
659778619c Stylize maintenance folder.. 2010-05-22 16:50:39 +00:00
Happy-melon
2e26a98cd3 Make 'start' not required. As requested by ^demon on IRC... 2010-01-13 18:28:31 +00:00
Roan Kattouw
13adb2866a Make refreshLinks.php purge orphaned redirect table rows, i.e. rows whose rd_from refers to a page that's not a redirect or doesn't even exist 2009-12-29 11:44:45 +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
Jure Kajzer
d19c944694 (bug 18762) both redirects and links fixed if redirects-only switch not present 2009-12-02 13:37:24 +00:00
Chad Horohoe
25e604f1c0 Redo addArgs() as addArg() so we can actually do useful things with arguments like descriptions and proper requirement checks, similar to addOption() 2009-08-18 23:06:24 +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
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
Merlijn S. van Deen
a4227ca036 Fixes for r45514 and r45516:
* Removed deprecated constructs
* Replaced SQL queries with their functional equivalents
** Removed deleteBatch function: equivalent to $dbw->delete()
* Allow slave servers to catch up before deleting more rows
* Fixed to use a new, unbuffered, slave database connection
* This one should actually work
2009-01-13 23:58:45 +00:00
Merlijn S. van Deen
ec78d58caa * Added batch-size parameter to optionsWithArgs
* Added --batch-size example syntax
2009-01-07 20:34:33 +00:00
Merlijn S. van Deen
05c146c191 Recommit of r45431 with these changes:
* Removed backspace characters in output
 * Small code update
 * Removed 'disabled' comment from refreshLinks.php
2009-01-07 19:51:36 +00:00
Brion Vibber
afc688d7e2 Pull back r45431 for the moment "Updated deleteLinksFromNonexistent function:" etc
There's some funny output with \x08 stuff, and I don't want to fiddle with it just now...
2009-01-07 03:33:14 +00:00
Merlijn S. van Deen
d7b9e71465 Updated deleteLinksFromNonexistent function:
- refreshLinks.inc:
   * New algorithm, conform Brions description in bug #16112; instead of one big delete, it is split up in blocks of (by default) 100 incorrect page_ids to remove.
   * Added function parameters

 - refreshLinks.php
   * New command-line parameter to set the number of page_ids to clean per batch.
   * Re-instated deleteLinksFromNonexistent run
2009-01-06 02:10:22 +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
6b79f5995a Add --old-redirects-only option to maintenance/refreshLinks.php, to add old redirects to the redirect table. This may be worth trying out on at least some of the smaller wikis. It seems to work correctly, and pretty quickly for a couple thousand redirects to fix, although truncating the redirect table and running it inevitably gives a different number (probably due to incorrect redirect table entries to start with). With the limit options, it might be tried on bigger wikis too. 2008-03-05 03:50:12 +00:00
Tim Starling
ee8d294003 Fix for bug 12705. Fixed refreshLinks.php documentation. 2008-01-22 10:10:21 +00:00
Aryeh Gregor
1d749bc52c Add some stub docs to refreshLinks.php, so at least refreshLinks.php --help doesn't start screwing with your database. $fname -> __METHOD__. 2007-11-26 17:58:08 +00:00
Robert Stojnić
4849760a20 Add --redirects-only switch to refreshLinks.php, which refreshes the redirect table, maybe this should be done by default as well. 2007-07-09 23:38:54 +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
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Tim Starling
f88b6fd3ec Don't use tidy. Command line option to specify the end ID. Clear the link cache after each article to keep memory usage down. 2006-01-26 11:25:26 +00:00
Tim Starling
d5e212999a ported refreshLinks.php improvements (and associated change to commandLine.inc and Database.php) from 1.4 2005-06-19 01:05:56 +00:00
Antoine Musso
6bbcf091bf Phpdoc comments and place holder. Part of the subpackage "maintenance", archives in subpackage "maintenanceArchive" 2004-09-03 20:33:01 +00:00
Tim Starling
2ba5e0e718 * Moved content from liveCmdLine.inc into commandLine.inc, obsoleting the 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
2004-06-15 15:18:50 +00:00
Tim Starling
8f22cb45b1 include_once -> require_once 2004-05-07 13:43:10 +00:00
Tim Starling
df30457dc0 Seems to be working now 2004-02-24 14:11:13 +00:00
Tim Starling
b14d8978f8 more types of corruption fixed 2004-02-24 00:10:32 +00:00
Tim Starling
1d57736925 minor changes 2004-02-23 08:08:38 +00:00
Tim Starling
8e0082a18d new link rebuilder, capable of operating in the background 2004-02-23 07:43:20 +00:00