App
class App (View source)
Constants
| VERSION |
Inphinit framework version |
Methods
static mixed
config(string $key, $value = null)
Get application configs
static void
trigger(string $name, array $args = array())
Trigger registered event
static int
state()
Return application state
static void
on(string $name, callable $callback, int $priority = 0)
Register an event
static void
off(string $name, callable $callback = null)
Unregister 1 or all events
static void
stop(int $code, string $msg = null)
Stop application, send HTTP status
static void
exec()
Start application using routes
static
dispatch()
Dispatch before ready event if exec is Ok, or dispatch after finish event if stop() is executed
Details
static mixed
config(string $key, $value = null)
Get application configs
static void
trigger(string $name, array $args = array())
Trigger registered event
static int
state()
Return application state
- 0 - Unexecuted - `App::exec()` is not executed
- 1 - Initiated - `App::exec()` is executed
- 2 - Interactive - After dispatch headers and views
- 3 - Ready - After show return in output
- 4 - Finished - Defined after trigger finish event
- 5 - Error - Defined after trigger an error event (by user or by script)
static void
on(string $name, callable $callback, int $priority = 0)
Register an event
static void
off(string $name, callable $callback = null)
Unregister 1 or all events
static void
stop(int $code, string $msg = null)
Stop application, send HTTP status
static void
exec()
Start application using routes
static
dispatch()
Dispatch before ready event if exec is Ok, or dispatch after finish event if stop() is executed