VERSION
VERSION = '1.0.0' : string
The Omega framework version.
Base application class.
This Application
class represents the main entry point of the Omega framework.
It manages the application's lifecycle, including configuration, routing, and
handling HTTP requests.
bootstrap() : \Omega\Http\Response
Bootstrap the application.
This method starts and runs the Omega application. It handles the entire application lifecycle, including session management, configuration setup, routing, and processing HTTP requests.
If an error occurs during application execution.
Return an instance of Response representing the application's response.
environment(string|array ...$environments) : string|bool
Get or check the current application environment.
string|array | $environments variadic | One or more environment names to check against the current environment. If no parameters are provided, the method returns the current environment as a string.
If one or more environment names are provided, the method returns |
The current environment as a string if no parameters are provided; true
or false
if
checking against the provided environments.
joinPaths(string|null $basePath, string ...$paths) : string
Join the given path.
Concatenates a base path with additional paths and returns the result.
string|null | $basePath | Holds the base path to join. |
string | $paths variadic | Holds the paths to join. |
Return the joined paths.
call(callable|array{0: object|string, 1: string} $callable, array$parameters = []) : mixed
Call a callable with dependency injection.
callable|array{0: object|string, 1: string} | $callable | Holds the callable function or method. |
array |
$parameters | Holds an associative array of additional parameters to pass. |
if the callable cannot be reflected.
if a dependency cannot be resolved.
if the callable is not invocable.
Return the result of the callable.
getInstance(string|null $basePath = null) : static
Get the singleton instance.
This method returns the singleton instance of the class. If an instance doesn't exist, it creates one and returns it.
string|null | $basePath | Holds the Omega application base path or null. |
Return the singleton instance.
__clone() : void
Clone method.
This method is overridden to prevent cloning of the singleton instance. Cloning would create a second instance, which violates the Singleton pattern.
If an attempt to clone the singleton is made.
__wakeup() : void
Wakeup method.
This method is overridden to prevent deserialization of the singleton instance. Deserialization would create a second instance, which violates the Singleton pattern.
If an attempt at deserialization is made.
__sleep() : array
Sleep method.
This method is overridden to prevent serialization of the singleton instance. Serialization would create a second instance, which violates the Singleton pattern.
If an attempt at serialization is made.
Return the names of private properties in parent classes.
dispatch(string $basePath) : \Omega\Http\Response
Dispatch the application.
This method dispatches the application, including routing setup and handling of HTTP requests.
string | $basePath | The base path of the application. |
If an error occurs during dispatching.
An instance of Response representing the application's response.
getReflector(callable|array{0: object|string, 1: string} $callable) : \ReflectionMethod|\ReflectionFunction
Get reflector for the given callable.
callable|array{0: object|string, 1: string} | $callable | Holds the callable function or method. |
if the callable cannot be reflected.
if an unsupported callable type is provided.
Return the reflection object for the callable.