jenkins-bot has submitted this change and it was merged.
Change subject: Get rid of cli.php
......................................................................
Get rid of cli.php
Over the past week, all command line scripts have started using
Maintenance, and this code is no longer in use.
Bug: 55517
Change-Id: I8a50857208c949424794607b76d958cb16d2a6b1
---
M Translate.php
D scripts/cli.inc
2 files changed, 1 insertion(+), 95 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Translate.php b/Translate.php
index ef2829a..8a64930 100644
--- a/Translate.php
+++ b/Translate.php
@@ -17,7 +17,7 @@
/**
* Version number used in extension credits and in other places where needed.
*/
-define( 'TRANSLATE_VERSION', '2013-10-07' );
+define( 'TRANSLATE_VERSION', '2013-10-15' );
/**
* Extension credits properties.
@@ -628,16 +628,6 @@
$wgTranslateTestUsers = array();
# </source>
-
-/** @cond cli_support */
-if ( !defined( 'TRANSLATE_CLI' ) ) {
- function STDOUT() {
- }
-
- function STDERR() {
- }
-}
-/** @endcond */
/**
* Helper function for adding namespace for message groups.
diff --git a/scripts/cli.inc b/scripts/cli.inc
deleted file mode 100644
index e44c158..0000000
--- a/scripts/cli.inc
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * File to perform initialisation to setup command line scripts properly for
- * translate extension.
- *
- * @author Niklas Laxstrom
- * @copyright Copyright © 2008-2010, Niklas Laxström
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
2.0 or later
- * @file
- * @defgroup Script Command line scripts
- * @todo Migrate cli scripts to use the new Maintenance class.
- */
-
-///@{
-// Standard boilerplate to define $IP
-if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
- $IP = getenv( 'MW_INSTALL_PATH' );
-} else {
- $dir = __DIR__;
- $IP = "$dir/../../..";
-}
-define( 'TRANSLATE_CLI', 1 );
-require_once "$IP/maintenance/commandLine.inc";
-///@}
-
-/**
- * Output a message to command line (if available).
- * @param $str \string The message.
- * @param $channel \mixed Channel identifier. Consecutive messages to
- * the same channel do not get automatic newlines between then,
- * @param $force \bool Do not suppress output even if script was run
- * with --quiet
- */
-function STDOUT( $str, $channel = null, $force = false ) {
- // @codingStandardsIgnoreStart Globals should have prefix "wg".
- global $options;
- // @codingStandardsIgnoreEnd
-
- if ( isset( $options['quiet'] ) && !$force ) {
- return;
- }
-
- static $lastChannel = null;
- static $lineStart = true;
-
- if ( $channel !== null && ( $lineStart || $channel === $lastChannel ) )
{
- fwrite( STDOUT, $str );
- } elseif ( $str === false ) {
- // Cleanup
- if ( !$lineStart ) {
- fwrite( STDOUT, "\n" );
- }
-
- return;
- } else {
- if ( !$lineStart ) {
- fwrite( STDOUT, "\n" );
- }
-
- fwrite( STDOUT, $str );
- }
-
- $lineStart = false;
- if ( $channel === null ) {
- fwrite( STDOUT, "\n" );
- $lineStart = true;
- }
-
- $lastChannel = $channel;
-}
-
-/**
- * Output a warning message to command line (if available).
- * @see STDOUT
- * @param $message string
- * @param $channel mixed|string
- */
-function STDERR( $message, $channel = null ) {
- STDOUT( $message, $channel, true );
-}
-
-///@{
-register_shutdown_function( 'STDOUT', false );
-///@}
--
To view, visit https://gerrit.wikimedia.org/r/89775
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8a50857208c949424794607b76d958cb16d2a6b1
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits