PHP Class Autarky\Application

Inheritance: implements Symfony\Component\HttpKernel\HttpKernelInterface
Datei anzeigen Open project: autarky/framework Class Usage Examples

Protected Properties

Property Type Description
$booted boolean
$booting boolean
$config Autarky\Config\ConfigInterface
$configurators SplDoublyLinkedList
$console Autarky\Console\Application
$container Autarky\Container\ContainerInterface
$environment Closure | string
$errorHandler Autarky\Errors\ErrorHandlerManagerInterface
$kernel Autarky\Http\Kernel
$middlewares SplPriorityQueue
$providers array The application's service providers.
$requests Symfony\Component\HttpFoundation\RequestStack
$stack Stack\Builder

Public Methods

Method Description
__construct ( Closure | string $environment, array $providers ) Construct a new application instance.
addMiddleware ( Closure | string | array $middleware, integer $priority = null ) Add a middleware to the application.
alias ( )
boot ( ) : void Boot the application.
bootConsole ( ) : Application Boot a console application.
config ( callable | string | autarky\ConfiguratorInterface $configurator ) : void Push a configurator on top of the stack. The configurators will be executed when the application is booted. If the application is already booted, the configurator will be executed at once.
define ( )
getConfig ( ) : Autarky\Config\ConfigInterface Get the application's config store.
getContainer ( ) : Autarky\Container\Container | Autarky\Container\ContainerInterface Get the application's container.
getEnvironment ( ) : string Get the current environment.
getErrorHandler ( ) : Autarky\Errors\ErrorHandlerManagerInterface Get the application's error handler.
getProviders ( ) : string[] Get the application's providers.
getRequestStack ( ) : Symfony\Component\HttpFoundation\RequestStack Get the application's request stack.
getRouter ( ) : Autarky\Routing\RouterInterface Get the application's router.
handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $throw = false )
invoke ( )
mount ( )
params ( )
resolve ( )
route ( )
run ( Request $request = null, boolean $send = true ) : Response Run the application.
setConfig ( Autarky\Config\ConfigInterface $config ) Set the application's config store.
setContainer ( Autarky\Container\ContainerInterface $container ) Set the application's container.
setEnvironment ( string $environment ) Set the environment of the application. Has to be called before boot().
setErrorHandler ( Autarky\Errors\ErrorHandlerManagerInterface $errorHandler ) Set the application's error handler.
share ( )

Protected Methods

Method Description
checkProviderDependencies ( Autarky\Providers\DependantProviderInterface $provider )
invokeConfigurator ( callable | string | autarky\ConfiguratorInterface $configurator ) : void Invoke a single configurator.
registerProvider ( Autarky\Providers\ProviderInterface $provider ) : void Register a single service provider.
registerProviders ( ) : void Register all of the application's service providers.
resolveKernel ( ) : Symfony\Component\HttpKernel\HttpKernelInterface Resolve the HTTP kernel.
resolveStack ( ) : Stack\Builder Resolve the stack builder.

Method Details

__construct() public method

Construct a new application instance.
public __construct ( Closure | string $environment, array $providers )
$environment Closure | string
$providers array

addMiddleware() public method

Add a middleware to the application.
public addMiddleware ( Closure | string | array $middleware, integer $priority = null )
$middleware Closure | string | array
$priority integer

alias() public method

See also: Autarky\Container\ContainerInterface::alias()
public alias ( )

boot() public method

Boot the application.
public boot ( ) : void
return void

bootConsole() public method

Boot a console application.
public bootConsole ( ) : Application
return Symfony\Component\Console\Application

checkProviderDependencies() protected method

protected checkProviderDependencies ( Autarky\Providers\DependantProviderInterface $provider )
$provider Autarky\Providers\DependantProviderInterface

config() public method

Push a configurator on top of the stack. The configurators will be executed when the application is booted. If the application is already booted, the configurator will be executed at once.
public config ( callable | string | autarky\ConfiguratorInterface $configurator ) : void
$configurator callable | string | autarky\ConfiguratorInterface
return void

define() public method

See also: Autarky\Container\ContainerInterface::define()
public define ( )

getConfig() public method

Get the application's config store.
public getConfig ( ) : Autarky\Config\ConfigInterface
return Autarky\Config\ConfigInterface

getContainer() public method

Get the application's container.
public getContainer ( ) : Autarky\Container\Container | Autarky\Container\ContainerInterface
return Autarky\Container\Container | Autarky\Container\ContainerInterface

