class Application extends Application

CLI application.

Properties

static protected Application $instance Singleton instance of self. from Application
protected float $startTime Application start time. from Application
protected Container; $container Container. from Application
protected Config $config Config instance. from Application
protected string $charset Application charset. from Application
protected string $language Application language. from Application
protected string $applicationPath Application path. from Application
protected array $packages Booted packages. from Application
protected Reactor $reactor Reactor instance.

Methods

__construct(string $applicationPath)

Constructor.

static Application
start(string $applicationPath)

Starts the application and returns a singleton instance of the application.

static Application
instance()

Returns a singleton instance of the application.

float
getStartTime()

Returns the application start time.

getContainer()

Returns the container instance.

getConfig()

Returns the config instance.

string
getCharset()

Returns the application charset.

string
getLanguage()

Returns the application language.

setLanguage(array $language)

Sets the application language settings.

string
getPath()

Gets the application path.

array
getPackages()

Returns all the application packages.

getPackage(string $package)

Returns a package by its name.

string
getNamespace(bool $prefix = false)

Returns the application namespace.

bool
isCommandLine()

Is the application running in the CLI?

string|null
getEnvironment()

Returns the Mako environment. NULL is returned if no environment is specified.

configure()

Configure.

serviceRegistrar(string $type)

Registers services in the container.

registerCLIServices()

Registers command line services.

registerWebServices()

Registers web services.

registerServices()

Register services in the container.

registerClassAliases()

Registers class aliases.

bootstrap()

Loads the application bootstrap file.

packageBooter(string $type)

Boots packages.

bootCliPackages()

Boots command line packages.

bootWebPackages()

Boots web packages.

bootPackages()

Boot packages.

containerFactory()

Creates a container instance.

configFactory()

Creates a configuration instance.

initialize()

Sets up the framework core.

boot()

Boots the application.

run()

Runs the application.

inputFactory()

Creates a input instance.

outputFactory()

Creates an output instance.

reactorFactory()

Creates a reactor instance.

string
loadLogo()

Loads the reactor ASCII logo.

registerGlobalReactorOptions()

Registers global reactor options.

startReactor()

Starts the reactor.

array
getCommands()

Returns all registered commands.

Details

in Application at line 98
__construct(string $applicationPath)

Constructor.

Parameters

string $applicationPath Application path

in Application at line 113
static Application start(string $applicationPath)

Starts the application and returns a singleton instance of the application.

Parameters

string $applicationPath Application path

Return Value

Application

in Application at line 128
static Application instance()

Returns a singleton instance of the application.

Return Value

Application

in Application at line 143
float getStartTime()

Returns the application start time.

Return Value

float

in Application at line 153
Container getContainer()

Returns the container instance.

Return Value

Container

in Application at line 163
Config getConfig()

Returns the config instance.

Return Value

Config

in Application at line 173
string getCharset()

Returns the application charset.

Return Value

string

in Application at line 183
string getLanguage()

Returns the application language.

Return Value

string

in Application at line 193
setLanguage(array $language)

Sets the application language settings.

Parameters

array $language Application language settings

in Application at line 208
string getPath()

Gets the application path.

Return Value

string

in Application at line 218
array getPackages()

Returns all the application packages.

Return Value

array

in Application at line 229
Package getPackage(string $package)

Returns a package by its name.

Parameters

string $package Package name

Return Value

Package

in Application at line 245
string getNamespace(bool $prefix = false)

Returns the application namespace.

Parameters

bool $prefix Prefix the namespace with a slash?

Return Value

string

in Application at line 262
bool isCommandLine()

Is the application running in the CLI?

Return Value

bool

in Application at line 272
string|null getEnvironment()

Returns the Mako environment. NULL is returned if no environment is specified.

Return Value

string|null

in Application at line 280
protected configure()

Configure.

in Application at line 308
protected serviceRegistrar(string $type)

Registers services in the container.

Parameters

string $type Service type

in Application at line 319
protected registerCLIServices()

Registers command line services.

in Application at line 327
protected registerWebServices()

Registers web services.

in Application at line 335
protected registerServices()

Register services in the container.

in Application at line 356
protected registerClassAliases()

Registers class aliases.

in Application at line 371
protected bootstrap()

Loads the application bootstrap file.

in Application at line 384
protected packageBooter(string $type)

Boots packages.

Parameters

string $type Package type

in Application at line 399
protected bootCliPackages()

Boots command line packages.

in Application at line 407
protected bootWebPackages()

Boots web packages.

in Application at line 415
protected bootPackages()

Boot packages.

in Application at line 436
protected Container containerFactory()

Creates a container instance.

Return Value

Container

in Application at line 446
protected Config configFactory()

Creates a configuration instance.

Return Value

Config

at line 148
protected initialize()

Sets up the framework core.

in Application at line 480
protected boot()

Boots the application.

at line 219
run()

Runs the application.

at line 60
protected Input inputFactory()

Creates a input instance.

Return Value

Input

at line 70
protected Output outputFactory()

Creates an output instance.

Return Value

Output

at line 80
protected Reactor reactorFactory()

Creates a reactor instance.

Return Value

Reactor

Loads the reactor ASCII logo.

Return Value

string

at line 100
protected registerGlobalReactorOptions()

Registers global reactor options.

at line 118
protected startReactor()

Starts the reactor.

at line 160
protected array getCommands()

Returns all registered commands.

Return Value

array