PioniaApplication
extends Application
in package
implements
ApplicationContract, LoggerAwareInterface
Uses
ApplicationLifecycleHooks, AppHelpersTrait, Microable, PathsTrait, AppDatabaseHelper, BuiltInServices, Cacheable, Containable
Table of Contents
Interfaces
- ApplicationContract
- LoggerAwareInterface
Properties
- $appItemsCacheTTL : int
- App specific cacheacbles' time to live in caches.
- $appName : string
- Application name
- $appProviders : Arrayable
- These shall be used to run the onBooted and onTermine lifecycle hooks against every provider
- $appVersion : string
- Framework version
- $cachePrefix : string
- The cache prefix to use for caching.
- $cacheTtl : int
- The cache ttl to use for caching.
- $context : ContainerInterface|Container|null
- Application container context
- $dispatcher : PioniaEventDispatcher|null
- Event dispatcher
- $env : Arrayable|null
- Environment variables
- $logger : LoggerInterface|null
- Logger instance
- $unResolvedAppProviders : Arrayable|null
- Resolved cached providers are cached, if the provider is not found in caches, then we resolve it as new, and cache for later requests
- $applicationType : PioniaApplicationType|null
- Application type
- $booted : bool
- $bootedCallbacks : array<string|int, mixed>
- The booted callbacks
- $bootingCallbacks : array<string|int, mixed>
- The booting callbacks, callbacks to call before the app runs
- $cacheAdaptor : PioniaCacheAdaptor|null
- $envResolver : EnvResolver|null
- Environment resolver
- $macros : array<string|int, mixed>
- $terminatedCallbacks : array<string|int, mixed>
- The terminated callbacks, run after terminating the application
- $terminatingCallbacks : array<string|int, mixed>
- The terminating callbacks, run before terminating the application
- $APP_NAME : string
- $cacheInstance : PioniaCache|null
- The cache instance to use for caching.
- $version : string
Methods
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __construct() : mixed
- PioniaApplication constructor.
- addAlias() : static
- Adds an alias to the context list of aliases
- addAppProvider() : static
- Register a new provider in the app context(di) Appends the new provider into the existing array of providers
- addMiddleware() : $this
- Add a single middleware to the chain
- addQueryToPool() : static
- alias() : mixed
- Get any alias from the context
- allowedOrigins() : $this
- If set, these shall be the only addresses that can access the application
- appName() : string
- Our application name
- appRoot() : string
- The root folder of the application.
- blockedOrigins() : $this
- If set, these origins shall be prevented from accessing the application
- bootConsole() : int
- booted() : static
- Register callbacks to be run after the application is booted This method can be called multiple times to add more hooks
- booting() : $this
- Register hooks to mutate the application booting cycle.
- bootstrapCommandsFromProviders() : Arrayable
- Collect commands from app providers
- cache() : bool|mixed
- Caches the value if the value is not null.
- ClearByKeys() : bool
- Clear the cache.
- contextArrAdd() : void
- contextHas() : bool
- Check if a value exists in the container
- contextMake() : mixed
- Make an instance of a class from the container. This will throw an exception if the class is not found
- contextMakeSilently() : mixed
- Create an instance of a class without throwing an exception when it fails
- ddInfo() : Arrayable
- Return everything about database connections discovered
- defaultOrFirst() : mixed
- Get a database connection from the pool of connections we have
- deleteCache() : bool
- Delete the cache for the key.
- dispatch() : void
- Dispatches an event from anywhere in the application
- environment() : string
- envPath() : string
- flushMacros() : void
- Remove all the macros we had registered
- formatCommandString() : string
- Format the given command as a fully-qualified executable command.
- getAppName() : mixed
- getCache() : mixed
- getCacheInstance() : PioniaCache|null
- getDirFor() : string|null
- Get the directory for a given alias
- getDiscoveredConnections() : Arrayable
- Get the discovered database connections that are available in our environment
- getEnv() : PioniaApplicationType
- Get all the environment variables or the value of a single key Will check in the $_ENV, $_SERVER, container, and in the local env array for the same key, other will return all
- getOrDefault() : mixed
- Get a value from the container or return a default value
- getOrFail() : mixed
- Get a value from the container or throw an exception.
- getSilently() : mixed
- Get a value from the container or return null instead of throwing an exception
- handleRequest() : Response
- hasCache() : bool
- Check if the cache has the key.
- hasMacro() : bool
- Check if we have a method in the balonables
- httpsOnly() : $this
- If set, only https requests shall be allowed
- isBooted() : bool
- Check if the application is booted
- isCachedIn() : bool
- Checks if a certain keyToCheck is set in the cache under a certain keyCached.
- isConsoleApp() : bool
- isDebug() : mixed
- isDevelopment() : bool
- isLinux() : bool
- isMac() : bool
- isProduction() : bool
- isRestApp() : bool
- isTesting() : bool
- isWindows() : bool
- macro() : void
- Add a new mixable to the macros
- make() : mixed
- Build an entry of the container by its name.
- mediaPath() : string
- The path to the resources directory.
- middlewareChain() : $this
- When this is used, the closure passed must return a MiddlewareChain instance Middlewares in this chain will be added to the context and will be the only middlewares used
- mixin() : void
- Mix another object into the class.
- os() : string
- php() : string
- Get the PHP binary.
- phpPath() : string
- phpVersion() : string
- pioniaBinary() : string
- Get the pionia cli binary.
- powerUp() : PioniaApplication
- Boot the app
- prepareConsole() : void
- Sync the commands from the configuration and add them to the console application
- publicPath() : string
- The directory where the frontend assets are stored.
- refreshEnv() : void
- resolve() : mixed
- Get any entry from the container by its id
- set() : static
- Set a value in the container
- setAppName() : void
- Change the core app name
- setCache() : bool
- setCacheInstance() : void
- Set the cache instance to use for caching.
- setEnv() : void
- setLogger() : void
- shutdown() : void
- Shutdown the application
- supportedMethods() : array<string|int, mixed>
- terminate() : void
- Shutdown the application
- terminated() : void
- Register the application's terminated hook listeners.
- terminating() : void
- Register the application's terminating hooks.
- updateCache() : void
- version() : string
- welcomePageSettings() : Arrayable
- withCacheAdaptor() : $this
- Sets the Cache Adaptor the app shall use hence-forth Defaults to a filesystem adapter
- withEndPoints() : PioniaApplication|null
- bootAuthenticationsInProviders() : AuthenticationChain
- Bootstrap authentications coming from providers. This runs post internal authentications
- builtInAliases() : Arrayable
- Builtin Aliases
- builtInAuthentications() : Arrayable
- Get the built-in services provided by the application.
- builtInCommands() : Arrayable
- Get the built-in services provided by the application.
- builtinDirectories() : Arrayable
- Builtin Aliases
- builtInMiddlewares() : Arrayable
- Get the built-in services provided by the application.
- builtinNameSpaces() : Arrayable
- builtinProviders() : Arrayable
- report() : void
- resolveProviders() : PioniaApplication
- Registers all app providers registered in the .ini files that were collected in the env
- resolveRoutesFromProviders() : PioniaRouter
- bootProviders() : void
- Runs the boot method of each provider
- bootstrapAuthentications() : void
- Adds the collected auths to the context Can also cache the authentications for future use
- bootstrapCommands() : void
- Collect all the commands from the environment and the context
- bootstrapMiddlewares() : void
- bootstrapMiddlewaresInProviders() : MiddlewareChain
- Passes the middleware chain in the app providers and caches the process
- calculateUnresolvedProviders() : Arrayable|null
- we only want to start resolving only new providers
- callBootedCallbacks() : void
- Run all booted callbacks
- callBootingCallbacks() : void
- Run all booting callbacks
- callTerminatedCallbacks() : void
- Run all terminated callbacks
- callTerminatingCallbacks() : void
- Run all terminating callbacks
- cleanCacheKey() : string
- getKeyName() : string
- Converts the key to snake case and appends the current class prefix if it does not exist.
- logger() : LoggerInterface|null
- registerBaseRoutesInstance() : void
- Add the base routes instance to the context We shall be merging all routes to this instance
- registerCorsInstance() : void
- Add the cors instance to the context
- resolveLogger() : $this
- Set up the context logger
- setDefaultCachingAdaptor() : void
- Set the default caching adaptor to use
Properties
$appItemsCacheTTL
App specific cacheacbles' time to live in caches.
public
int
$appItemsCacheTTL
= 0
$appName
Application name
public
string
$appName
= 'Pionia Framework'
$appProviders
These shall be used to run the onBooted and onTermine lifecycle hooks against every provider
public
Arrayable
$appProviders
$appVersion
Framework version
public
string
$appVersion
= '2.0.2'
$cachePrefix
The cache prefix to use for caching.
public
string
$cachePrefix
= __CLASS__
$cacheTtl
The cache ttl to use for caching.
public
int
$cacheTtl
= 60
Defaults to 60 seconds.
$context
Application container context
public
ContainerInterface|Container|null
$context
$dispatcher
Event dispatcher
public
PioniaEventDispatcher|null
$dispatcher
$env
Environment variables
public
Arrayable|null
$env
$logger
Logger instance
public
LoggerInterface|null
$logger
$unResolvedAppProviders
Resolved cached providers are cached, if the provider is not found in caches, then we resolve it as new, and cache for later requests
public
Arrayable|null
$unResolvedAppProviders
= null
$applicationType
Application type
protected
PioniaApplicationType|null
$applicationType
= \Pionia\Utils\PioniaApplicationType::REST
$booted
protected
bool
$booted
= false
$bootedCallbacks
The booted callbacks
protected
array<string|int, mixed>
$bootedCallbacks
= []
$bootingCallbacks
The booting callbacks, callbacks to call before the app runs
protected
array<string|int, mixed>
$bootingCallbacks
= []
$cacheAdaptor
protected
PioniaCacheAdaptor|null
$cacheAdaptor
= null
$envResolver
Environment resolver
protected
EnvResolver|null
$envResolver
$macros
protected
static array<string|int, mixed>
$macros
= []
$terminatedCallbacks
The terminated callbacks, run after terminating the application
protected
array<string|int, mixed>
$terminatedCallbacks
= []
$terminatingCallbacks
The terminating callbacks, run before terminating the application
protected
array<string|int, mixed>
$terminatingCallbacks
= []
$APP_NAME
private
string
$APP_NAME
= 'Pionia'
$cacheInstance
The cache instance to use for caching.
private
PioniaCache|null
$cacheInstance
= null
$version
private
string
$version
= '2.0.0'
Methods
__call()
Dynamically handle calls to the class.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
__construct()
PioniaApplication constructor.
public
__construct([string $applicationPath = __DIR__ ]) : mixed
Parameters
- $applicationPath : string = __DIR__
addAlias()
Adds an alias to the context list of aliases
public
addAlias(string $aliasName, mixed $aliasValue) : static
Parameters
- $aliasName : string
- $aliasValue : mixed
Return values
staticaddAppProvider()
Register a new provider in the app context(di) Appends the new provider into the existing array of providers
public
addAppProvider(string $provider) : static
Parameters
- $provider : string
Return values
staticaddMiddleware()
Add a single middleware to the chain
public
addMiddleware(string $middleware) : $this
Parameters
- $middleware : string
Return values
$thisaddQueryToPool()
public
addQueryToPool(string $identifier, string $query) : static
Parameters
- $identifier : string
- $query : string
Return values
staticalias()
Get any alias from the context
public
alias(string $aliasName[, mixed|null $default = null ]) : mixed
Parameters
- $aliasName : string
- $default : mixed|null = null
allowedOrigins()
If set, these shall be the only addresses that can access the application
public
allowedOrigins(array<string|int, mixed> $addresses) : $this
Parameters
- $addresses : array<string|int, mixed>
Return values
$thisappName()
Our application name
public
appName() : string
Return values
stringappRoot()
The root folder of the application.
public
appRoot([string|null $path = null ][, int $levels = 3 ]) : string
Parameters
- $path : string|null = null
- $levels : int = 3
Return values
stringblockedOrigins()
If set, these origins shall be prevented from accessing the application
public
blockedOrigins(array<string|int, mixed> $origins) : $this
Parameters
- $origins : array<string|int, mixed>
Return values
$thisbootConsole()
public
bootConsole([string|null $name = 'Pionia Framework' ]) : int
Parameters
- $name : string|null = 'Pionia Framework'
Tags
Return values
intbooted()
Register callbacks to be run after the application is booted This method can be called multiple times to add more hooks
public
booted(Closure $closure) : static
Hooks here have access to the application instance
Parameters
- $closure : Closure
Return values
staticbooting()
Register hooks to mutate the application booting cycle.
public
booting(Closure $callback) : $this
Runs before the application is booted Can be called multiple times to add more hooks.
All hooks here do not have access to the application instance
Parameters
- $callback : Closure
Return values
$thisbootstrapCommandsFromProviders()
Collect commands from app providers
public
bootstrapCommandsFromProviders(Arrayable $commands) : Arrayable
Parameters
- $commands : Arrayable
Return values
Arrayablecache()
Caches the value if the value is not null.
public
cache(string $key[, mixed $value = null ][, mixed $ttl = null ][, bool|null $exact = false ]) : bool|mixed
Parameters
- $key : string
-
The key to cache
- $value : mixed = null
-
The value to cache
- $ttl : mixed = null
-
The time to live for the cache
- $exact : bool|null = false
-
If passed, the key won't be parsed at all, it will be cached as is.
Return values
bool|mixedClearByKeys()
Clear the cache.
public
ClearByKeys(array<string|int, mixed> $keys[, bool|null $exact = false ]) : bool
Parameters
- $keys : array<string|int, mixed>
-
The keys to clear
- $exact : bool|null = false
-
If passed, the keys won't be parsed at all
Return values
boolcontextArrAdd()
public
contextArrAdd(string $contextKey, array<string|int, mixed> $dataToAdd) : void
Parameters
- $contextKey : string
- $dataToAdd : array<string|int, mixed>
contextHas()
Check if a value exists in the container
public
contextHas(string $key) : bool
Parameters
- $key : string
Return values
boolcontextMake()
Make an instance of a class from the container. This will throw an exception if the class is not found
public
contextMake(string $name[, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $name : string
- $parameters : array<string|int, mixed> = []
Tags
contextMakeSilently()
Create an instance of a class without throwing an exception when it fails
public
contextMakeSilently(string $name[, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $name : string
- $parameters : array<string|int, mixed> = []
ddInfo()
Return everything about database connections discovered
public
ddInfo() : Arrayable
Return values
ArrayabledefaultOrFirst()
Get a database connection from the pool of connections we have
public
defaultOrFirst([string|null $name = null ]) : mixed
If a name is passed, then we try to grab that name
Parameters
- $name : string|null = null
Tags
deleteCache()
Delete the cache for the key.
public
deleteCache(string $key[, bool $exact = false ]) : bool
Parameters
- $key : string
-
The key to delete
- $exact : bool = false
-
If passed, the key won't be parsed at all
Return values
booldispatch()
Dispatches an event from anywhere in the application
public
dispatch(object $event, string $name) : void
Parameters
- $event : object
- $name : string
environment()
public
environment() : string
Return values
stringenvPath()
public
envPath([string|null $path = null ]) : string
Parameters
- $path : string|null = null
Return values
stringflushMacros()
Remove all the macros we had registered
public
static flushMacros() : void
formatCommandString()
Format the given command as a fully-qualified executable command.
public
static formatCommandString(string $string) : string
Parameters
- $string : string
Return values
stringgetAppName()
public
getAppName() : mixed
getCache()
public
getCache( $key[, bool|null $exact = false ]) : mixed
Parameters
getCacheInstance()
public
getCacheInstance() : PioniaCache|null
Return values
PioniaCache|nullgetDirFor()
Get the directory for a given alias
public
getDirFor(string $aliasName) : string|null
Parameters
- $aliasName : string
Return values
string|nullgetDiscoveredConnections()
Get the discovered database connections that are available in our environment
public
getDiscoveredConnections() : Arrayable
Return values
ArrayablegetEnv()
Get all the environment variables or the value of a single key Will check in the $_ENV, $_SERVER, container, and in the local env array for the same key, other will return all
public
getEnv([string|null $key = null ][, mixed $default = null ]) : PioniaApplicationType
Parameters
- $key : string|null = null
- $default : mixed = null
Return values
PioniaApplicationTypegetOrDefault()
Get a value from the container or return a default value
public
getOrDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getOrFail()
Get a value from the container or throw an exception.
public
getOrFail(string $key) : mixed
Parameters
- $key : string
Tags
getSilently()
Get a value from the container or return null instead of throwing an exception
public
getSilently(mixed $key) : mixed
Parameters
- $key : mixed
handleRequest()
public
handleRequest() : Response
Tags
Return values
ResponsehasCache()
Check if the cache has the key.
public
hasCache( $key[, bool|null $exact = false ]) : bool
Will not throw an exception if the key is not set or the cache is not activated.
Parameters
Return values
boolhasMacro()
Check if we have a method in the balonables
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
boolhttpsOnly()
If set, only https requests shall be allowed
public
httpsOnly([bool $httpsOnly = true ]) : $this
Parameters
- $httpsOnly : bool = true
Return values
$thisisBooted()
Check if the application is booted
public
isBooted() : bool
Return values
boolisCachedIn()
Checks if a certain keyToCheck is set in the cache under a certain keyCached.
public
isCachedIn(string $keyCached, string $keyToCheck[, bool|null $checkExact = true ]) : bool
This is useful if you want to check if a certain items is in a certain cached array or arrayable
Outside the app context, you can use is_cached_in()
to achieve the same.
Parameters
- $keyCached : string
- $keyToCheck : string
- $checkExact : bool|null = true
Return values
boolisConsoleApp()
public
isConsoleApp() : bool
Return values
boolisDebug()
public
isDebug() : mixed
isDevelopment()
public
isDevelopment() : bool
Return values
bool —If we are in development mode
isLinux()
public
isLinux() : bool
Return values
boolisMac()
public
isMac() : bool
Return values
boolisProduction()
public
isProduction() : bool
Return values
boolisRestApp()
public
isRestApp() : bool
Return values
boolisTesting()
public
isTesting() : bool
Return values
boolisWindows()
public
isWindows() : bool
Return values
boolmacro()
Add a new mixable to the macros
public
static macro(string $key, $value) : void
Parameters
make()
Build an entry of the container by its name.
public
make(string $name[, array<string|int, mixed> $parameters = [] ]) : mixed
This method behave like resolve() except resolves the entry again every time. For example if the entry is a class then a new instance will be created each time.
This method makes the container behave like a factory.
Parameters
- $name : string
- $parameters : array<string|int, mixed> = []
Tags
mediaPath()
The path to the resources directory.
public
mediaPath() : string
Return values
stringmiddlewareChain()
When this is used, the closure passed must return a MiddlewareChain instance Middlewares in this chain will be added to the context and will be the only middlewares used
public
middlewareChain(Closure $closure) : $this
Parameters
- $closure : Closure
Return values
$thismixin()
Mix another object into the class.
public
static mixin(object $mixin[, bool $replace = true ]) : void
Parameters
- $mixin : object
- $replace : bool = true
Tags
os()
public
os() : string
Return values
stringphp()
Get the PHP binary.
public
static php() : string
Return values
stringphpPath()
public
phpPath() : string
Return values
stringphpVersion()
public
phpVersion() : string
Return values
stringpioniaBinary()
Get the pionia cli binary.
public
static pioniaBinary() : string
Return values
stringpowerUp()
Boot the app
public
powerUp([PioniaApplicationType|null $type = null ]) : PioniaApplication
Parameters
- $type : PioniaApplicationType|null = null
Return values
PioniaApplicationprepareConsole()
Sync the commands from the configuration and add them to the console application
public
prepareConsole() : void
publicPath()
The directory where the frontend assets are stored.
public
publicPath([ $path = null ]) : string
Parameters
Return values
stringrefreshEnv()
public
refreshEnv() : void
resolve()
Get any entry from the container by its id
public
resolve(string $id) : mixed
This is an acronym of getOrFail
which throws an exception if the entry is not found
Parameters
- $id : string
Tags
set()
Set a value in the container
public
set(string $name, mixed $value) : static
Parameters
- $name : string
- $value : mixed
Return values
staticsetAppName()
Change the core app name
public
setAppName( $name) : void
Parameters
setCache()
public
setCache(string $key, mixed $value[, mixed $ttl = null ][, bool|null $exact = false ]) : bool
Parameters
- $key : string
- $value : mixed
- $ttl : mixed = null
- $exact : bool|null = false
Return values
boolsetCacheInstance()
Set the cache instance to use for caching.
public
setCacheInstance(PioniaCache|null $cache) : void
Parameters
- $cache : PioniaCache|null
setEnv()
public
setEnv(string $key, Arrayable|null $env[, bool|null $override = true ]) : void
Parameters
- $key : string
- $env : Arrayable|null
- $override : bool|null = true
setLogger()
public
setLogger(LoggerInterface $logger) : void
Parameters
- $logger : LoggerInterface
shutdown()
Shutdown the application
public
shutdown() : void
supportedMethods()
public
supportedMethods() : array<string|int, mixed>
Return values
array<string|int, mixed>terminate()
Shutdown the application
public
terminate([int $status = 1 ]) : void
Parameters
- $status : int = 1
terminated()
Register the application's terminated hook listeners.
public
terminated(Closure $closure) : void
All logic that needs to run after the application is terminated Can be called multiple times to add more hooks
Hooks here do not have access to the application instance
Parameters
- $closure : Closure
terminating()
Register the application's terminating hooks.
public
terminating(Closure $callback) : void
All logic that needs to run before the application is terminated Can be called multiple times to add more hooks
Hooks here have access to the application instance
Parameters
- $callback : Closure
updateCache()
public
updateCache(mixed $key, mixed $newValue[, mixed $exact = false ][, int|null $ttl = null ]) : void
Parameters
- $key : mixed
- $newValue : mixed
- $exact : mixed = false
- $ttl : int|null = null
version()
public
version() : string
Return values
string —The version of the application
welcomePageSettings()
public
welcomePageSettings() : Arrayable
Return values
ArrayablewithCacheAdaptor()
Sets the Cache Adaptor the app shall use hence-forth Defaults to a filesystem adapter
public
withCacheAdaptor(callable $cacheAdaptorResolver) : $this
All Symfony cache adaptors are supported, even a custom one can be added as long as it supports the PSR-16 CacheInterface
The callable receives both the application and the env as arguments
Parameters
- $cacheAdaptorResolver : callable
Return values
$thiswithEndPoints()
public
withEndPoints() : PioniaApplication|null
Return values
PioniaApplication|nullbootAuthenticationsInProviders()
Bootstrap authentications coming from providers. This runs post internal authentications
protected
bootAuthenticationsInProviders( $authentications) : AuthenticationChain
Parameters
Return values
AuthenticationChainbuiltInAliases()
Builtin Aliases
protected
builtInAliases() : Arrayable
Return values
ArrayablebuiltInAuthentications()
Get the built-in services provided by the application.
protected
builtInAuthentications() : Arrayable
Return values
ArrayablebuiltInCommands()
Get the built-in services provided by the application.
protected
builtInCommands() : Arrayable
Return values
ArrayablebuiltinDirectories()
Builtin Aliases
protected
builtinDirectories() : Arrayable
Return values
ArrayablebuiltInMiddlewares()
Get the built-in services provided by the application.
protected
builtInMiddlewares() : Arrayable
Return values
ArrayablebuiltinNameSpaces()
protected
builtinNameSpaces() : Arrayable
Return values
ArrayablebuiltinProviders()
protected
builtinProviders() : Arrayable
Return values
Arrayablereport()
protected
report(string $format, string $message[, array<string|int, mixed>|null $data = [] ]) : void
Parameters
- $format : string
- $message : string
- $data : array<string|int, mixed>|null = []
resolveProviders()
Registers all app providers registered in the .ini files that were collected in the env
protected
resolveProviders([bool $considerCached = true ]) : PioniaApplication
Parameters
- $considerCached : bool = true
Tags
Return values
PioniaApplicationresolveRoutesFromProviders()
protected
resolveRoutesFromProviders(PioniaRouter $router) : PioniaRouter
Parameters
- $router : PioniaRouter
Return values
PioniaRouterbootProviders()
Runs the boot method of each provider
private
bootProviders() : void
bootstrapAuthentications()
Adds the collected auths to the context Can also cache the authentications for future use
private
bootstrapAuthentications() : void
bootstrapCommands()
Collect all the commands from the environment and the context
private
bootstrapCommands() : void
bootstrapMiddlewares()
private
bootstrapMiddlewares() : void
bootstrapMiddlewaresInProviders()
Passes the middleware chain in the app providers and caches the process
private
bootstrapMiddlewaresInProviders( $middlewares) : MiddlewareChain
Parameters
Return values
MiddlewareChaincalculateUnresolvedProviders()
we only want to start resolving only new providers
private
calculateUnresolvedProviders() : Arrayable|null
Return values
Arrayable|nullcallBootedCallbacks()
Run all booted callbacks
private
callBootedCallbacks() : void
callBootingCallbacks()
Run all booting callbacks
private
callBootingCallbacks() : void
callTerminatedCallbacks()
Run all terminated callbacks
private
callTerminatedCallbacks() : void
callTerminatingCallbacks()
Run all terminating callbacks
private
callTerminatingCallbacks() : void
cleanCacheKey()
private
cleanCacheKey(string $key) : string
Parameters
- $key : string
Return values
stringgetKeyName()
Converts the key to snake case and appends the current class prefix if it does not exist.
private
getKeyName(string $key) : string
Parameters
- $key : string
Return values
stringlogger()
private
logger() : LoggerInterface|null
Return values
LoggerInterface|nullregisterBaseRoutesInstance()
Add the base routes instance to the context We shall be merging all routes to this instance
private
registerBaseRoutesInstance() : void
registerCorsInstance()
Add the cors instance to the context
private
registerCorsInstance() : void
resolveLogger()
Set up the context logger
private
resolveLogger() : $this
Return values
$thissetDefaultCachingAdaptor()
Set the default caching adaptor to use
private
setDefaultCachingAdaptor() : void