Folowup r77763, add documentation for $wgFooterIcons.
[lhc/web/wiklou.git] / includes / Export.php
index 2342817..bdb9d4a 100644 (file)
@@ -1,21 +1,27 @@
 <?php
-# Copyright (C) 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
-# http://www.mediawiki.org/
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# 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.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# http://www.gnu.org/copyleft/gpl.html
+/**
+ * Base classes for dumps and export
+ *
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * http://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 /**
  * @defgroup Dump Dump
@@ -161,7 +167,7 @@ class WikiExporter {
                WHERE page_id=rev_page AND $nothidden AND " . $cond ;
                $result = $this->db->query( $sql, __METHOD__ );
                $resultset = $this->db->resultObject( $result );
-               while( $row = $resultset->fetchObject() ) {
+               foreach ( $resultset as $row ) {
                        $this->author_list .= "<contributor>" .
                                "<username>" .
                                htmlentities( $row->rev_user_text )  .
@@ -300,7 +306,7 @@ class WikiExporter {
         */
        protected function outputPageStream( $resultset ) {
                $last = null;
-               while( $row = $resultset->fetchObject() ) {
+               foreach ( $resultset as $row ) {
                        if( is_null( $last ) ||
                                $last->page_namespace != $row->page_namespace ||
                                $last->page_title     != $row->page_title ) {
@@ -331,7 +337,7 @@ class WikiExporter {
        }
        
        protected function outputLogStream( $resultset ) {
-               while( $row = $resultset->fetchObject() ) {
+               foreach ( $resultset as $row ) {
                        $output = $this->writer->writeLogItem( $row );
                        $this->sink->writeLogItem( $row, $output );
                }
@@ -362,7 +368,7 @@ class XmlDumpWriter {
         * @return string
         */
        function openStream() {
-               global $wgContLanguageCode;
+               global $wgLanguageCode;
                $ver = $this->schemaVersion();
                return Xml::element( 'mediawiki', array(
                        'xmlns'              => "http://www.mediawiki.org/xml/export-$ver/",
@@ -370,7 +376,7 @@ class XmlDumpWriter {
                        'xsi:schemaLocation' => "http://www.mediawiki.org/xml/export-$ver/ " .
                                                "http://www.mediawiki.org/xml/export-$ver.xsd",
                        'version'            => $ver,
-                       'xml:lang'           => $wgContLanguageCode ),
+                       'xml:lang'           => $wgLanguageCode ),
                        null ) .
                        "\n" .
                        $this->siteInfo();