Fix regression caused by r62087 which failed to insert rows into the image table...
[lhc/web/wiklou.git] / maintenance / dumpSisterSites.php
index 5b397b7..75b7a00 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( "Maintenance.php" );
+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 class DumpSisterSites extends Maintenance {
        public function __construct() {
@@ -42,13 +42,12 @@ class DumpSisterSites extends Maintenance {
                        ),
                        __METHOD__ );
 
-               while( $row = $dbr->fetchObject( $result ) ) {
+               foreach ( $result as $row ) {
                        $title = Title::makeTitle( $row->page_namespace, $row->page_title );
                        $url = $title->getFullUrl();
                        $text = $title->getPrefixedText();
                        $this->output( "$url $text\n" );
                }
-               $dbr->freeResult( $result );
        }
 }