Commit graph

99 commits

Author SHA1 Message Date
Ariel Glenn
2a14ecd921 remove cruft that didn't all get cleaned up before commit in r95260, addressing fixme. 2011-09-22 07:03:25 +00:00
Sam Reed
27ec1d6377 Comment out unreachable code
Remove unreachable return false;
2011-09-21 16:34:23 +00:00
Ariel Glenn
443933fef5 throw exception if rename of output file fails 2011-09-15 17:18:13 +00:00
Ariel Glenn
be36f6e1fe getFilename renamed to getFilenames since it can return a list 2011-09-09 07:28:11 +00:00
Ariel Glenn
aed738967f get rid of duplication, remove unused function rename(), add documentation as per comments on r95260 2011-09-07 20:21:52 +00:00
Roan Kattouw
e1978da7a3 Fix parse error in r96275 2011-09-06 22:17:01 +00:00
Roan Kattouw
165a42ad11 Stylize Export.php 2011-09-05 11:23:49 +00:00
Roan Kattouw
6e336d3799 Whitespace fixes for r95272, r95604 2011-09-05 11:22:57 +00:00
Roan Kattouw
e9658c4b9e Fixes for r95260:
* Use protected instead of var
* Move documentation of closeRenameAndReopen() to parent class. Add a TODO for the other undocumented methods introduced in r95260
* Use the correct method name in the exceptions by using __METHOD__; messages were copypasted from one method to the other without changing anything. Also fix a typo ("argumnts")
* Minor coding style bit, will commit more style fixes in a minute
2011-09-05 11:16:09 +00:00
Ariel Glenn
0dcd589b6b define and use closeAndRename() after last write of xml dump file; convert from popen (child inherits all open descriptors and there is no workaround) to proc_open (CLOEXEC set on all descriptors), needed so close and rename doesn't hang forever if a child (prefetcher) is forked 2011-08-27 18:31:03 +00:00
Ariel Glenn
431bce6c78 replace WfDie() 2011-08-27 15:50:17 +00:00
Ariel Glenn
da81194225 add functions that support close and rename of output files as they are being written, used to write out checkpoint files at regular intervals during XML dump production 2011-08-22 22:01:32 +00:00
Roan Kattouw
16e540e5c3 * Introduce File::getCanonicalUrl()
* Make File::getFullUrl() use PROTO_RELATIVE for consistency with other methods named getFullUrl() and to prevent cache pollution
* Use canonical URLs in Export.php
2011-08-19 15:27:49 +00:00
Sam Reed
b0d659bb21 Uncommited documentation from my working copy 2011-06-25 16:15:44 +00:00
Tim Starling
6fec4e3fde Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks HipHop support. 2011-05-15 13:21:16 +00:00
Bryan Tong Minh
89601ad230 Follow-up r87176 use wfLocalFile instead of wfFindFile 2011-05-15 10:43:51 +00:00
Happy-melon
fd34d0354b * Implement MW_VERSION constant in Defines.php and use it in preference to $wgVersion. Defines.php will have been loaded anywhere that DefaultSettings.php has been loaded.
* Move the declaration of $wgFeedClasses from Defines.php to WebStart.php
2011-05-07 14:53:08 +00:00
Bryan Tong Minh
9b3128eb2b Add support for importing/exporting files. This can be done by embedding the 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
2011-04-12 19:25:56 +00:00
Happy-melon
38475c650b Clean up some direct $db->query($sql) calls. Remove limit/offset parameters from Article::getContributors() as they weren't being used anywhere and probably didn't work properly anyway. 2011-04-12 12:09:11 +00:00
Bryan Tong Minh
743f844031 Revert r85644. Multipart sucks because it is hard to parse and because you need to seek into the stream. I'll follow up with a solution that allows embeding data in the stream. 2011-04-09 14:43:12 +00:00
Bryan Tong Minh
40a0a0431e Second part of bug bug 22881: Allow exporting files along with the XML as mimepart/related file. The patch attached to that bug was unfortunately not up to coding standards, so I rewrote this part myself. 2011-04-07 21:44:44 +00:00
Bryan Tong Minh
922814b177 Stylize Export.php 2011-04-07 21:04:16 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Rob Lanphier
117ed1ef5d Bug 26563: Add bytes changed per revision for stub and full article dumps 2011-01-08 03:11:06 +00:00
Alexandre Emsenhuber
249022d65e Converted WikiError to MWException so at least users can see the problem (nothing was checking the return value of WikiExporter::dumpFrom() and realted methods) 2010-12-05 13:57:07 +00:00
Sam Reed
b5c9c3ddd6 Switch last few uses of while loops to foreach in phase3 2010-10-31 23:08:38 +00:00
Alexandre Emsenhuber
85e0c158ee * Standardised file description headers
* added @file where needed
* added file description headers where needed
2010-10-23 14:16:26 +00:00
Sam Reed
a2589ff8c6 Assignment in loop conditions suck
while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in includes

Add some braces
2010-10-13 23:11:40 +00:00
Platonides
537826a674 Remove $wgContLanguageCode usage in core.
sed -i 's/$wgContLanguageCode/$wgLanguageCode/g'
These are now the same, always. Per and since r15827.

