MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404906 )

Change subject: Convert Maintenance to the new shell framework
......................................................................

Convert Maintenance to the new shell framework

Change-Id: Ibec8a84071fdf061f9831b2964143d99464cd4cc
---
M maintenance/Maintenance.php
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/404906/1

diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index 861a613..c80d66b 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -25,6 +25,7 @@
 require_once __DIR__ . '/../includes/PHPVersionCheck.php';
 wfEntryPointCheck( 'cli' );
 
+use MediaWiki\Shell\Shell;
 use Wikimedia\Rdbms\DBReplicationWaitError;
 
 /**
@@ -1581,12 +1582,12 @@
                // something that can do the relevant syscalls. There are a few
                // options. Linux and Mac OS X both have "stty size" which does 
the
                // job directly.
-               $retval = false;
-               $size = wfShellExec( 'stty size', $retval );
-               if ( $retval !== 0 ) {
+               $result = Shell::command( 'stty', 'size' )
+                       ->execute();
+               if ( $result->getExitCode() !== 0 ) {
                        return $default;
                }
-               if ( !preg_match( '/^(\d+) (\d+)$/', $size, $m ) ) {
+               if ( !preg_match( '/^(\d+) (\d+)$/', $result->getStdout(), $m ) 
) {
                        return $default;
                }
                return [ intval( $m[2] ), intval( $m[1] ) ];

-- 
To view, visit https://gerrit.wikimedia.org/r/404906
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibec8a84071fdf061f9831b2964143d99464cd4cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to