abstract class iohandler_base implements iohandler_interface

Base class for installer input-output handlers

Properties

protected array $errors

Array of errors

protected array $warnings

Array of warnings

protected array $logs

Array of logs

protected array $success

Array of success messages

protected language $language
protected int $task_progress_count
protected int $current_task_progress
protected string $current_task_name
protected bool $restart_progress_bar

Methods

__construct()

Constructor

set_language(language $language)

Set language service

add_error_message(string|array $error_title, string|bool|array $error_description = false)

Adds an error message to the rendering queue

add_warning_message(string|array $warning_title, string|bool|array $warning_description = false)

Adds a warning message to the rendering queue

add_log_message(string|array $log_title, string|bool|array $log_description = false)

Adds a log message to the rendering queue

null
add_success_message(string|array $success_title, string|bool|array $success_description = false)

Adds a success message to the rendering queue

set_task_count(int $task_count, bool $restart = false)

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

set_progress(string $task_lang_key, int $task_number)

Sets the progress information

finish_progress(string $message_lang_key)

Finish the progress bar

string
generate_form_render_data(string $title, array $form)

Returns the rendering information for the form

array
translate_message(array|string $title, array|string|bool $description)

Localize message.

Details

at line 81
__construct()

Constructor

at line 99
set_language(language $language)

Set language service

Parameters

language $language

at line 107
add_error_message(string|array $error_title, string|bool|array $error_description = false)

Adds an error message to the rendering queue

Note: When an array is passed into the parameters below, it will be resolved as printf($param[0], $param[1], ...).

Parameters

string|array $error_title

Title of the error message.

string|bool|array $error_description

Description of the error (and possibly guidelines to resolve it), or false if the error description is not available.

at line 119
add_warning_message(string|array $warning_title, string|bool|array $warning_description = false)

Adds a warning message to the rendering queue

Note: When an array is passed into the parameters below, it will be resolved as printf($param[0], $param[1], ...).

Parameters

string|array $warning_title

Title of the warning message

string|bool|array $warning_description

Description of the warning (and possibly guidelines to resolve it), or false if the warning description is not available

at line 127
add_log_message(string|array $log_title, string|bool|array $log_description = false)

Adds a log message to the rendering queue

Note: When an array is passed into the parameters below, it will be resolved as printf($param[0], $param[1], ...).

Parameters

string|array $log_title

Title of the log message

string|bool|array $log_description

Description of the log, or false if the log description is not available

at line 135
null add_success_message(string|array $success_title, string|bool|array $success_description = false)

Adds a success message to the rendering queue

Note: When an array is passed into the parameters below, it will be resolved as printf($param[0], $param[1], ...).

Parameters

string|array $success_title

Title of the success message

string|bool|array $success_description

Description of the success, or false if the success description is not available

Return Value

null

at line 143
set_task_count(int $task_count, bool $restart = false)

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

Parameters

int $task_count

Number of tasks

bool $restart

Whether or not to restart the progress bar, false by default

at line 152
set_progress(string $task_lang_key, int $task_number)

Sets the progress information

Parameters

string $task_lang_key

Language key for the name of the task

int $task_number

Position of the current task in the task queue

at line 167
finish_progress(string $message_lang_key)

Finish the progress bar

Parameters

string $message_lang_key

Language key for the message

at line 180
string generate_form_render_data(string $title, array $form)

Returns the rendering information for the form

Parameters

string $title

Language variable with the title of the form

array $form

An array describing the required data (options etc)

Return Value

string

Information to render the form

at line 196
protected array translate_message(array|string $title, array|string|bool $description)

Localize message.

Note: When an array is passed into the parameters below, it will be resolved as printf($param[0], $param[1], ...).

Parameters

array|string $title

Title of the message

array|string|bool $description

Description of the message

Return Value

array

Localized message in an array