Skip to main content

The Application instance

Application runtime schema Application instance image

Application object method for HTTP

string config(string $item [, string $section])

Returns the application main configuration values as they were loaded from the /application/config/application.ini file

$dt = $this->app->config('date_timezone', 'APPLICATION');
$cf = $this->app->config('cache_file_extension', 'CACHING');
$se = $this->app->config('some_item');

void error(int $code, string $message [, string $file] [, int $line]) Triggers an error. Depending on your settings, it will generate error messages in the log file or on screen and exit

info

This function is similar to the regular PHP function - trigger_error().

$this->app->error(E_USER_WARNING, 'Something went wrong!', __FILE__, __LINE__);
$this->app->error(E_USER_ERROR, 'Invalid value!');

bool initialized() Returns the application initialization status.

$s = $this->app->initialized();
warning

the framework loader initializes The Application instance once at startup.

bool runned() Returns the application running status. The framework loader, after initializing the application instance, invokes the application's run() method once. It may not be called a second time from anywhere in the application.

$rs = $this->app->runned();
warning

The application run() method will in turn initialize the main addon.

array timezones([string $section])

Returns the timezone array as loaded from the /framework/config/timezones.ini file

$all_timezones = $this->app->timezones();
$America_timezones = $this->app->timezones('America');