Switch Installer to the new execution framework
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 25 Oct 2017 02:07:05 +0000 (19:07 -0700)
committerGergő Tisza <gtisza@wikimedia.org>
Wed, 4 Apr 2018 13:55:25 +0000 (13:55 +0000)
Change-Id: Id04ba0751ff94e9614852e351377405f65b6ea1c

includes/installer/Installer.php

index f5e12d6..7cfc617 100644 (file)
@@ -24,6 +24,7 @@
  * @ingroup Deployment
  */
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Shell\Shell;
 
 /**
  * This documentation group collects source code files with deployment functionality.
@@ -990,17 +991,17 @@ abstract class Installer {
                }
 
                # Get a list of available locales.
-               $ret = false;
-               $lines = wfShellExec( '/usr/bin/locale -a', $ret );
+               $result = Shell::command( '/usr/bin/locale', '-a' )
+                       ->execute();
 
-               if ( $ret ) {
+               if ( $result->getExitCode() != 0 ) {
                        return true;
                }
 
+               $lines = $result->getStdout();
                $lines = array_map( 'trim', explode( "\n", $lines ) );
                $candidatesByLocale = [];
                $candidatesByLang = [];
-
                foreach ( $lines as $line ) {
                        if ( $line === '' ) {
                                continue;