com\setasign\SetaFramework\Bootstrap
HttpBootstrap Class Bootstrap Http
File: /SetaFramework/src/Bootstrap/HttpBootstrap.php
Class hierarchy
Implements
- \Psr\Http\Server\MiddlewareInterface
Summary
Methods
- __construct()
- __wakeup()
- configureDi()
- getDefaultDomain()
- getDi()
- getErrorController()
- getQueue()
- getRequestPathPrefix()
- getResponse()
- getRouterDefaultValues()
- getSessionConfig()
- getTrustedProxiesConfig()
- isDebug()
- process()
- resetState()
- runRouter()
- setBootstrapLogConfig()
- setCacheHandlerConfig()
- setDatabaseConnectionConfig()
- setDebug()
- setDefaultDomain()
- setErrorController()
- setLogHandlerConfig()
- setRequestPathPrefix()
- setResponse()
- setRouterDefaultValues()
- setSessionConfig()
- setTrustedProxiesConfig()
- setupCacheBuilder()
- setupDatabaseConnectionManager()
- setupErrorHandler()
- setupLogBuilder()
- setupLogHandler()
- setupRouter()
- setupStoragelessMiddleware()
- shutdownFunction()
Constants
EVENT_POST_RUN
Will be called after the main application is finished. Also if there was an exception!
extraParams:
'bootstrap' => Bootstrap
EVENT_PRE_RUN
Will be called before the main application will be started.
Listeners are able to modify the route data and change the application.
extraParams:
'bootstrap' => Bootstrap
'routeData' => &array
EVENT_SHUTDOWN_HANDLER
Will be called after script execution finishes or exit() is called.
Note: HttpBootstrap and Bootstrap share the same shutdown-event.
Show also shutdown functions.
extraParams:
'bootstrap' => Bootstrap
Properties
$defaultDomain
$di
$response
Static Methods
prepare()
Helper method if you want to call the bootstrap manually.
Parameters
- $configFile : string
- $configParams : array
Exceptions
Throws ConfigReaderException
registerShutdownFunction()
WARNING: This method is marked as deprecated!
Use eventManager Bootstrap::EVENT_SHUTDOWN_HANDLER directly.
You should always use this method instead of "register_shutdown_function" to prevent memory leaks in application server structure.
Parameters
- $function : callable
start()
array $configParams = array ( ),
\Psr\Http\Server\MiddlewareInterface[]|callable[] $middlewares = array ( )
Setups everything and start the application.
Parameters
- $configFile : string
Path to config file
- $configParams : array
- $middlewares : \Psr\Http\Server\MiddlewareInterface[]|callable[]
Callables must return a MiddlewareInterface. They get the arguments autowired by the GlobalDi.
Methods
__construct()
process()
\Psr\Http\Server\RequestHandlerInterface $handler
Parameters
- $request : \Psr\Http\Message\ServerRequestInterface
- $handler : \Psr\Http\Server\RequestHandlerInterface
Exceptions
Throws \com\setasign\SetaFramework\Exception
Throws \Throwable
runRouter()
setDatabaseConnectionConfig()
Parameters
setErrorController()
Sets the errorController which will used if in run happens any error
Parameters
- $file : string
- $className : string
Exceptions
Throws \InvalidArgumentException If $file doesn't exist.
setRouterDefaultValues()
Parameters
- $routerDefaultValues : ?\com\setasign\SetaFramework\Config\Config
setSessionConfig()
Parameters
- $sessionConfig : ?\com\setasign\SetaFramework\Config\Config
setTrustedProxiesConfig()
Parameters
- $trustedProxiesConfig : ?\com\setasign\SetaFramework\Config\Config
setupCacheBuilder()
Exceptions
Throws \Throwable
setupDatabaseConnectionManager()
Exceptions
Throws \Throwable
setupLogBuilder()
Exceptions
Throws \Throwable
setupLogHandler()
Exceptions
Throws \Throwable
