r68513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68512‎ | r68513 | r68514 >
Date:12:44, 24 June 2010
Author:platonides
Status:ok
Tags:
Comment:
Follow up r54225. DumpRenderer::handleRevision needs to be public in order to be called from WikiImporter.
Follow up r66267. Make WikiImporter use isset instead of is_callable, so errors like the above aren't silently ignored..
Remove wrong $this->stderr
Modified paths:
  • /trunk/phase3/includes/ImportXMLReader.php (modified) (history)
  • /trunk/phase3/maintenance/renderDump.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/renderDump.php
@@ -58,7 +58,7 @@
5959 * Callback function for each revision, turn into HTML and save
6060 * @param $rev Revision
6161 */
62 - private function handleRevision( $rev ) {
 62+ public function handleRevision( $rev ) {
6363 $title = $rev->getTitle();
6464 if ( !$title ) {
6565 $this->error( "Got bogus revision with null title!" );
@@ -73,7 +73,7 @@
7474 $this->outputDirectory,
7575 $this->count,
7676 $sanitized );
77 - $this->output( sprintf( $this->stderr, "%s\n", $filename, $display ) );
 77+ $this->output( sprintf( "%s\n", $filename, $display ) );
7878
7979 // fixme (what?)
8080 $user = new User();
Index: trunk/phase3/includes/ImportXMLReader.php
@@ -191,7 +191,7 @@
192192 * @param $title Title
193193 */
194194 function pageCallback( $title ) {
195 - if( is_callable( $this->mPageCallback ) ) {
 195+ if( isset( $this->mPageCallback ) ) {
196196 call_user_func( $this->mPageCallback, $title );
197197 }
198198 }
@@ -204,7 +204,7 @@
205205 * @param $successCount Int: number of revisions for which callback returned true
206206 */
207207 private function pageOutCallback( $title, $origTitle, $revisionCount, $successCount ) {
208 - if( is_callable( $this->mPageOutCallback ) ) {
 208+ if( isset( $this->mPageOutCallback ) ) {
209209 call_user_func_array( $this->mPageOutCallback,
210210 array( $title, $origTitle, $revisionCount, $successCount ) );
211211 }
@@ -215,7 +215,7 @@
216216 * @param $revision A WikiRevision object
217217 */
218218 private function revisionCallback( $revision ) {
219 - if ( is_callable( $this->mRevisionCallback ) ) {
 219+ if ( isset( $this->mRevisionCallback ) ) {
220220 return call_user_func_array( $this->mRevisionCallback,
221221 array( $revision, $this ) );
222222 } else {
@@ -228,7 +228,7 @@
229229 * @param $revision A WikiRevision object
230230 */
231231 private function logItemCallback( $revision ) {
232 - if ( is_callable( $this->mLogItemCallback ) ) {
 232+ if ( isset( $this->mLogItemCallback ) ) {
233233 return call_user_func_array( $this->mLogItemCallback,
234234 array( $revision, $this ) );
235235 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r54225Merge maintenance-work branch (now with less errors!):...demon19:35, 2 August 2009
r66267Rewrite of XML Dump Processing:...werdna13:28, 12 May 2010

Status & tagging log