\Composer\XdebugHandlerProcess

Provides utility functions to prepare a child process command-line and set environment variables in that process.

Summary

Methods
Properties
Constants
addColorOption()
escape()
supportsColor()
setEnv()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

addColorOption()

addColorOption(array  $args, string  $colorOption) : array

Returns an array of parameters, including a color option if required

A color option is needed because child process output is piped.

Parameters

array $args

The script parameters

string $colorOption

The long option to force color output

Returns

array

escape()

escape(string  $arg, boolean  $meta = true, boolean  $module = false) : string

Escapes a string to be used as a shell argument.

From https://github.com/johnstevenson/winbox-args MIT Licensed (c) John Stevenson john-stevenson@blueyonder.co.uk

Parameters

string $arg

The argument to be escaped

boolean $meta

Additionally escape cmd.exe meta characters

boolean $module

The argument is the module to invoke

Returns

string —

The escaped argument

supportsColor()

supportsColor(mixed  $output) : boolean

Returns true if the output stream supports colors

This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo terminals via named pipes, so we can only check the environment.

Parameters

mixed $output

A valid CLI output stream

Returns

boolean

setEnv()

setEnv(string  $name, string|false  $value = false) : boolean

Makes putenv environment changes available in $_SERVER

Parameters

string $name
string|false $value

A false value unsets the variable

Returns

boolean —

Whether the environment variable was set