$wgLanguageCode wins due to being the one set by LocalSettings.

$wgContLanguageCode definition at includes/Setup.php kept for now.
2010-09-07 22:37:55 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00
Alexandre Emsenhuber
0c0f5f6545 $fname -> __METHOD__/__FUNCTION__ 2010-04-04 18:33:57 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Raimond Spekking
9509e98ebb Fix PHP Notice: Undefined variable: text in /var/www/w/includes/Export.php on line 518 seen on translatewiki
Initialize $text to avoid this notice.
But I am unsure if this is enough. The variable $text seems unused for a long time until a hook, introduced in r53818, uses it.
2009-10-15 07:08:56 +00:00
Chad Horohoe
c319cc8968 (bug 13750) $wgCapitalLinks should be a per-namespace setting 2009-10-09 12:52:16 +00:00
Alexandre Emsenhuber
b4b89afea3 fix some doxygen warnings 2009-10-04 21:21:30 +00:00
Brion Vibber
c1c7c674d9 Cleanup for r56298 "(bug 18180) Special:Export ignores limit, dir, offset parameters. Patch by azliq7"
Reorder the checks so that we get the is_array() out of the way first instead of relying on the weird type interaction between the array and the integers when doing binary AND. :)
Also made a fix so this actually works when $wgExportMaxHistory is set to 0, which per doc comment seems like it should not limit.
2009-09-29 21:37:07 +00:00
Tomasz Finc
e0728c29e6 bumping version number as new xsd r54472 was approved. fixing spacing 2009-09-18 17:34:56 +00:00
Roan Kattouw
61fc5428c1 (bug 18180) Special:Export ignores limit, dir, offset parameters. Patch by azliq7 2009-09-14 12:57:37 +00:00
Andrew Garrett
6e5dd5459a Incremental enabling changes to allow searching of LiquidThreads by page and by thread:
* Add three new hooks, XmlDumpWriterOpenPage, ModifyExportQuery and XmlDumpWriterWriteRevision, to WikiExporter class.
* Hook two of these events to add a DiscussionThreading section to XML dumps, containing the parent, ancestor and discussion page to which a post belongs, if it is indeed a LiquidThreads post (as determined by joining on the thread table).
* Deprecate old calling style for Thread constructor, the $children parameter has been unused for yonks.
2009-07-27 17:57:51 +00:00
Tomasz Finc
c575c5e9f4 Marking redirects in XML 2009-07-14 21:38:43 +00:00
Tim Starling
ba9468ec24 Remove $resultset->free() calls, as in live hack. The calls are unnecessary, removing probably fixes some bug. 2009-06-15 06:54:40 +00:00
Jure Kajzer
c3fafd96f7 Added bitwise operations to DatabaseBase and overloaded in DatabaseOracle. 2009-06-13 06:31:38 +00:00
Aaron Schulz
765dfc88d5 Log stream buffer fix 2009-04-14 14:42:50 +00:00
Aaron Schulz
c76ee491ac (bug 17189) Created 'stable versions only' dumps for wikis with FlaggedRevs 2009-03-02 19:48:41 +00:00
Aaron Schulz
0e161fb937 Log dump cleanup for WikiExporter::STREAM 2009-03-01 20:04:52 +00:00
Aaron Schulz
a5af644408 log dump tweak: only select user_name from user table 2009-02-28 19:10:37 +00:00
Robert Rohde
be8adf032e Remove misplaced whitespace in export header. 2009-01-18 05:54:27 +00:00
Chad Horohoe
be374a912a War on wfElement() and friends. Call the Xml members directly, rather than using old wrappers. 2008-12-14 19:14:21 +00:00
Ilmari Karonen
112f2e6a50 First step in replacing NS_IMAGE with NS_FILE, to match the canonical name change (bug 44).
This step simply defines the new constants NS_FILE and NS_FILE_TALK, retaining NS_IMAGE and NS_IMAGE_TALK as aliases, and makes them usable for export (which seems to be the only part of core that uses the NS_* names as strings). 

The second step should be a global search-and-replace across core (other than Defines.php and Export.php).  I've already tried this locally, and there seem to be no problems.  This step should not touch extensions.

The third, optional step would be updating at least some extensions to use the new constant names as well.  This would generally require prepending the following compatibility snippet to the main extension file:

// The names NS_FILE and NS_FILE_TALK are new in MediaWiki v1.14
if( !defined('NS_FILE') || !defined('NS_FILE_TALK') ) {
	define('NS_FILE', NS_IMAGE);
	define('NS_FILE_TALK', NS_IMAGE_TALK);
}
2008-11-27 22:36:25 +00:00
Brion Vibber
7c130df66f Back out r41786 for now "(bug 9226) Fetch restrictions properly on export"
Per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/41786#c121:

Issues:

   1. Restriction fetches may not be synchronous with original start in a long-running export
   2. Looks like this adds an SQL query to slave for every single page
   3. In case of timed-out DB connections or a dying slave, this might break a long-running dump process
2008-10-13 00:08:44 +00:00