mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-12-01 03:06:30 +00:00
Merge "Remove implode erroneously left"
This commit is contained in:
commit
699ce5b901
|
@ -85,8 +85,6 @@ class GenerateFancyCaptchas extends Maintenance {
|
||||||
$this->error( "Could not create temp directory.\n", 1 );
|
$this->error( "Could not create temp directory.\n", 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
$e = null; // exception
|
|
||||||
try {
|
|
||||||
$captchaScript = 'captcha.py';
|
$captchaScript = 'captcha.py';
|
||||||
|
|
||||||
if ( $this->hasOption( 'oldcaptcha' ) ) {
|
if ( $this->hasOption( 'oldcaptcha' ) ) {
|
||||||
|
@ -173,6 +171,7 @@ class GenerateFancyCaptchas extends Maintenance {
|
||||||
|
|
||||||
$storeTime += microtime( true );
|
$storeTime += microtime( true );
|
||||||
|
|
||||||
|
$storeSuceeded = true;
|
||||||
if ( $ret->isOK() ) {
|
if ( $ret->isOK() ) {
|
||||||
$this->output( " Done.\n" );
|
$this->output( " Done.\n" );
|
||||||
$this->output(
|
$this->output(
|
||||||
|
@ -182,22 +181,35 @@ class GenerateFancyCaptchas extends Maintenance {
|
||||||
$storeTime
|
$storeTime
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
if ( !$ret->isGood() ) {
|
||||||
|
$this->output(
|
||||||
|
"Non fatal errors:\n" .
|
||||||
|
Status::wrap( $ret )->getWikiText( null, null, 'en' ) .
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
if ( $ret->failCount ) {
|
if ( $ret->failCount ) {
|
||||||
$this->output( sprintf( "\nFailed to copy %d captchas\n", $ret->failCount ) );
|
$storeSuceeded = false;
|
||||||
|
$this->error( sprintf( "\nFailed to copy %d captchas\n", $ret->failCount ) );
|
||||||
}
|
}
|
||||||
if ( $ret->successCount + $ret->failCount !== $captchasGenerated ) {
|
if ( $ret->successCount + $ret->failCount !== $captchasGenerated ) {
|
||||||
$this->output(
|
$storeSuceeded = false;
|
||||||
|
$this->error(
|
||||||
sprintf( "Internal error: captchasGenerated: %d, successCount: %d, failCount: %d\n",
|
sprintf( "Internal error: captchasGenerated: %d, successCount: %d, failCount: %d\n",
|
||||||
$captchasGenerated, $ret->successCount, $ret->failCount
|
$captchasGenerated, $ret->successCount, $ret->failCount
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$storeSuceeded = false;
|
||||||
$this->output( "Errored.\n" );
|
$this->output( "Errored.\n" );
|
||||||
$this->output( implode( "\n", Status::wrap( $ret )->getWikiText( null, null, 'en' ) ) );
|
$this->error(
|
||||||
|
Status::wrap( $ret )->getWikiText( null, null, 'en' ) .
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $deleteOldCaptchas ) {
|
if ( $storeSuceeded && $deleteOldCaptchas ) {
|
||||||
$numOriginalFiles = count( $filesToDelete );
|
$numOriginalFiles = count( $filesToDelete );
|
||||||
$this->output( "Deleting {$numOriginalFiles} old captchas...\n" );
|
$this->output( "Deleting {$numOriginalFiles} old captchas...\n" );
|
||||||
$deleteTime = -microtime( true );
|
$deleteTime = -microtime( true );
|
||||||
|
@ -205,7 +217,6 @@ class GenerateFancyCaptchas extends Maintenance {
|
||||||
|
|
||||||
$deleteTime += microtime( true );
|
$deleteTime += microtime( true );
|
||||||
if ( $ret->isOK() ) {
|
if ( $ret->isOK() ) {
|
||||||
|
|
||||||
$this->output( "Done.\n" );
|
$this->output( "Done.\n" );
|
||||||
$this->output(
|
$this->output(
|
||||||
sprintf(
|
sprintf(
|
||||||
|
@ -214,17 +225,22 @@ class GenerateFancyCaptchas extends Maintenance {
|
||||||
$deleteTime
|
$deleteTime
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
if ( !$ret->isGood() ) {
|
||||||
|
$this->output(
|
||||||
|
"Non fatal errors:\n" .
|
||||||
|
Status::wrap( $ret )->getWikiText( null, null, 'en' ) .
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->output( "Errored.\n" );
|
$this->output( "Errored.\n" );
|
||||||
$this->output( implode( "\n", Status::wrap( $ret )->getWikiText( null, null, 'en' ) ) );
|
$this->error(
|
||||||
|
Status::wrap( $ret )->getWikiText( null, null, 'en' ) .
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch ( Exception $e ) {
|
|
||||||
wfRecursiveRemoveDir( $tmpDir );
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->output( "Removing temporary files..." );
|
$this->output( "Removing temporary files..." );
|
||||||
wfRecursiveRemoveDir( $tmpDir );
|
wfRecursiveRemoveDir( $tmpDir );
|
||||||
$this->output( " Done.\n" );
|
$this->output( " Done.\n" );
|
||||||
|
|
Loading…
Reference in a new issue