Use getFileContents() instead of incorrect file system call to fetch file contents.
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 6 Jun 2013 07:34:30 +0000 (00:34 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 10 Jun 2013 17:10:40 +0000 (10:10 -0700)
Change-Id: I2b9be4165ae85c52ff9a9b68b9d71ec011a6c5b4

includes/Export.php

index a26e853..98de4c0 100644 (file)
@@ -824,10 +824,13 @@ class XmlDumpWriter {
                        $archiveName = '';
                }
                if ( $dumpContents ) {
+                       $be = $file->getRepo()->getBackend();
                        # Dump file as base64
                        # Uses only XML-safe characters, so does not need escaping
+                       # @TODO: too bad this loads the contents into memory (script might swap)
                        $contents = '      <contents encoding="base64">' .
-                               chunk_split( base64_encode( file_get_contents( $file->getPath() ) ) ) .
+                               chunk_split( base64_encode(
+                                       $be->getFileContents( array( 'src' => $file->getPath() ) ) ) ) .
                                "      </contents>\n";
                } else {
                        $contents = '';