* MessageBlobStore::insertMessageBlob() (deprecated in 1.27) was removed.
* The global function wfBCP47 was renamed to LanguageCode::bcp47.
* The global function wfBCP47 is now deprecated.
+* The global function wfCountDown() is now deprecated in favor of
+ Maintenance::countDown().
== Compatibility ==
MediaWiki 1.31 requires PHP 5.5.9 or later. There is experimental support for
* Count down from $seconds to zero on the terminal, with a one-second pause
* between showing each number. For use in command-line scripts.
*
+ * @deprecated since 1.31, use Maintenance::countDown()
+ *
* @codeCoverageIgnore
* @param int $seconds
*/
return $title;
}
+ /**
+ * Count down from $seconds to zero on the terminal, with a one-second pause
+ * between showing each number. If the maintenance script is in quiet mode,
+ * this function does nothing.
+ *
+ * @since 1.31
+ *
+ * @codeCoverageIgnore
+ * @param int $seconds
+ */
+ protected function countDown( $seconds ) {
+ if ( $this->isQuiet() ) {
+ return;
+ }
+ for ( $i = $seconds; $i >= 0; $i-- ) {
+ if ( $i != $seconds ) {
+ $this->output( str_repeat( "\x08", strlen( $i + 1 ) ) );
+ }
+ $this->output( $i );
+ if ( $i ) {
+ sleep( 1 );
+ }
+ }
+ $this->output( "\n" );
+ }
+
/**
* Wrapper for posix_isatty()
* We default as considering stdin a tty (for nice readline methods)
$this->output( "\n" );
$this->output( "Abort with control-c in the next five seconds "
. "(skip this countdown with --nowarn) ... " );
- wfCountDown( 5 );
+ $this->countDown( 5 );
}
// We list user by user_id from one of the replica DBs
$this->compatChecks();
} else {
$this->output( "Skipping compatibility checks, proceed at your own risk (Ctrl+C to abort)\n" );
- wfCountDown( 5 );
+ $this->countDown( 5 );
}
// Check external dependencies are up to date
if ( !$this->hasOption( 'quick' ) ) {
$this->output( "Abort with control-c in the next five seconds "
. "(skip this countdown with --quick) ... " );
- wfCountDown( 5 );
+ $this->countDown( 5 );
}
$time1 = microtime( true );