class Application extends Application implements LoggerAwareInterface, ConfigAwareInterface (View source)

Our application object

Note: Implementing *AwareInterface here does NOT automatically cause that corresponding service to be injected into the Application. This is because the application object is created prior to the DI container. See DependencyInjection::injectApplicationServices() to add more services.

Traits

Properties

protected ConfigInterface $config from  ConfigAwareTrait
protected BootstrapManager|null $bootstrapManager
protected SiteAliasManager|null $aliasManager
protected RedispatchHook|null $redispatchHook
protected TildeExpansionHook|null $tildeExpansionHook
protected ServiceManager|null $serviceManager

Methods

$this
setConfig(ConfigInterface $config)

Set the config management object.

ConfigInterface
getConfig()

Get the config management object.

static string
configPrefix()

Any class that uses ConfigAwareTrait SHOULD override this method , and define a prefix for its configuration items. This is usually done in a base class. When used, this method should return a string that ends with a "."; see BaseTask::configPrefix().

static 
configClassIdentifier($classname)

No description

static 
configPostfix()

No description

static 
configure(string $key, mixed $value, ConfigInterface|null $config = null)

No description

mixed|null
getConfigValue(string $key, mixed|null $default = null)

No description

void
configureGlobalOptions()

Add global options to the Application and their default values to Config.

BootstrapManager|null
bootstrapManager()

No description

void
setBootstrapManager(BootstrapManager $bootstrapManager)

No description

SiteAliasManager|null
aliasManager()

No description

void
setAliasManager(SiteAliasManager|null $aliasManager)

No description

void
setRedispatchHook(RedispatchHook $redispatchHook)

No description

void
setTildeExpansionHook(TildeExpansionHook $tildeExpansionHook)

No description

void
setServiceManager(ServiceManager $serviceManager)

No description

string|false
getUri()

Return the framework uri selected by the user.

void
refineUriSelection($cwd)

If the user did not explicitly select a site URI, then pick an appropriate site from the cwd.

selectUri($cwd)

Select a URI to use for the site, based on directory or config.

Command
find($name)

No description

int
doRunCommand(Command $command, InputInterface $input, OutputInterface $output)

No description

RemoteCommandProxy
bootstrapAndFind(string $name)

Look up a command. Bootstrap further if necessary.

checkObsolete($command)

If a command is annotated @obsolete, then we will throw an exception immediately; the command will not run, and no hooks will be called.

void
configureIO(InputInterface $input, OutputInterface $output)

No description

void
configureAndRegisterCommands(InputInterface $input, OutputInterface $output, $commandfileSearchpath, ClassLoader $classLoader)

Configure the application object and register all of the commandfiles available in the search paths provided via Preflight

void
renderThrowable(Throwable $e, OutputInterface $output)

Renders a caught Throwable. Omits the command docs at end.

void
addListeners($commandfileSearchpath)

No description

void
redispatchIfRemote(Command $command, InputInterface $input)

No description

Details

$this setConfig(ConfigInterface $config)

Set the config management object.

Parameters

ConfigInterface $config

Return Value

$this

ConfigInterface getConfig()

Get the config management object.

Return Value

ConfigInterface

static protected string configPrefix()

Any class that uses ConfigAwareTrait SHOULD override this method , and define a prefix for its configuration items. This is usually done in a base class. When used, this method should return a string that ends with a "."; see BaseTask::configPrefix().

Return Value

string

static protected configClassIdentifier($classname)

No description

Parameters

$classname

static protected configPostfix()

No description

static configure(string $key, mixed $value, ConfigInterface|null $config = null)

No description

Parameters

string $key
mixed $value
ConfigInterface|null $config

protected mixed|null getConfigValue(string $key, mixed|null $default = null)

No description

Parameters

string $key
mixed|null $default

Return Value

mixed|null

void configureGlobalOptions()

Add global options to the Application and their default values to Config.

Return Value

void

BootstrapManager|null bootstrapManager()

No description

Return Value

BootstrapManager|null

void setBootstrapManager(BootstrapManager $bootstrapManager)

No description

Parameters

BootstrapManager $bootstrapManager

Return Value

void

SiteAliasManager|null aliasManager()

No description

Return Value

SiteAliasManager|null

void setAliasManager(SiteAliasManager|null $aliasManager)

No description

Parameters

SiteAliasManager|null $aliasManager

Return Value

void

void setRedispatchHook(RedispatchHook $redispatchHook)

No description

Parameters

RedispatchHook $redispatchHook

Return Value

void

void setTildeExpansionHook(TildeExpansionHook $tildeExpansionHook)

No description

Parameters

TildeExpansionHook $tildeExpansionHook

Return Value

void

void setServiceManager(ServiceManager $serviceManager)

No description

Parameters

ServiceManager $serviceManager

Return Value

void

string|false getUri()

Return the framework uri selected by the user.

Return Value

string|false

void refineUriSelection($cwd)

If the user did not explicitly select a site URI, then pick an appropriate site from the cwd.

Parameters

$cwd

Return Value

void

selectUri($cwd)

Select a URI to use for the site, based on directory or config.

Parameters

$cwd

Command find($name)

No description

Parameters

$name

Return Value

Command

protected int doRunCommand(Command $command, InputInterface $input, OutputInterface $output)

No description

Parameters

Command $command
InputInterface $input
OutputInterface $output

Return Value

int

protected RemoteCommandProxy bootstrapAndFind(string $name)

Look up a command. Bootstrap further if necessary.

Parameters

string $name

Return Value

RemoteCommandProxy

protected checkObsolete($command)

If a command is annotated @obsolete, then we will throw an exception immediately; the command will not run, and no hooks will be called.

Parameters

$command

protected void configureIO(InputInterface $input, OutputInterface $output)

No description

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

void configureAndRegisterCommands(InputInterface $input, OutputInterface $output, $commandfileSearchpath, ClassLoader $classLoader)

Configure the application object and register all of the commandfiles available in the search paths provided via Preflight

Parameters

InputInterface $input
OutputInterface $output
$commandfileSearchpath
ClassLoader $classLoader

Return Value

void

void renderThrowable(Throwable $e, OutputInterface $output)

Renders a caught Throwable. Omits the command docs at end.

Parameters

Throwable $e
OutputInterface $output

Return Value

void

protected void addListeners($commandfileSearchpath)

No description

Parameters

$commandfileSearchpath

Return Value

void

protected void redispatchIfRemote(Command $command, InputInterface $input)

No description

Parameters

Command $command
InputInterface $input

Return Value

void