Class App
This class is used to generate the application singletons. It is loaded at script start, and initialize the following
singletons : conf, errorHandler, logger, fs (FileSystem), session, router, request, response, cache and db
-
Hawk\Singleton
-
Hawk\App
Methods summary
public
|
#
init( )
Initialize the application
Initialize the application
|
public
|
#
singleton( string $name, object $instance )
Create an application singleton
Create an application singleton
Parameters
- $name
The singleton name, that will running by App::{$name}().
For example, if $name = 'db', the singleton will be accessible by App::db();
- $instance
- The singleton instance
|
public static
|
#
__callStatic( string $method, array $arguments )
Call a singleton
Parameters
- $method
- The method name, corresponding to the singleton name
- $arguments
- The singleton arguments (not used, but mandatory when overriding __callStatic method)
|