ConsoleApplication
extends PioniaApplication
in package
Table of Contents
Properties
- $appName : string
- $appVersion : string
- $context : ContainerInterface|Container|null
- Application container context
- $env : Arrayable|null
- Environment variables
- $logger : LoggerInterface|null
- Logger instance
- $applicationType : PioniaApplicationType|null
- Application type
- $dispatcher : PioniaEventDispatcher|null
- Event dispatcher
- $envResolver : EnvResolver|null
- Environment resolver
- $macros : array<string|int, mixed>
- $APP_NAME : string
- $version : string
Methods
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __construct() : mixed
- appName() : string
- Our application name
- appRoot() : string
- The root folder of the application.
- boot() : void
- booted() : void
- 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.
- getEnv() : Arrayable
- getOrDefault() : mixed
- Get a value from the container or return a default value
- getOrFail() : mixed
- getSilently() : mixed
- hasMacro() : bool
- Check if we have a method in the balonables
- isConsoleApp() : bool
- isDevelopment() : bool
- isLinux() : bool
- isMac() : bool
- isProduction() : bool
- isRestApp() : bool
- isTesting() : bool
- isWindows() : bool
- macro() : void
- Add a new mixable to the macros
- mediaPath() : string
- The path to the resources directory.
- 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
- publicPath() : string
- The directory where the frontend assets are stored.
- refreshEnv() : void
- set() : void
- Set a value in the container
- setAppName() : void
- Change the core app name
- setLogger() : void
- shutdown() : void
- terminate() : void
- terminated() : void
- Register the application's terminated hook listeners.
- terminating() : void
- Regester the application's terminating hook listeners.
- version() : string
- contextHas() : bool
- report() : void
- attemptToConnectToAnyDbAvailable() : void
- bootstrapAuthentications() : void
- bootstrapCommands() : void
- bootstrapMiddlewares() : void
- syncCommands() : void
- Sync the commands from the configuration and add them to the console application
Properties
$appName
public
string
$appName
= 'Pionia'
$appVersion
public
string
$appVersion
= '2.0.0'
$context
Application container context
public
ContainerInterface|Container|null
$context
$env
Environment variables
public
Arrayable|null
$env
$logger
Logger instance
public
LoggerInterface|null
$logger
$applicationType
Application type
protected
PioniaApplicationType|null
$applicationType
= \Pionia\Pionia\Utils\PioniaApplicationType::REST
$dispatcher
Event dispatcher
protected
PioniaEventDispatcher|null
$dispatcher
$envResolver
Environment resolver
protected
EnvResolver|null
$envResolver
$macros
protected
static array<string|int, mixed>
$macros
= []
$APP_NAME
private
string
$APP_NAME
= 'Pionia'
$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()
public
__construct([ContainerInterface|Container|null $context = null ]) : mixed
Parameters
- $context : ContainerInterface|Container|null = null
appName()
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
stringboot()
public
boot() : void
booted()
public
booted() : void
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
stringgetEnv()
public
getEnv() : Arrayable
Return values
ArrayablegetOrDefault()
Get a value from the container or return a default value
public
getOrDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getOrFail()
public
getOrFail(mixed $key) : mixed
Parameters
- $key : mixed
Tags
getSilently()
public
getSilently(mixed $key) : mixed
Parameters
- $key : mixed
hasMacro()
Check if we have a method in the balonables
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
boolisConsoleApp()
public
isConsoleApp() : bool
Return values
boolisDevelopment()
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
mediaPath()
The path to the resources directory.
public
mediaPath() : string
Return values
stringmixin()
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()
public
powerUp([PioniaApplicationType|null $type = null ]) : PioniaApplication
Parameters
- $type : PioniaApplicationType|null = null
Return values
PioniaApplicationpublicPath()
The directory where the frontend assets are stored.
public
publicPath([ $path = null ]) : string
Parameters
Return values
stringrefreshEnv()
public
refreshEnv() : void
set()
Set a value in the container
public
set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
setAppName()
Change the core app name
public
setAppName( $name) : void
Parameters
setLogger()
public
setLogger(LoggerInterface $logger) : void
Parameters
- $logger : LoggerInterface
shutdown()
public
shutdown([int $status = 1 ]) : void
Parameters
- $status : int = 1
terminate()
public
terminate() : void
terminated()
Register the application's terminated hook listeners.
public
terminated() : void
All logic that needs to run after the application is terminated
terminating()
Regester the application's terminating hook listeners.
public
terminating() : void
All logic that needs to run before the application is terminated
version()
public
version() : string
Return values
string —The version of the application
contextHas()
protected
contextHas(string $key) : bool
Parameters
- $key : string
Return values
boolreport()
protected
report(string $format, string $message[, array<string|int, mixed>|null $data = [] ]) : void
Parameters
- $format : string
- $message : string
- $data : array<string|int, mixed>|null = []
attemptToConnectToAnyDbAvailable()
private
attemptToConnectToAnyDbAvailable() : void
bootstrapAuthentications()
private
bootstrapAuthentications() : void
bootstrapCommands()
private
bootstrapCommands() : void
Tags
bootstrapMiddlewares()
private
bootstrapMiddlewares() : void
syncCommands()
Sync the commands from the configuration and add them to the console application
private
syncCommands() : void