Process
in package
Process utility functions
Tags
Table of Contents
- escape() : string
- Escapes a string to be used as a shell argument.
- escapeShellCommand() : string
- Escapes an array of arguments that make up a shell command
- setEnv() : bool
- Makes putenv environment changes available in $_SERVER and $_ENV
Methods
escape()
Escapes a string to be used as a shell argument.
public
static escape(string $arg[, bool $meta = true ][, bool $module = false ]) : string
From https://github.com/johnstevenson/winbox-args MIT Licensed (c) John Stevenson john-stevenson@blueyonder.co.uk
Parameters
- $arg : string
-
The argument to be escaped
- $meta : bool = true
-
Additionally escape cmd.exe meta characters
- $module : bool = false
-
The argument is the module to invoke
Return values
string —The escaped argument
escapeShellCommand()
Escapes an array of arguments that make up a shell command
public
static escapeShellCommand(array<string|int, mixed> $args) : string
Parameters
- $args : array<string|int, mixed>
-
Argument list, with the module name first
Return values
string —The escaped command line
setEnv()
Makes putenv environment changes available in $_SERVER and $_ENV
public
static setEnv(string $name[, string|null $value = null ]) : bool
Parameters
- $name : string
- $value : string|null = null
-
A null value unsets the variable
Return values
bool —Whether the environment variable was set