mediawiki.test: Prevent "Error: expected" from going to the real console
[lhc/web/wiklou.git] / includes / Import.php
index eb2ca77..3ba4306 100644 (file)
@@ -376,12 +376,12 @@ class WikiImporter {
                $page->loadPageData( 'fromdbmaster' );
                $content = $page->getContent();
                $editInfo = $page->prepareContentForEdit( $content );
-
+               $countKey = 'title_' . $title->getPrefixedText();
                $countable = $page->isCountable( $editInfo );
-               $oldcountable = $this->countableCache['title_' . $title->getPrefixedText()];
-               if ( isset( $oldcountable ) && $countable != $oldcountable ) {
+               if ( array_key_exists( $countKey, $this->countableCache ) &&
+                       $countable != $this->countableCache[ $countKey ] ) {
                        DeferredUpdates::addUpdate( SiteStatsUpdate::factory( array(
-                               'articles' => ( (int)$countable - (int)$oldcountable )
+                               'articles' => ( (int)$countable - (int)$this->countableCache[ $countKey ] )
                        ) ) );
                }
 
@@ -477,7 +477,8 @@ class WikiImporter {
        /**
         * Retrieves the contents of the named attribute of the current element.
         * @param string $attr The name of the attribute
-        * @return string The value of the attribute or an empty string if it is not set in the current element.
+        * @return string The value of the attribute or an empty string if it is not set in the current
+        * element.
         */
        public function nodeAttribute( $attr ) {
                return $this->reader->getAttribute( $attr );
@@ -1740,7 +1741,7 @@ class WikiRevision {
 
                // @todo FIXME!
                $src = $this->getSrc();
-               $data = Http::get( $src );
+               $data = Http::get( $src, array(), __METHOD__ );
                if ( !$data ) {
                        wfDebug( "IMPORT: couldn't fetch source $src\n" );
                        fclose( $f );
@@ -1897,7 +1898,7 @@ class ImportStreamSource implements ImportSource {
                # quicker and sorts out user-agent problems which might
                # otherwise prevent importing from large sites, such
                # as the Wikimedia cluster, etc.
-               $data = Http::request( $method, $url, array( 'followRedirects' => true ) );
+               $data = Http::request( $method, $url, array( 'followRedirects' => true ), __METHOD__ );
                if ( $data !== false ) {
                        $file = tmpfile();
                        fwrite( $file, $data );