getEnvironment() public method

Get the current environment.
public getEnvironment ( ) : string
return string

getErrorHandler() public method

Get the application's error handler.
public getErrorHandler ( ) : Autarky\Errors\ErrorHandlerManagerInterface
return Autarky\Errors\ErrorHandlerManagerInterface

getProviders() public method

Get the application's providers.
public getProviders ( ) : string[]
return string[] array of provider class names

getRequestStack() public method

Get the application's request stack.
public getRequestStack ( ) : Symfony\Component\HttpFoundation\RequestStack
return Symfony\Component\HttpFoundation\RequestStack

getRouter() public method

Get the application's router.
public getRouter ( ) : Autarky\Routing\RouterInterface
return Autarky\Routing\RouterInterface

handle() public method

public handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $throw = false )
$request Symfony\Component\HttpFoundation\Request

invoke() public method

See also: Autarky\Container\ContainerInterface::invoke()
public invoke ( )

invokeConfigurator() protected method

Invoke a single configurator.
protected invokeConfigurator ( callable | string | autarky\ConfiguratorInterface $configurator ) : void
$configurator callable | string | autarky\ConfiguratorInterface
return void

mount() public method

See also: Autarky\Routing\RouterInterface::mount()
public mount ( )

params() public method

See also: Autarky\Container\ContainerInterface::params()
public params ( )

registerProvider() protected method

Register a single service provider.
protected registerProvider ( Autarky\Providers\ProviderInterface $provider ) : void
$provider Autarky\Providers\ProviderInterface
return void

registerProviders() protected method

Register all of the application's service providers.
protected registerProviders ( ) : void
return void

resolve() public method

See also: Autarky\Container\ContainerInterface::resolve()
public resolve ( )

resolveKernel() protected method

Resolve the HTTP kernel.
protected resolveKernel ( ) : Symfony\Component\HttpKernel\HttpKernelInterface
return Symfony\Component\HttpKernel\HttpKernelInterface

resolveStack() protected method

Resolve the stack builder.
protected resolveStack ( ) : Stack\Builder
return Stack\Builder

route() public method

See also: Autarky\Routing\RouterInterface::addRoute()
public route ( )

run() public method

Run the application.
public run ( Request $request = null, boolean $send = true ) : Response
$request Symfony\Component\HttpFoundation\Request
$send boolean
return Symfony\Component\HttpFoundation\Response

setConfig() public method

Set the application's config store.
public setConfig ( Autarky\Config\ConfigInterface $config )
$config Autarky\Config\ConfigInterface

setContainer() public method

Set the application's container.
public setContainer ( Autarky\Container\ContainerInterface $container )
$container Autarky\Container\ContainerInterface

setEnvironment() public method

Set the environment of the application. Has to be called before boot().
public setEnvironment ( string $environment )
$environment string

setErrorHandler() public method

Set the application's error handler.
public setErrorHandler ( Autarky\Errors\ErrorHandlerManagerInterface $errorHandler )
$errorHandler Autarky\Errors\ErrorHandlerManagerInterface

share() public method

See also: Autarky\Container\ContainerInterface::share()
public share ( )

Property Details

$booted protected_oe property

protected bool $booted
return boolean

$booting protected_oe property

protected bool $booting
return boolean

$config protected_oe property

protected ConfigInterface,Autarky\Config $config
return Autarky\Config\ConfigInterface

$configurators protected_oe property

protected SplDoublyLinkedList $configurators
return SplDoublyLinkedList

$console protected_oe property

protected Application,Autarky\Console $console
return Autarky\Console\Application

$container protected_oe property

protected ContainerInterface,Autarky\Container $container
return Autarky\Container\ContainerInterface

$environment protected_oe property

protected Closure|string $environment
return Closure | string

$errorHandler protected_oe property

protected ErrorHandlerManagerInterface,Autarky\Errors $errorHandler
return Autarky\Errors\ErrorHandlerManagerInterface

$kernel protected_oe property

protected Kernel,Autarky\Http $kernel
return Autarky\Http\Kernel

$middlewares protected_oe property

protected SplPriorityQueue $middlewares
return SplPriorityQueue

$providers protected_oe property

The application's service providers.
protected array $providers
return array

$requests protected_oe property

protected RequestStack,Symfony\Component\HttpFoundation $requests
return Symfony\Component\HttpFoundation\RequestStack

$stack protected_oe property

protected Builder,Stack $stack
return Stack\Builder