class config_php_file

Properties

protected string $phpbb_root_path
protected string $php_ext
protected bool $config_loaded

Indicates whether the php config file has been loaded.

protected array $config_data

The content of the php config file

protected string $config_file

The path to the config file. (Default: $phpbb_root_path . 'config.' . $php_ext)

Methods

__construct(string $phpbb_root_path, string $php_ext)

Constructor

set_config_file(string $config_file)

Set the path to the config file.

array
get_all()

Returns an associative array containing the variables defined by the config file.

mixed
get(string $variable)

Return the value of a variable defined into the config.php file or null if the variable does not exist.

null
load_config_file()

Load the config file and store the information.

string
convert_30_dbms_to_31(string $dbms)

Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.

Details

at line 53
__construct(string $phpbb_root_path, string $php_ext)

Constructor

Parameters

string $phpbb_root_path

phpBB Root Path

string $php_ext

php file extension

at line 65
set_config_file(string $config_file)

Set the path to the config file.

Parameters

string $config_file

at line 76
array get_all()

Returns an associative array containing the variables defined by the config file.

Return Value

array

Return the content of the config file or an empty array if the file does not exists.

at line 89
mixed get(string $variable)

Return the value of a variable defined into the config.php file or null if the variable does not exist.

Parameters

string $variable

The name of the variable

Return Value

mixed

Value of the variable or null if the variable is not defined.

at line 101
protected null load_config_file()

Load the config file and store the information.

Return Value

null

at line 125
string convert_30_dbms_to_31(string $dbms)

Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.

If $dbms is a valid 3.1 db driver class name, returns it unchanged. Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms to 3.1 db driver class name.

Parameters

string $dbms

dbms parameter

Return Value

string

driver class

Exceptions

RuntimeException