class config

Stores common settings and installation status

Properties

protected filesystem_interface $filesystem
protected array $installer_config

Array which contains config settings for the installer

protected string $install_config_file
protected IniGetWrapper $php_ini
protected string $phpbb_root_path
protected array $progress_data

Array containing progress information

protected array $system_data

Array containing system information

protected array $navigation_data

Array containing navigation bar information

protected bool $do_clean_up

Flag indicating that config file should be cleaned up

Methods

__construct(filesystem_interface $filesystem, IniGetWrapper $php_ini, $phpbb_root_path)

Constructor

mixed
get(string $param_name, mixed $default = false)

Returns data for a specified parameter

set(string $param_name, mixed $value)

Sets a parameter in installer_config

mixed
system_get(string $param_name)

Returns system parameter

int
get_time_remaining()

Returns remaining time until the run time limit

int
get_memory_remaining()

Returns remaining memory available for PHP

set_finished_task(int $task_service_index)

Saves the latest executed task

set_active_module(string $module_service_name, int $module_service_index)

Set active module

array
get_progress_data()

Getter for progress data

load_config()

Recovers install configuration from file

create_progress_restart_point(string $name)

Creates a progress restart point

bool
jump_to_restart_point(string $name)

Set restart point to continue from

bool
has_restart_point(string $name)

Returns whether a restart point with a given name exists or not

save_config()

Dumps install configuration to disk

increment_current_task_progress(int $increment_by = 1)

Increments the task progress

set_current_task_progress(int $task_progress)

Sets the task progress to a specific number

set_task_progress_count(int $task_progress_count)

Sets the number of tasks belonging to the installer in the current mode.

int
get_current_task_progress()

Returns the number of the current task being executed

int
get_task_progress_count()

Returns the number of tasks belonging to the installer in the current mode.

set_finished_navigation_stage(array $nav_path)

Marks stage as completed in the navigation bar

set_active_navigation_stage(array $nav_path)

Marks stage as active in the navigation bar

array
get_navigation_data()

Returns navigation data

clean_up_config_file()

Removes install config file

setup_system_data()

Filling up system_data array

Details

at line 86
__construct(filesystem_interface $filesystem, IniGetWrapper $php_ini, $phpbb_root_path)

Constructor

Parameters

filesystem_interface $filesystem
IniGetWrapper $php_ini
$phpbb_root_path

at line 122
mixed get(string $param_name, mixed $default = false)

Returns data for a specified parameter

Parameters

string $param_name

Name of the parameter to return

mixed $default

Default value to return when the specified data does not exist.

Return Value

mixed

value of the specified parameter or the default value if the data cannot be recovered.

at line 133
set(string $param_name, mixed $value)

Sets a parameter in installer_config

Parameters

string $param_name

Name of the parameter

mixed $value

Values to set the parameter

at line 147
mixed system_get(string $param_name)

Returns system parameter

Parameters

string $param_name

Name of the parameter

Return Value

mixed

Returns system parameter if it is defined, false otherwise

at line 157
int get_time_remaining()

Returns remaining time until the run time limit

Return Value

int

Remaining time until the run time limit in seconds

at line 172
int get_memory_remaining()

Returns remaining memory available for PHP

Return Value

int

Remaining memory until reaching the limit

at line 193
set_finished_task(int $task_service_index)

Saves the latest executed task

Parameters

int $task_service_index

Index of the installer task service in the module

at line 204
set_active_module(string $module_service_name, int $module_service_index)

Set active module

Parameters

string $module_service_name

Name of the installer module service

int $module_service_index

Index of the installer module service

at line 215
array get_progress_data()

Getter for progress data

Return Value

array

at line 223
load_config()

Recovers install configuration from file

at line 259
create_progress_restart_point(string $name)

Creates a progress restart point

Restart points can be used to repeat certain tasks periodically. You need to call this method from the first task you want to repeat.

Parameters

string $name

Name of the restart point

at line 274
bool jump_to_restart_point(string $name)

Set restart point to continue from

Parameters

string $name

Name of the restart point

Return Value

bool

Returns false if the restart point name does not exist, otherwise true

at line 296
bool has_restart_point(string $name)

Returns whether a restart point with a given name exists or not

Parameters

string $name

Name of the restart point

Return Value

bool

at line 304
save_config()

Dumps install configuration to disk

at line 342
increment_current_task_progress(int $increment_by = 1)

Increments the task progress

Parameters

int $increment_by

The amount to increment by

at line 357
set_current_task_progress(int $task_progress)

Sets the task progress to a specific number

Parameters

int $task_progress

The task progress number to be set

at line 367
set_task_progress_count(int $task_progress_count)

Sets the number of tasks belonging to the installer in the current mode.

Parameters

int $task_progress_count

Number of tasks

at line 377
int get_current_task_progress()

Returns the number of the current task being executed

Return Value

int

at line 387
int get_task_progress_count()

Returns the number of tasks belonging to the installer in the current mode.

Return Value

int

at line 397
set_finished_navigation_stage(array $nav_path)

Marks stage as completed in the navigation bar

Parameters

array $nav_path

Array to the navigation elem

at line 412
set_active_navigation_stage(array $nav_path)

Marks stage as active in the navigation bar

Parameters

array $nav_path

Array to the navigation elem

at line 422
array get_navigation_data()

Returns navigation data

Return Value

array

at line 430
clean_up_config_file()

Removes install config file

at line 439
protected setup_system_data()

Filling up system_data array