doc fix
[lhc/web/wiklou.git] / includes / Export.php
index edea8ae..88a83d9 100644 (file)
@@ -14,7 +14,7 @@
 #
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 # http://www.gnu.org/copyleft/gpl.html
 /**
  *
@@ -23,7 +23,6 @@
  */
 
 /** */
-require_once( 'Revision.php' );
 
 define( 'MW_EXPORT_FULL',     0 );
 define( 'MW_EXPORT_CURRENT',  1 );
@@ -187,8 +186,7 @@ class WikiExporter {
                }
                if( $cond == '' ) {
                        // Optimization hack for full-database dump
-                       $pageindex = 'FORCE INDEX (PRIMARY)';
-                       $revindex = 'FORCE INDEX (PRIMARY)';
+                       $revindex = $pageindex = $this->db->useIndexClause("PRIMARY");
                        $straight = ' /*! STRAIGHT_JOIN */ ';
                } else {
                        $pageindex = '';
@@ -397,7 +395,7 @@ class XmlDumpWriter {
                $ts = wfTimestamp( TS_ISO_8601, $row->rev_timestamp );
                $out .= "      " . wfElement( 'timestamp', null, $ts ) . "\n";
 
-               if( $row->rev_deleted & MW_REV_DELETED_USER ) {
+               if( $row->rev_deleted & Revision::MW_REV_DELETED_USER ) {
                        $out .= "      " . wfElement( 'contributor', array( 'deleted' => 'deleted' ) ) . "\n";
                } else {
                        $out .= "      <contributor>\n";
@@ -413,13 +411,13 @@ class XmlDumpWriter {
                if( $row->rev_minor_edit ) {
                        $out .=  "      <minor/>\n";
                }
-               if( $row->rev_deleted & MW_REV_DELETED_COMMENT ) {
+               if( $row->rev_deleted & Revision::MW_REV_DELETED_COMMENT ) {
                        $out .= "      " . wfElement( 'comment', array( 'deleted' => 'deleted' ) ) . "\n";
                } elseif( $row->rev_comment != '' ) {
                        $out .= "      " . wfElementClean( 'comment', null, strval( $row->rev_comment ) ) . "\n";
                }
 
-               if( $row->rev_deleted & MW_REV_DELETED_TEXT ) {
+               if( $row->rev_deleted & Revision::MW_REV_DELETED_TEXT ) {
                        $out .= "      " . wfElement( 'text', array( 'deleted' => 'deleted' ) ) . "\n";
                } elseif( isset( $row->old_text ) ) {
                        // Raw text from the database may have invalid chars
@@ -529,6 +527,9 @@ class DumpBZip2Output extends DumpPipeOutput {
 class Dump7ZipOutput extends DumpPipeOutput {
        function Dump7ZipOutput( $file ) {
                $command = "7za a -bd -si " . wfEscapeShellArg( $file );
+               // Suppress annoying useless crap from p7zip
+               // Unfortunately this could suppress real error messages too
+               $command .= " >/dev/null 2>&1";
                parent::DumpPipeOutput( $command );
        }
 }
@@ -633,7 +634,7 @@ class DumpNamespaceFilter extends DumpFilter {
                                $ns = intval( $key );
                                $this->namespaces[$ns] = true;
                        } else {
-                               wfDie( "Unrecognized namespace key '$key'\n" );
+                               throw new MWException( "Unrecognized namespace key '$key'\n" );
                        }
                }
        }