Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
[lhc/web/wiklou.git] / includes / SiteConfiguration.php
index 2d1d961..6bd179a 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  */
 
+use MediaWiki\Shell\Shell;
+
 /**
  * This is a class for holding configuration settings, particularly for
  * multi-wiki sites.
@@ -546,19 +548,21 @@ class SiteConfiguration {
                        } else {
                                $this->cfgCache[$wiki] = [];
                        }
-                       $retVal = 1;
-                       $cmd = wfShellWikiCmd(
+                       $result = Shell::makeScriptCommand(
                                "$IP/maintenance/getConfiguration.php",
                                [
                                        '--wiki', $wiki,
                                        '--settings', implode( ' ', $settings ),
-                                       '--format', 'PHP'
+                                       '--format', 'PHP',
                                ]
-                       );
-                       // ulimit5.sh breaks this call
-                       $data = trim( wfShellExec( $cmd, $retVal, [], [ 'memory' => 0, 'filesize' => 0 ] ) );
-                       if ( $retVal != 0 || !strlen( $data ) ) {
-                               throw new MWException( "Failed to run getConfiguration.php." );
+                       )
+                               // limit.sh breaks this call
+                               ->limits( [ 'memory' => 0, 'filesize' => 0 ] )
+                               ->execute();
+
+                       $data = trim( $result->getStdout() );
+                       if ( $result->getExitCode() != 0 || !strlen( $data ) ) {
+                               throw new MWException( "Failed to run getConfiguration.php: {$result->getStdout()}" );
                        }
                        $res = unserialize( $data );
                        if ( !is_array( $res ) ) {