LightPHPFramework

LPF Class

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.

Constants

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

Properties

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.

set_global($const_name, $const_value = false)

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.
Example
		
LPF::set_global('FOO', 'bar');
		
	

get_global($const_name)

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.
Example
		
LPF::get_global('FOO');
		
	

get_all_globals()

This method get all user constants as object.

Static Yes
Parameters Parameter Type Default Description
Example
		
LPF::get_all_global();
		
	

set_timezone($timezone = null)

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'
Example
		
LPF::set_timezone('Europe/Berlin');
		
	

get_timezone()

This method return the current timezone that was defined by config or in the App > bootrap.php.

Static Yes
Parameters Parameter Type Default Description
Example
		
LPF::get_timezone();
		
	

config($config = null)

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 "."
Example
		
LPF::config('project.name');