* @file
*/
+use MediaWiki\Shell\Shell;
+
/**
* This is a class for holding configuration settings, particularly for
* multi-wiki sites.
} 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 ) ) {