App
class App (View source)
Constants
VERSION |
Inphinit framework version |
Methods
static string|bool|int|float|void
env(string $key, string|bool|int|float $value = null)
Set or get environment value
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
Details
at line 32
static string|bool|int|float|void
env(string $key, string|bool|int|float $value = null)
Set or get environment value
at line 48
static void
trigger(string $name, array $args = array())
Trigger registered event
at line 81
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)
at line 94
static void
on(string $name, callable $callback, int $priority = 0)
Register an event
at line 112
static void
off(string $name, callable $callback = null)
Unregister 1 or all events
at line 137
static void
stop(int $code, string $msg = null)
Stop application, send HTTP status
at line 159
static void
exec()
Start application using routes