Composer API
Class

Composer\IO\BufferIO

class BufferIO extends ConsoleIO

Methods

array getAuthentications()

Get all authentication information entered.

from BaseIO
bool hasAuthentication(string $repositoryName)

Verify if the repository has a authentication information.

from BaseIO
array getAuthentication(string $repositoryName)

Get the username and password of repository.

from BaseIO
setAuthentication(string $repositoryName, string $username, string $password = null)

Set the authentication information for the repository.

from BaseIO
loadConfiguration(Config $config)

Loads authentications from a config instance

from BaseIO
null emergency(string $message, array $context = array())

System is unusable.

from BaseIO
null alert(string $message, array $context = array())

Action must be taken immediately.

from BaseIO
null critical(string $message, array $context = array())

Critical conditions.

from BaseIO
null error(string $message, array $context = array())

Runtime errors that do not require immediate action but should typically be logged and monitored.

from BaseIO
null warning(string $message, array $context = array())

Exceptional occurrences that are not errors.

from BaseIO
null notice(string $message, array $context = array())

Normal but significant events.

from BaseIO
null info(string $message, array $context = array())

Interesting events.

from BaseIO
null debug(string $message, array $context = array())

Detailed debug information.

from BaseIO
null log(mixed $level, string $message, array $context = array())

Logs with an arbitrary level.

from BaseIO
__construct(string $input = '', int $verbosity = StreamOutput::VERBOSITY_NORMAL, OutputFormatterInterface $formatter = null)

enableDebugging(float $startTime)

from ConsoleIO
bool isInteractive()

Is this input means interactive?

from ConsoleIO
bool isDecorated()

Is this output decorated?

from ConsoleIO
bool isVerbose()

Is this output verbose?

from ConsoleIO
bool isVeryVerbose()

Is the output very verbose?

from ConsoleIO
bool isDebug()

Is the output in debug verbosity?

from ConsoleIO
write(string|array $messages, bool $newline = true, int $verbosity = self::NORMAL)

Writes a message to the output.

from ConsoleIO
writeError(string|array $messages, bool $newline = true, int $verbosity = self::NORMAL)

Writes a message to the error output.

from ConsoleIO
overwrite(string|array $messages, bool $newline = true, int $size = null, int $verbosity = self::NORMAL)

Overwrites a previous message to the output.

from ConsoleIO
overwriteError(string|array $messages, bool $newline = true, int $size = null, int $verbosity = self::NORMAL)

Overwrites a previous message to the error output.

from ConsoleIO
string ask(string|array $question, string $default = null)

Asks a question to the user.

from ConsoleIO
bool askConfirmation(string|array $question, bool $default = true)

Asks a confirmation to the user.

from ConsoleIO
mixed askAndValidate(string|array $question, callback $validator, null|int $attempts = null, mixed $default = null)

Asks for a value and validates the response.

from ConsoleIO
string askAndHideAnswer(string $question)

Asks a question to the user and hide the answer.

from ConsoleIO
int|string|array select(string|array $question, array $choices, bool|string $default, bool|int $attempts = false, string $errorMessage = 'Value "%s" is invalid', bool $multiselect = false)

Asks the user to select a value.

from ConsoleIO
getOutput()

Details

in BaseIO at line 27
public array getAuthentications()

Get all authentication information entered.

Return Value

array The map of authentication data

in BaseIO at line 35
public bool hasAuthentication(string $repositoryName)

Verify if the repository has a authentication information.

Parameters

string $repositoryName The unique name of repository

Return Value

bool

in BaseIO at line 43
public array getAuthentication(string $repositoryName)

Get the username and password of repository.

Parameters

string $repositoryName The unique name of repository

Return Value

array The 'username' and 'password'

in BaseIO at line 55
public setAuthentication(string $repositoryName, string $username, string $password = null)

Set the authentication information for the repository.

Parameters

string $repositoryName The unique name of repository
string $username The username
string $password The password

in BaseIO at line 88
public loadConfiguration(Config $config)

Loads authentications from a config instance

Parameters

Config $config

in BaseIO at line 128
public null emergency(string $message, array $context = array())

System is unusable.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 143
public null alert(string $message, array $context = array())

Action must be taken immediately.

Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 157
public null critical(string $message, array $context = array())

Critical conditions.

Example: Application component unavailable, unexpected exception.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 170
public null error(string $message, array $context = array())

Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 185
public null warning(string $message, array $context = array())

Exceptional occurrences that are not errors.

Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 197
public null notice(string $message, array $context = array())

Normal but significant events.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 211
public null info(string $message, array $context = array())

Interesting events.

Example: User logs in, SQL logs.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 223
public null debug(string $message, array $context = array())

Detailed debug information.

Parameters

string $message
array $context

Return Value

null

in BaseIO at line 236
public null log(mixed $level, string $message, array $context = array())

Logs with an arbitrary level.

Parameters

mixed $level
string $message
array $context

Return Value

null

at line 30
public __construct(string $input = '', int $verbosity = StreamOutput::VERBOSITY_NORMAL, OutputFormatterInterface $formatter = null)

Parameters

string $input The input instance
int $verbosity
OutputFormatterInterface $formatter

in ConsoleIO at line 70
public enableDebugging(float $startTime)

Parameters

float $startTime

in ConsoleIO at line 78
public bool isInteractive()

Is this input means interactive?

Return Value

bool

in ConsoleIO at line 86
public bool isDecorated()

Is this output decorated?

Return Value

bool

in ConsoleIO at line 94
public bool isVerbose()

Is this output verbose?

Return Value

bool

in ConsoleIO at line 102
public bool isVeryVerbose()

Is the output very verbose?

Return Value

bool

in ConsoleIO at line 110
public bool isDebug()

Is the output in debug verbosity?

Return Value

bool

in ConsoleIO at line 118
public write(string|array $messages, bool $newline = true, int $verbosity = self::NORMAL)

Writes a message to the output.

Parameters

string|array $messages The message as an array of lines or a single string
bool $newline Whether to add a newline or not
int $verbosity Verbosity level from the VERBOSITY_* constants

in ConsoleIO at line 126
public writeError(string|array $messages, bool $newline = true, int $verbosity = self::NORMAL)

Writes a message to the error output.

Parameters

string|array $messages The message as an array of lines or a single string
bool $newline Whether to add a newline or not
int $verbosity Verbosity level from the VERBOSITY_* constants

in ConsoleIO at line 173
public overwrite(string|array $messages, bool $newline = true, int $size = null, int $verbosity = self::NORMAL)

Overwrites a previous message to the output.

Parameters

string|array $messages The message as an array of lines or a single string
bool $newline Whether to add a newline or not
int $size The size of line
int $verbosity Verbosity level from the VERBOSITY_* constants

in ConsoleIO at line 181
public overwriteError(string|array $messages, bool $newline = true, int $size = null, int $verbosity = self::NORMAL)

Overwrites a previous message to the error output.

Parameters

string|array $messages The message as an array of lines or a single string
bool $newline Whether to add a newline or not
int $size The size of line
int $verbosity Verbosity level from the VERBOSITY_* constants

in ConsoleIO at line 231
public string ask(string|array $question, string $default = null)

Asks a question to the user.

Parameters

string|array $question The question to ask
string $default The default answer if none is given by the user

Return Value

string The user answer

Exceptions

RuntimeException If there is no data to read in the input stream

in ConsoleIO at line 243
public bool askConfirmation(string|array $question, bool $default = true)

Asks a confirmation to the user.

The question will be asked until the user answers by nothing, yes, or no.

Parameters

string|array $question The question to ask
bool $default The default answer if the user enters nothing

Return Value

bool true if the user has confirmed, false otherwise

in ConsoleIO at line 255
public mixed askAndValidate(string|array $question, callback $validator, null|int $attempts = null, mixed $default = null)

Asks for a value and validates the response.

The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.

Parameters

string|array $question The question to ask
callback $validator A PHP callback
null|int $attempts Max number of times to ask before giving up (default of null means infinite)
mixed $default The default answer if none is given by the user

Return Value

mixed

Exceptions

Exception When any of the validators return an error

in ConsoleIO at line 269
public string askAndHideAnswer(string $question)

Asks a question to the user and hide the answer.

Parameters

string $question The question to ask

Return Value

string The answer

in ConsoleIO at line 279
public int|string|array select(string|array $question, array $choices, bool|string $default, bool|int $attempts = false, string $errorMessage = 'Value "%s" is invalid', bool $multiselect = false)

Asks the user to select a value.

Parameters

string|array $question The question to ask
array $choices List of choices to pick from
bool|string $default The default answer if the user enters nothing
bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite)
string $errorMessage Message which will be shown if invalid value from choice list would be picked
bool $multiselect Select more than one value separated by comma

Return Value

int|string|array The selected value or values (the key of the choices array)

Exceptions

InvalidArgumentException

at line 40
public getOutput()