AppFactory
in package
Table of Contents
- $app : AppInit
- create() : AppInit
- run() : void
- createRequest() : ServerRequestInterface
- setEnvironment() : void
- Set the environment type for the application.
- setErrorHandler() : void
Properties
$app
private
static AppInit
$app
Methods
create()
public
static create(string $appDirPath[, string|null $environment = null ]) : AppInit
Parameters
- $appDirPath : string
- $environment : string|null = null
Return values
AppInit —run()
public
static run() : void
Return values
void —createRequest()
private
static createRequest(RequestFactory $psr17Factory) : ServerRequestInterface
Parameters
- $psr17Factory : RequestFactory
Return values
ServerRequestInterface —setEnvironment()
Set the environment type for the application.
private
static setEnvironment([null|string $environment = null ]) : void
This function sets the environment type by defining the RAYDIUM_ENVIRONMENT_TYPE
constant.
If the environment type is not provided, it defaults to null
and can fallback to .env
file setup.
Usage:
- If
$environment
is provided, it will define theRAYDIUM_ENVIRONMENT_TYPE
. - If
$environment
isnull
, the function will allow the.env
file to define the environment type.
Parameters
- $environment : null|string = null
-
The environment type, which can be a string (e.g., 'production', 'development') or null to use the .env file setup.
Return values
void —setErrorHandler()
private
static setErrorHandler() : void