abstract class Application

Application.

Properties

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

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.

$this
boot()

Boots the application.

run()

Runs the application.

Details

at line 98
__construct(string $applicationPath)

Constructor.

Parameters

string $applicationPath Application path

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

Exceptions

LogicException

at line 131
static Application instance()

Returns a singleton instance of the application.

Return Value

Application

Exceptions

LogicException

at line 146
float getStartTime()

Returns the application start time.

Return Value

float

at line 156
Container getContainer()

Returns the container instance.

Return Value

Container

at line 166
Config getConfig()

Returns the config instance.

Return Value

Config

at line 176
string getCharset()

Returns the application charset.

Return Value

string

at line 186
string getLanguage()

Returns the application language.

Return Value

string

at line 196
setLanguage(array $language)

Sets the application language settings.

Parameters

array $language Application language settings

at line 211
string getPath()

Gets the application path.

Return Value

string

at line 221
array getPackages()

Returns all the application packages.

Return Value

array

at line 233
Package getPackage(string $package)

Returns a package by its name.

Parameters

string $package Package name

Return Value

Package

Exceptions

RuntimeException

at line 249
string getNamespace(bool $prefix = false)

Returns the application namespace.

Parameters

bool $prefix Prefix the namespace with a slash?

Return Value

string

at line 266
bool isCommandLine()

Is the application running in the CLI?

Return Value

bool

at line 276
string|null getEnvironment()

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

Return Value

string|null

at line 284
protected configure()

Configure.

at line 312
protected serviceRegistrar(string $type)

Registers services in the container.

Parameters

string $type Service type

at line 323
protected registerCLIServices()

Registers command line services.

at line 331
protected registerWebServices()

Registers web services.

at line 339
protected registerServices()

Register services in the container.

at line 360
protected registerClassAliases()

Registers class aliases.

at line 375
protected bootstrap()

Loads the application bootstrap file.

at line 388
protected packageBooter(string $type)

Boots packages.

Parameters

string $type Package type

at line 403
protected bootCliPackages()

Boots command line packages.

at line 411
protected bootWebPackages()

Boots web packages.

at line 419
protected bootPackages()

Boot packages.

at line 440
protected Container containerFactory()

Creates a container instance.

Return Value

Container

at line 450
protected Config configFactory()

Creates a configuration instance.

Return Value

Config

at line 458
protected initialize()

Sets up the framework core.

at line 486
$this boot()

Boots the application.

Return Value

$this

at line 520
abstract run()

Runs the application.