phpBB API Documentation
Class

phpbb\php\ini

class ini

Wrapper class for ini_get function.

Provides easier handling of the different interpretations of ini values.

Methods

bool|string get(string $varname)

Simple wrapper for ini_get() See http://php.net/manual/en/function.ini-get.php

bool|string get_string(string $varname)

Gets the configuration option value as a trimmed string.

bool get_bool(string $varname)

Gets configuration option value as a boolean.

bool|int get_int(string $varname)

Gets configuration option value as an integer.

bool|float get_float(string $varname)

Gets configuration option value as a float.

bool|int|float get_bytes(string $varname)

Gets configuration option value in bytes.

Details

at line 31
public bool|string get(string $varname)

Simple wrapper for ini_get() See http://php.net/manual/en/function.ini-get.php

Parameters

string $varname The configuration option name.

Return Value

bool|string False if configuration option does not exist, the configuration option value (string) otherwise.

at line 43
public bool|string get_string(string $varname)

Gets the configuration option value as a trimmed string.

Parameters

string $varname The configuration option name.

Return Value

bool|string False if configuration option does not exist, the configuration option value (string) otherwise.

at line 64
public bool get_bool(string $varname)

Gets configuration option value as a boolean.

Interprets the string value 'off' as false.

Parameters

string $varname The configuration option name.

Return Value

bool False if configuration option does not exist. False if configuration option is disabled. True otherwise.

at line 84
public bool|int get_int(string $varname)

Gets configuration option value as an integer.

Parameters

string $varname The configuration option name.

Return Value

bool|int False if configuration option does not exist, false if configuration option value is not numeric, the configuration option value (integer) otherwise.

at line 104
public bool|float get_float(string $varname)

Gets configuration option value as a float.

Parameters

string $varname The configuration option name.

Return Value

bool|float False if configuration option does not exist, false if configuration option value is not numeric, the configuration option value (float) otherwise.

at line 125
public bool|int|float get_bytes(string $varname)

Gets configuration option value in bytes.

Converts strings like '128M' to bytes (integer or float).

Parameters

string $varname The configuration option name.

Return Value

bool|int|float False if configuration option does not exist, false if configuration option value is not well-formed, the configuration option value otherwise.