Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/89775
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 --- D scripts/cli.inc 1 file changed, 0 insertions(+), 84 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/75/89775/1 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: newchange Gerrit-Change-Id: I8a50857208c949424794607b76d958cb16d2a6b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits