App
in package
Uses
TEventDispatcher
Main application class.
Table of Contents
Constants
- ModeDevelopment = 'dev'
- ModeLocal = 'local'
- ModeRelease = 'prod'
- ModeTest = 'test'
Properties
- $appRoot : string
- $config : Config|null
- $dataAccessPoints : DataAccessPoints|null
- $domainKey : string|null
- $eventDispatcher : EventDispatcher|null
- $instance : App|null
- $isDev : bool
- $isLocal : bool
- $log : Logger|null
- $mode : string
- $moduleManager : ModuleManager|null
- $monitoring : Monitoring|null
- $request : Request|null
- $response : Response|null
- $router : Router|null
- $systemTimezone : string
- $threadingManager : Manager|null
- $vendorRoot : string
- $webRoot : string
Methods
- Backup() : void
- Backs up necessary files.
- Create() : self
- Static constructor.
- DispatchEvent() : object|null
- Dispatches an event.
- GetPermissions() : array<string|int, mixed>
- Returns a list of permissions for the application.
- HandleEvent() : self
- Adds an event handler.
- Initialize() : void
- Initializes the application.
- RemoveHandler() : self
- Removes an event handler.
- __construct() : mixed
- Prevents instantiation of the class.
Constants
ModeDevelopment
public
string
ModeDevelopment
= 'dev'
Application mode for development
ModeLocal
public
string
ModeLocal
= 'local'
Application mode for local machine
ModeRelease
public
string
ModeRelease
= 'prod'
Application mode for production
ModeTest
public
string
ModeTest
= 'test'
Application mode for testing
Properties
$appRoot
public
static string
$appRoot
= ''
Application root directory
$config
public
static Config|null
$config
= null
Application configuration file
$dataAccessPoints
public
static DataAccessPoints|null
$dataAccessPoints
= null
Data access points
$domainKey
public
static string|null
$domainKey
= null
Domain key
$eventDispatcher
public
static EventDispatcher|null
$eventDispatcher
= null
Event dispatcher
$instance
public
static App|null
$instance
= null
Singleton instance
$isDev
public
static bool
$isDev
= false
Indicates whether the application is in development mode
$isLocal
public
static bool
$isLocal
= false
Indicates whether the application is running locally
$log
public
static Logger|null
$log
= null
Logger device
$mode
public
static string
$mode
= 'local'
Application mode
$moduleManager
public
static ModuleManager|null
$moduleManager
= null
Module manager
$monitoring
public
static Monitoring|null
$monitoring
= null
Monitoring
$request
public
static Request|null
$request
= null
Request object
$response
public
static Response|null
$response
= null
Response object
$router
public
static Router|null
$router
= null
Router
$systemTimezone
public
static string
$systemTimezone
= 'UTC'
System timezone
$threadingManager
public
static Manager|null
$threadingManager
= null
Process manager
$vendorRoot
public
static string
$vendorRoot
= ''
Path to vendor folder
$webRoot
public
static string
$webRoot
= ''
Public directory root
Methods
Backup()
Backs up necessary files.
public
Backup(Logger $logger, string $path) : void
Parameters
- $logger : Logger
-
Logger instance
- $path : string
-
Path to backup location
Create()
Static constructor.
public
static Create() : self
Return values
selfDispatchEvent()
Dispatches an event.
public
DispatchEvent(string|Event $event[, mixed $args = null ][, bool $async = false ]) : object|null
Parameters
- $event : string|Event
-
The event object or its name.
- $args : mixed = null
-
Additional arguments to pass to the event handlers.
- $async : bool = false
-
Whether to dispatch the event asynchronously.
Return values
object|null —The event object with updated arguments, or null if the event does not exist.
GetPermissions()
Returns a list of permissions for the application.
public
GetPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of permissions
HandleEvent()
Adds an event handler.
public
HandleEvent(array<string|int, mixed>|string $ename, mixed $listener) : self
Parameters
- $ename : array<string|int, mixed>|string
-
The event name or an array of event names.
- $listener : mixed
-
The event handler.
Return values
selfInitialize()
Initializes the application.
public
Initialize() : void
RemoveHandler()
Removes an event handler.
public
RemoveHandler(string $ename, mixed $listener) : self
Parameters
- $ename : string
-
The event name.
- $listener : mixed
-
The event handler to remove.
Return values
self__construct()
Prevents instantiation of the class.
private
__construct() : mixed