aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Import.php
Commit message (Collapse)AuthorAgeFilesLines
* (bug 33564) transwiki import sometimes result in invalid titleumherirrender2012-04-091-1/+3
| | | | | | | | | This is a simple fix. A other solution is to check isExternal on the original title, but than it is never possible to import pages, which have a interwiki in the destination wiki. Now the interwiki is skipped, when using a target namespace. Change-Id: I148e124016cacac0e0c6c6eb8c7e8a2e85802565
* Commit the cryptrand project worked on in git:Daniel Friesen2012-03-201-1/+1
| | | | | | | | | | | | | | | | | - MWCryptRand: A new api for generating cryptographic randomness for security tokens. Uses whatever cryptographic source is available and if not falls back to using random state and clock drift. - wfRandomString - A simple non-cryptographic pesudo-random string generation function to replace wfGenerateToken which was written pretending to be secure when it's really not. - Core updates to use MWCryptRand in various places: -- user_token generation (to do this we stop generating user_token implicitly and only generate it when needed to avoid depleting the system's entropy pool by reading random data we'll never use) -- email confirmation token generation -- password salt generation -- temporary password generation -- Generation of the automatic watchlist token -- login and create user tokens -- session ids when php's entropy sources are not set -- the installer when generating wgSecretKey and the upgrade key Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/114233
* Documentation followups from lastnightSam Reed2012-02-101-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111163
* More return documentationSam Reed2012-02-091-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111101
* Fixing some of the "@return true" or "@return false", need to be "@return ↵Sam Reed2012-02-091-2/+4
| | | | | | | | | bool" and then the metadata can say true if foo, false if bar Other documentation improvements Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111073
* Update documentation for ImportHandleRevisionXMLTagSam Reed2012-01-161-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109042
* * Added callback to send notices from WikiImporter and use it in ↵Alexandre Emsenhuber2012-01-061-13/+24
| | | | | | | | | | ImportReporter so that it can use the context to get messages and send them to OutputPage (also removes on usage of $wgCommandLineMode) * Early abort on invalid title in ImportReporter::reportPage() since a notice has already been sent * Localised message saying the title is invalid Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108232
* * Don't allow to import a page in the Media: namespace, this didn't work ↵Alexandre Emsenhuber2012-01-061-2/+5
| | | | | | | | | just because WikiPage::factory() throws an exception when a Title in NS_MEDIA is passed * Added localised message when trying to import a page with an interwiki prefix Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108223
* Use WikiPage instead of ArticleAlexandre Emsenhuber2011-11-191-7/+7
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103650
* More documentationSam Reed2011-10-291-3/+34
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101242
* Fixes Bug #28277 by allowing redirects on the stream reader. Fixes aMark A. Hershberger2011-10-271-1/+1
| | | | | | | | | | regression where pages specifying a w:en:Sprint would result in a url like http://pt.wikipedia.org/wiki/en:Special:Export/Sprint which, at least in 1.16, would mean the reader follow the redirect to http://en.wikipedia.org/wiki/Special:Export/Sprint. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101010
* Add, update, tweak documentationSam Reed2011-10-261-20/+231
| | | | | | | | | Fix document comment blocks Tweak some returns Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100778
* (bug 23057) Importers can 'edit' or 'create' a fully-protected page by ↵Robin Pepermans2011-09-061-1/+14
| | | | | | | importing a new revision into it Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96311
* Fix embarassing debugging code left in in r93744Roan Kattouw2011-08-041-1/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93879
* Add --no-updates flag to importDump.php that allows the user to skip ↵Roan Kattouw2011-08-021-1/+18
| | | | | | | 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
* libxml >= 2.7.3 ha a 10mb cap on the size of a text node and the ↵Ariel Glenn2011-07-121-1/+6
| | | | | | | LIBXML_PARSEHUGE lets us override that, needed for lucid since there are a few revs in the db larger than that limit Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91967
* Fixes for r88113 and some realted changes:Alexandre Emsenhuber2011-06-301-25/+9
| | | | | | | | | | | * Modified <s>Article::editUpdates()</s> WikiPage::doEditUpdates() arguments to take a Revision object, an User object and options (much more readable that those boolean parameters) * Call isCountable() on the old content and pass it to WikiPage::doEditUpdates() with the 'oldcountable' option so that it really reflects the old state of the page * Updated all calls (no one in extensions) and removed the wrapper WikiPage::editUpdates() * Call onArticleEdit() and onArticleCreate() (the one that is of course) from doEditUpdates() * Removed $wgTitle hack from Import.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91180
* Removed usage of error suppression operatorAlexandre Emsenhuber2011-06-221-1/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90592
* Per comments on r88145: unlink file if it is brokenBryan Tong Minh2011-06-171-0/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90294
* Even more documentation in various filesSam Reed2011-05-291-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89104
* Use consistent notation for "@todo FIXME". Should update ↵Siebrand Mazeland2011-05-171-7/+7
| | | | | | | http://svn.wikimedia.org/doc/todo.html nicely. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88355
* Follow-up r87176: Make importDump.php import filesBryan Tong Minh2011-05-151-4/+35
| | | | | | | | | * 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
* Rewrote the article counting code and related:Alexandre Emsenhuber2011-05-141-13/+13
| | | | | | | | | | * (bug 26033, bug 24754) Added $wgArticleCountMethod to have a more flexible way to define which method to use to define if a page is an article or not and deprecated $wgUseCommaCount. There is now a new 'any' method to count any article that is in a content namespace and not a redirect. * (bug 11868) If using links to count articles, Article::isCountable() will now use the ParserOutput to check if there's a link instead of checking for the "[[" string. Changed Article::isCountable() to take a stdObject or false for the first parameters. If false is passed, the result will be based on the current article's state (i.e. database). The only call outside of the Article class is in DeleteAction (including extensions). * Removed this horror of Article::$mGoodAdjustment and Article::$mTotalAdjustment, replaced by the new $created parameter on Article::editUpdates(); simplified Article::createUpdates() * Updated Import.php to take advantage of the new parameter and make a single call to Article::editUpdates() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88113
* Tidy up some unused variables and suchSam Reed2011-04-231-0/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86800
* Remove some unused variables/globalsSam Reed2011-04-161-1/+0
| | | | | | | Fix another unreachable statement Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86200
* Add support for importing/exporting files. This can be done by embedding the ↵Bryan Tong Minh2011-04-121-55/+97
| | | | | | | | | | | | | | | | | | | image as base64 in the XML stream or by copying the images directory manually and pointing the importer to the base images directory. Currently only backend code available and a few member variables need to be modified to enable the functionality. Export.php: * Add <rel> and <sha1base36> elememnts to the XML output * Add optional <archivename> and <contents> elements to the XML output. <contents> contains an encoding attribute, which is currently only set to base64. Import.php: * Add Import::$mImageBasePath which should point to the images/ directory to import from * Add methods to WikiRevision (terrible name btw) to set the rel, hash, archivename and filesrc. * Cleanup and made WikiRevision::importUpload working. It's still quite a mess though OldLocalFiel.php: * Fix a few timestamp related things from r85635 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85911
* * (bug 28417) Fix PHP notice when importing revision without a listed idBrion Vibber2011-04-041-5/+14
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85362
* Followup r83536 to address Jack Phoenix's comments about the bogus w/s ↵Mark A. Hershberger2011-03-181-1/+1
| | | | | | | “cleanup” Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84265
* misc w/s cleanups, “svn diff -x-w” cleanMark A. Hershberger2011-03-081-9/+9
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83536
* followup r83227 ... missed bits of patchMark A. Hershberger2011-03-041-6/+11
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83233
* W/S cleanupMark A. Hershberger2011-03-041-11/+11
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83230
* All functions of the importer have $title, origTitle, but processTitle() ↵Derk-Jan Hartman2011-02-191-1/+1
| | | | | | | | | | | | returned $title, origTitle. This caused confusion and a misusage of the processTitle() result. Follow up to r66267. Fixes bug 27486 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82482
* Kill the XMLReader2 class in response to Tim's code review comments on r68587Andrew Garrett2011-02-031-7/+23
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/81437
* Cleanup for r66268, r66267: merge WikiImporter back into Import.php, where ↵Tim Starling2011-01-311-0/+733
| | | | | | | it started. It doesn't really make sense to have a class called WikiImporter in a file called ImportXMLReader.php, and a few little helper classes for it in a file called Import.php. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/81238
* Converted ImportStreamSource functions to return a Status object rather than ↵Alexandre Emsenhuber2010-12-051-12/+12
| | | | | | | | | ImportStreamSource-or-WikiError This is a breaking change since the ImportStreamSource object is in the value member of the Status object; I will fix the extensions in my next commit Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77800
* Remove comment related to no longer supported PHP versions.Siebrand Mazeland2010-10-021-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/74171
* Remove old var_dumpPlatonides2010-08-271-1/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/71797
* * Standardised file description headersAlexandre Emsenhuber2010-08-081-2/+3
| | | | | | | | * Added some descriptions * Added @file where needed Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70699
* Rewrite of XML Dump Processing:Andrew Garrett2010-05-121-652/+0
| | | | | | | | | | | | * Full rewrite of the WikiImporter class to a new class, XMLDumpImporter, which uses XMLReader instead of the deprecated PHP SAX interface. * Fixes for the following bugs: ** XML Dump Processor chokes on unrecognised tags. ** Special:Import does not allow you to import a dump including only log entries. * Added hooks to allow extensions to handle tags in any part of the XML document. * Fully source-compatible with the previous interface. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66267
* Replaced all @fixme with "@todo Fixme" since doxygen doesn't have a @fixme ↵Alexandre Emsenhuber2009-12-151-2/+2
| | | | | | | command Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/60093
* Code cleanup, covert leading spaces into tabs per coding styleOverlordQ2009-11-141-27/+27
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/59080
* Changed sequence names to a standard <table>_<field>_seq form.Jure Kajzer2009-10-281-1/+1
| | | | | | | | | Updated all nextSequenceValue calls with new sequence names. OverlordQ stated he'll handle changes to Postgres scripts. Need someone to change DB2 scripts. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/58262
* Fixed total import breakage from r53271Aaron Schulz2009-10-141-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/57697
* fix some doxygen warningsAlexandre Emsenhuber2009-10-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/57362
* * Mostly reverted r41081 and related. Although the motivation (to save a ↵Tim Starling2009-02-161-1/+1
| | | | | | | | | | | | | | query) is noble, it's a complex special case relying on subtle inter-module effects, making the code quite unclear and the performance advantage hard to reproduce in new code. * r41081 was causing the job queue to be flooded with tiny htmlCacheUpdate jobs which were less than the batch size and so, according to the original logic, should have been done immediately. This was causing template updates to be delayed even when the template has few backlinks. This is fixed. * Introduced a shared cache called BacklinkCache with the main purpose of sharing data from these backlink queries, thus recovering the performance of r41081. * Refactored backlink partitioning code, which in r40741 was copied from HTMLCacheUpdate to LinksUpdate with a bug intact. The bug caused every htmlCacheUpdate or refreshLinks2 job to be split into at least two pieces even when number of rows is less than the batch size. * Fixed a bug from r40741 causing refreshLinks2 jobs with end=false to be ignored. * Made SquidUpdate::newFromTitles() accept a TitleArray Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/47317
* Add 'include pages linked to from these pages' to Special:Export and the ↵Andrew Garrett2009-02-061-1/+2
| | | | | | | corresponding transwiki interface. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/46951
* (bug 15283) Interwiki imports should fetch included templatesChad Horohoe2009-02-061-2/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/46884
* Attempting to import a title that came out as an interwiki would sort of ↵Brion Vibber2008-12-101-0/+3
| | | | | | | | | | | | | | half-work somewhere then explode when trying to save the null revision with the import info: Fatal error: Call to a member function insertOn() on a non-object in /Library/WebServer/Documents/trunk/includes/specials/SpecialImport.php on line 305 Now such titles are skipped. You can probably force import of the page by forcing the target namespace... Better long-term solution might include title renormalization, adapation of remote namespace names (eg Wikipedia -> Project), etc. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/44427
* handle xmlns for imports (bug #4520)Ariel Glenn2008-12-051-1/+36
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/44246
* * Add guard exception in OutputPage::parse() for failure case where $wgTitle ↵Brion Vibber2008-11-241-0/+5
| | | | | | | | | is null; that causes a fatal error which doesn't show a backtrace if we don't catch it here. * Temporarily set $wgTitle while doing article creation/edit updates during XML import. A null $wgTitle as in importDump.php caused a fatal error when special pages were transcluded if they did any parsing via OutputPage::parse() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/43885