120 $args = func_get_args();
121 if ( count(
$args ) === 1 && is_array( reset(
$args ) ) ) {
127 ->getShellCommandFactory()
139 static $disabled =
null;
141 if ( is_null( $disabled ) ) {
142 if ( !function_exists(
'proc_open' ) ) {
143 wfDebug(
"proc_open() is disabled\n" );
165 $args = func_get_args();
166 if ( count(
$args ) === 1 && is_array( reset(
$args ) ) ) {
174 foreach (
$args as $arg ) {
175 if ( $arg ===
null ) {
192 $tokens = preg_split(
'/(\\\\*")/', $arg, -1, PREG_SPLIT_DELIM_CAPTURE );
195 foreach (
$tokens as $token ) {
196 if ( $iteration % 2 == 1 ) {
198 $arg .= str_replace(
'\\',
'\\\\', substr( $token, 0, -1 ) ) .
'\\"';
199 } elseif ( $iteration % 4 == 2 ) {
201 $arg .= str_replace(
'^',
'^^', $token );
211 if ( preg_match(
'/^(.*?)(\\\\+)$/', $arg, $m ) ) {
212 $arg = $m[1] . str_replace(
'\\',
'\\\\', $m[2] );
216 $retVal .=
'"' . $arg .
'"';
218 $retVal .= escapeshellarg( $arg );
240 Hooks::run(
'wfShellWikiCmd', [ &$script, &$parameters, &
$options ] );
242 if ( isset(
$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.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options