Go to the documentation of this file.
120 if ( count( $commands ) === 1 && is_array( reset( $commands ) ) ) {
123 $commands = reset( $commands );
126 ->getShellCommandFactory()
129 return $command->params( $commands );
138 static $disabled =
null;
140 if ( is_null( $disabled ) ) {
141 if ( !function_exists(
'proc_open' ) ) {
142 wfDebug(
"proc_open() is disabled\n" );
164 if ( count(
$args ) === 1 && is_array( reset(
$args ) ) ) {
172 foreach (
$args as $arg ) {
173 if ( $arg ===
null ) {
190 $tokens = preg_split(
'/(\\\\*")/', $arg, -1, PREG_SPLIT_DELIM_CAPTURE );
193 foreach ( $tokens as $token ) {
194 if ( $iteration % 2 == 1 ) {
196 $arg .= str_replace(
'\\',
'\\\\', substr( $token, 0, -1 ) ) .
'\\"';
197 } elseif ( $iteration % 4 == 2 ) {
199 $arg .= str_replace(
'^',
'^^', $token );
209 if ( preg_match(
'/^(.*?)(\\\\+)$/', $arg, $m ) ) {
210 $arg = $m[1] . str_replace(
'\\',
'\\\\', $m[2] );
214 $retVal .=
'"' . $arg .
'"';
216 $retVal .= escapeshellarg( $arg );
240 Hooks::run(
'wfShellWikiCmd', [ &$script, &$parameters, &$options ] );
242 if ( isset( $options[
'wrapper'] ) ) {
243 $cmd[] = $options[
'wrapper'];
248 ->params( $parameters )
249 ->restrict( self::RESTRICT_DEFAULT & ~self::NO_LOCALSETTINGS );
$wgPhpCli
Executable path of the PHP cli binary.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfIsWindows()
Check if the operating system is Windows.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.