aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/importDump.php
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Fix option name in maintenance/importDump.php"jenkins-bot2018-10-041-1/+1
|\
| * Fix option name in maintenance/importDump.phpBrad Jorsch2018-10-031-1/+1
| | | | | | | | | | Bug: T200138 Change-Id: Icc5d9878bc3ebdf03efec9161b220ad0bf55dc9a
* | Mass conversion of $wgContLang to serviceAryeh Gregor2018-08-111-3/+5
|/ | | | | | | Brought to you by vim macros. Bug: T200246 Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
* 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
* [WikiImporter::notice] use wfDebug instead of echo in notice()Yifei He2017-12-221-0/+3
| | | | | | | | Make the default notice implementation of notice() function to send the notice to wfDebug() instead of simply echo to prevent XSS Bug: T177997 Change-Id: I9ffb597e0642afc1603cdd15e2d09c6f2584b448
* Merge "Add missing @throws in Importers"jenkins-bot2017-12-061-0/+1
|\
| * Add missing @throws in ImportersWMDE-Fisch2017-12-061-0/+1
| | | | | | | | Change-Id: I02760e59d73f4278cca87483ab4578b6e76b2324
* | Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernamesBrad Jorsch2017-11-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing revisions in MediaWiki has long been weird: if the username on the imported revision exists locally it's automatically attributed to the local user, while if the name does not exist locally we wind up with revision table rows with rev_user = 0 and rev_user_text being a valid name that someone might later create. "Global" blocks too create rows with ipb_by = 0 an ipb_by_text being a valid name. The upcoming actor table change, as things currently stand, would regularize that a bit by automatically attributing those imported revisions to the newly-created user. But that's not necessarily what we actually want to happen. And it would certainly confuse CentralAuth's attempt to detect its own global blocks. Thus, this patch introduces "interwiki" usernames that aren't valid for local use, of the format "iw>Example".[1] Linker will interpret these names and generate an appropriate interwiki link in history pages and the like, as if from wikitext like `[[iw:User:Example]]`. Imports for non-existant local users (and optionally for existing local users too) will credit the edit to such an interwiki name. There is also a new hook, 'ImportHandleUnknownUser', to allow extension such as CentralAuth to create local users as their edits are imported. Block will no longer accept usable-but-nonexistent names for 'byText' or ->setBlocker(). CentralAuth's global blocks will be submitted with an interwiki username (see Ieae5d24f9). Wikis that have imported edits or CentralAuth global blocks should run the new maintenance/cleanupUsersWithNoId.php maintenance script. This isn't done by update.php because (1) it needs an interwiki prefix to use and (2) the updater can't know whether to pass the `--assign` flag. [1]: '>' was used instead of the more usual ':' because WMF wikis have many existing usernames containing colons. Bug: T9240 Bug: T20209 Bug: T111605 Change-Id: I5401941c06102e8faa813910519d55482dff36cb Depends-On: Ieae5d24f9098c1977447c50a8d4e2cab58a24d9f
* | Maintenance: add fatalError() methodBryan Davis2017-11-211-3/+3
|/ | | | | | | | 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
* importDump.php: Declare uploadCount propertyMark A. Hershberger2017-08-261-0/+1
| | | | | Bug: T174255 Change-Id: Ic5014821a8f10ab29b729104cd7d4e434085e2f2
* Add skipping to nth page option/ability for dump importing processMehmet Mert Yıldıran2017-06-091-0/+6
| | | | | | | | | | | Usage: php importDump.php --skip-to 271500 /path_to/dumpfile.xml.gz When importing a database dump and the import process crashes (for random reasons) after a certain number of pages, the "--skip-to" parameter allows restarting the import process at a certain page instead of starting the import from scratch. Change-Id: Ib36063b69d6846fc197800bba44287493b0632c0
* Disable statistics update on import with maintenance/importDump.phpSubin Siby2017-01-031-1/+5
| | | | | | | Disable updating statistics in importDump.php to quickly finish imports from command line. Bug: T144600 Change-Id: Ib827c068fb20cc03aab47e3106d489f18be1dac6
* Convert all array() syntax to []Kunal Mehta2016-02-171-6/+6
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Fix a bunch of call-time pass-by-reference errorsMax Semenik2016-02-101-4/+4
| | | | Change-Id: I3bd8e7c4d2dca465957a353cb7dc2a906699ff6a
* Use addDescription() instead of accessing mDescription directlyMax Semenik2016-01-301-2/+4
| | | | Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
* Update wfGetDB calls in Maintenance scripts to use getDB()Reedy2016-01-021-1/+1
| | | | Change-Id: I9ad6745d84506b736dae94747256caac89715899
* Add --rootpage parameter to importDump.phpAndrew H2015-12-271-0/+10
| | | | | | | | The --rootpage parameter will import pages as subpages of a specified page. Bug: T72272 Change-Id: Ie026b091275668765ea06e947d45bed64354f2cb
* Handle missing titles and usernames when importing log itemsgeorggi2015-12-191-3/+11
| | | | | Bug: T121338 Change-Id: Idf95263e4f22225509da4ee07fcb14383028894b
* phpcs: Fix some "Assignment expression not allowed"umherirrender2015-11-011-1/+2
| | | | | | | Found by new version of mediawiki/codesniffer https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/1939/consoleFull Change-Id: I673f71fd0dfc8d6ba1ce6c3d5da21787ff95cb32
* Remove DeferredUpdates::doUpdates call in CLI scriptsAaron Schulz2015-10-201-2/+0
| | | | | | | Core already handles this by not letting them build up. They run after each main DB commit. Change-Id: I37c2a60e2df579ed59b2a8f3a7679d1d380e6337
* Import.php: Use Config instead of globalsKunal Mehta2014-10-221-1/+1
| | | | Change-Id: I4d1a8c443cfa360c5d388364c580d48fa7124099
* Throw exception in importDump instead of dumping a random backtrace and erroringChad Horohoe2014-07-281-2/+1
| | | | Change-Id: I2387168d96c3fd15299376c50521fd6f0710ce65
* Always return bool in BackupReader::handleUploadumherirrender2014-07-211-1/+3
| | | | Change-Id: I476a1668b3a1ff9148ff335c9d7c9aa0c8ca3d11
* Update formatting in maintenance/ (3/4)Siebrand Mazeland2014-04-231-0/+6
| | | | Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
* Pass phpcs-strict on maintenance/ (5/8)Siebrand Mazeland2014-04-231-3/+10
| | | | Change-Id: I156b547b504e7267ea43deff4b8c532635508e81
* Fixed some @params documentation (maintenance)umherirrender2014-04-171-4/+3
| | | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I727deec35a712de0f0c676cc87dfa661f1ee965b
* Change URLs to mediawiki.org in comments to HTTPSLadsgroup2014-03-201-2/+2
| | | | | | | These are only documentation fixes http://www.mediawiki.org --> https://www.mediawiki.org Change-Id: I62ad42be1a3aac410cc53e98ce79389ceddd8988
* 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
* Fixed some spacing in maintenance folderumherirrender2013-04-181-10/+10
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
* Added/Removed spaces around string concatenationumherirrender2013-04-131-1/+1
| | | | | | | | | And added/removed spaces around some other tokens, like +, -, *, /, <, >, =, ! Fixed windows newline style Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* Clean up: Declare variables with public instead of varMarius Hoch2012-09-141-7/+7
| | | | | | | | | | | | Variables in classes should be declared using public $foo instead of var $foo for various reasons. As we require PHP 5.3 we don't have to take care about that PHP4 left over, but can get rid of it in favour of the more clear and better readable public. See also: http://php.net/manual/en/language.oop5.visibility.php (Divided into several commits to keep reviewable) Change-Id: Ic723d0347ab2e3c78bc0097345c68bbee3dc035a
* Remove usage of wfTime() in maintenanceAlexandre Emsenhuber2012-09-041-2/+2
| | | | | | | This function is only a wrapper to microtime( true ), so it can easily be replaced and deprecated at some point. Change-Id: I26f77d3cb02cc517ecf51262a4684084a7ce7825
* 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-07-241-1/+5
| | | | Change-Id: If0af9922ede902c2c6f18b627d5810f3e888c944
* Fixed reporting in importDump.txtMax Semenik2012-01-111-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108611
* More documentation updatesSam Reed2011-10-281-5/+11
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101161
* Remove some unused getting of non existent argumentsSam Reed2011-10-181-2/+6
| | | | | | | Documentation Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100130
* Refactor deferrable updates into classes & interfaces, also add helper ↵Chad Horohoe2011-09-101-1/+1
| | | | | | | | | | | method for the most common use case: $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, "sometable" ); I kept b/c with $wgDeferredUpdateList for now, but seeing as only 3 exts in svn use it (FileSearch, FlaggedRevs and WikiScripts), I'd like to deprecate it pretty soon :) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96716
* Sanity check report size to avoid division by zeroAaron Schulz2011-09-061-0/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96355
* (bug 30172) posix_isatty() fallback does not work when the function has been ↵Chad Horohoe2011-08-021-1/+1
| | | | | | | disabled (but exists). While we're at it, make things work for HipHop too. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93789
* Add --no-updates flag to importDump.php that allows the user to skip ↵Roan Kattouw2011-08-021-0/+4
| | | | | | | updating the links table. On my test dataset (an old (~2 years) MediaWiki namespace dump of enwiki) this speeds up the import from 9m35s to 10s. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93744
* Remove some unused variables, add/improve some documentationSam Reed2011-06-011-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89272
* Report importDump to subclass MaintenanceChad Horohoe2011-05-211-82/+63
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88555
* Follow-up r87176: Make importDump.php import filesBryan Tong Minh2011-05-151-0/+11
| | | | | | | | | * Fixes for Import.php: Check sha1 of the file; only delete source files if they are temporary * importDump.php now imports embedded files if --uploads is set; if they are not present it will try to get them from --image-base-path Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88145
* Merge r86398 into the old wfWaitForSlaves. Update core calls.Platonides2011-04-201-1/+1
| | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86447
* Ugly bug 24375 hackAaron Schulz2011-03-201-2/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84427
* * Bug 27823 - Re-enable functionality of --uploads option of importDump.php; ↵Mark A. Hershberger2011-03-041-1/+51
| | | | | | | | | | | | | | | | | introduce --namespaces filter option for importDump.php Patch from Dmitriy Sintsov of which he writes: I needed to selectively import files from URL's defined in previousely made XML dump. This worked fine in 1.15, but to my surprise wasn't working with 1.17, producing an error. I've partially fixed upload code (including supplying of original User instance for local upload) and introduced new option to selectively import only the listed namespaces in importDump.php command line. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83227
* * bug 27263: importDump.php now finally has --help text, also shown when ↵Brion Vibber2011-02-081-1/+36
| | | | | | | stdin is a tty and no file given Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/81796
* Whitespace fixup under tha maint directory.Mark A. Hershberger2010-12-041-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77711