X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSiteConfiguration.php;h=6bd179a9daa2a60e3d8235f5a61f09f0791c4feb;hb=a9c02b13f646762e6d43ce8ff6fdeed07ae14ce6;hp=7a01a6575bbb3e91ab56fb5917e406da2e2c79f8;hpb=b95ca29602793f39191c06cd6941e3f32ab1bbb8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 7a01a6575b..6bd179a9da 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -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 ] ) ); - 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 ) ) {