This is the Core class of this framework. It provides public methods for use in your app. Protected or private methods are only for internal usage.
Here is a table with all given constants.
Contant | Type | Value | Description |
VERSION | String | 2.7.2 | Version of the current framework installation. |
NAME | String | LightPHPFramework (LPF) | Name of the current framework installation. |
DEVELOPMENT | String | development | Identifies the development environment |
TEST | String | test | Identifies the test environment |
STAGING | String | staging | Identifies the staging environment |
DEVELOPMENT | String | production | Identifies the production environment |
These properties are defined as public.
Properties | Type | Value | Description |
$environment | String | production | Currently framework environment. |
$encoding | String | UTF-8 | Currently encoding type. |
$timezone | String | Europe/Berlin | Currently timezone. Is the timezone is not set in your app, the default value from the configuration will be used. |
This method set a constant. If constant already exists, \LPFException will be thrown.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$const_name | String | Name of constant. | ||
$const_value | String | null | Value for constant. |
LPF::set_global('FOO', 'bar');
This method get a constant. If given constant not exists, \LPFException will be thrown.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$const_name | String | Name of constant. |
LPF::get_global('FOO');
This method get all user constants as object.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
LPF::get_all_global();
This method set the timezone. If timezone is null, the timezone from the configuration file will be used.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$timezone | String | null | Timezone. Example: 'Europe/Berlin' |
LPF::set_timezone('Europe/Berlin');
This method return the current timezone that was defined by config or in the App > bootrap.php.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
LPF::get_timezone();
This method return given config value that is stored in the default.json config file. If no value is given, the whole config data will be returned as object.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$config | String | null | Config item that should returned. Multi-dimensional arrays can be accessed by separating the levels by a dot "." |
LPF::config('project.name');