class Console (View source)

Traits

Constants

private VERSION

Define Bow Framework version.

private HELP_TOPIC_ALIASES

Command aliases that share another topic's help body.

private HELP_TOPICS

Per-topic help bodies, keyed by command (or alias). The "gen" alias shares the "generate" body via the aliases map below.

Bodies use raw ANSI escape codes — they are pre-formatted templates rather than messages composed through Color::*.

private COMMAND

The command list

private ADD_ACTION

The action list

Methods

void
throwFailsCommand(string $message, string|null $command = null)

Throw fails command

__construct(Setting $setting)

Bow constructor.

static Console|null
getInstance()

Get the console instance

static void
register(string $command, callable|string $cb, string|null $description = null, string|null $help = null)

Add a custom order to the store from the web env This method work on web and cli env

void
bind(Loader $kernel)

Bind kernel

run()

Launch Bow task runner

mixed
call(string|null $command)

Calls a command

static Console
addCommand(string $command, callable $cb)

No description

Details

protected void throwFailsCommand(string $message, string|null $command = null)

Throw fails command

Parameters

string $message
string|null $command

Return Value

void

__construct(Setting $setting)

Bow constructor.

Parameters

Setting $setting

static Console|null getInstance()

Get the console instance

Return Value

Console|null

Exceptions

ConsoleException

static void register(string $command, callable|string $cb, string|null $description = null, string|null $help = null)

Add a custom order to the store from the web env This method work on web and cli env

Parameters

string $command

Command name (or base:action form)

callable|string $cb

Closure / function name / class string

string|null $description

One-liner shown in the global help index

string|null $help

Full body shown by php bow help <command>

Return Value

void

void bind(Loader $kernel)

Bind kernel

Parameters

Loader $kernel

Return Value

void

run()

Launch Bow task runner

mixed call(string|null $command)

Calls a command

Parameters

string|null $command

Return Value

mixed

Exceptions

ErrorException
Exception

static Console addCommand(string $command, callable $cb)

No description

Parameters

string $command
callable $cb

Return Value

Console