Elgg  Version master
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Elgg\Cli\BaseCommand Class Reference

Adds interaction to a console command. More...

Inheritance diagram for Elgg\Cli\BaseCommand:
Elgg\Cli\Command Elgg\Cli\InstallCommand Elgg\Cli\UpgradeCommand Elgg\Cli\CacheClearCommand Elgg\Cli\CacheInvalidateCommand Elgg\Cli\CachePurgeCommand Elgg\Cli\CronCommand Elgg\Cli\DatabaseSeedCommand Elgg\Cli\DatabaseSeedersCommand Elgg\Cli\DatabaseUnseedCommand Elgg\Cli\PluginsActivateCommand Elgg\Cli\PluginsDeactivateCommand Elgg\Cli\PluginsListCommand Elgg\Cli\UpgradeBatchCommand Elgg\Cli\UpgradeListCommand

Public Member Functions

 ask ($question, $default=null, $hidden=false, $required=true)
 Ask a question. More...
 
 dump ($data)
 Dump a variable. More...
 
 write ($messages, $level=LogLevel::INFO)
 Write messages to output buffer. More...
 
 error ($message)
 Print an error. More...
 
 notice ($message)
 Print a notce. More...
 
 option ($name)
 Returns option value. More...
 
 argument ($name)
 Returns argument value. More...
 
 assertNotEmpty ($answer)
 Question validator for required user response. More...
 

Public Attributes

const DEFAULT_VERBOSITY = OutputInterface::VERBOSITY_NORMAL
 

Protected Member Functions

 dumpRegisters ()
 Dump and output system and error messages. More...
 

Protected Attributes

 $input
 
 $output
 

Detailed Description

Adds interaction to a console command.

Definition at line 18 of file BaseCommand.php.

Member Function Documentation

Elgg\Cli\BaseCommand::argument (   $name)

Returns argument value.

Parameters
string$nameArgument name
Returns
mixed

Definition at line 157 of file BaseCommand.php.

Elgg\Cli\BaseCommand::ask (   $question,
  $default = null,
  $hidden = false,
  $required = true 
)

Ask a question.

Parameters
string$questionQuestion to ask
mixed$defaultDefault value
bool$hiddenHide response
bool$requiredUser input is required
Returns
mixed

Definition at line 44 of file BaseCommand.php.

Elgg\Cli\BaseCommand::assertNotEmpty (   $answer)

Question validator for required user response.

Parameters
mixed$answerUser answer
Returns
bool
Exceptions
RuntimeException

Definition at line 169 of file BaseCommand.php.

Elgg\Cli\BaseCommand::dump (   $data)
final

Dump a variable.

Parameters
mixed$dataData to dump
Returns
void

Definition at line 81 of file BaseCommand.php.

Elgg\Cli\BaseCommand::dumpRegisters ( )
finalprotected

Dump and output system and error messages.

Returns
void

Definition at line 181 of file BaseCommand.php.

Elgg\Cli\BaseCommand::error (   $message)

Print an error.

Parameters
string$messageError message
Returns
void

Definition at line 124 of file BaseCommand.php.

Elgg\Cli\BaseCommand::notice (   $message)

Print a notce.

Parameters
string$messageError message
Returns
void

Definition at line 135 of file BaseCommand.php.

Elgg\Cli\BaseCommand::option (   $name)

Returns option value.

Parameters
string$nameOption name
Returns
mixed

Definition at line 146 of file BaseCommand.php.

Elgg\Cli\BaseCommand::write (   $messages,
  $level = LogLevel::INFO 
)
final

Write messages to output buffer.

Parameters
string | array$messagesData or messages
string$levelLogging level/servity
Returns
void

Definition at line 93 of file BaseCommand.php.

Member Data Documentation

Elgg\Cli\BaseCommand::$input
protected

Definition at line 27 of file BaseCommand.php.

Elgg\Cli\BaseCommand::$output
protected

Definition at line 32 of file BaseCommand.php.

const Elgg\Cli\BaseCommand::DEFAULT_VERBOSITY = OutputInterface::VERBOSITY_NORMAL

Definition at line 22 of file BaseCommand.php.


The documentation for this class was generated from the following file: