phpBB API Documentation
Class

phpbb\install\helper\iohandler\ajax_iohandler

class ajax_iohandler extends iohandler_base

Input-Output handler for the AJAX frontend

Methods

__construct(path_helper $path_helper, request_interface $request, template $template, router $router, string $root_path)

Constructor

set_language(language $language)

Set language service

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

Adds an error message to the rendering queue

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

Adds a warning message to the rendering queue

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

Adds a log message to the rendering queue

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

Adds a success message to the rendering queue

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

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

from iohandler_base
set_progress(string $task_lang_key, int $task_number)

Sets the progress information

finish_progress(string $message_lang_key)

Finish the progress bar

from iohandler_base
string generate_form_render_data(string $title, array $form)

Returns the rendering information for the form

mixed get_input(string $name, mixed $default, bool $multibyte = false)

Returns input variable

mixed get_raw_input(string $name, mixed $default)

Returns raw input variable

mixed get_server_variable(string $name, mixed $default = '')

Returns server variable

mixed get_header_variable(string $name, mixed $default = '')

Wrapper function for request_interface::header()

bool is_secure()

Returns true if the connection is encrypted

add_user_form_group(string $title, array $form)

Adds a requested data group to the rendering queue

send_response(bool $no_more_output = false)

Renders or returns response message

request_refresh()

Sends refresh request to the client

set_active_stage_menu(array $menu_path)

Marks stage as active in the navigation bar

set_finished_stage_menu(array $menu_path)

Marks stage as completed in the navigation bar

set_cookie(string $cookie_name, string $cookie_value)

Sends and sets cookies

add_download_link(string $route, string $title, string|null|array $msg = null)

Adds a download link

render_update_file_status(array $status_array)

Renders the status of update files

redirect(string $url, bool $use_ajax = false)

Redirects the user to a new page

acquire_lock()

Acquires a file lock

release_lock()

Release file lock

string lang_replace_callback(array $matches)

Callback function for language replacing

Details

at line 98
public __construct(path_helper $path_helper, request_interface $request, template $template, router $router, string $root_path)

Constructor

Parameters

path_helper $path_helper
request_interface $request HTTP request interface
template $template Template engine
router $router Router
string $root_path Path to phpBB's root

in iohandler_base at line 99
public set_language(language $language)

Set language service

Parameters

language $language

in iohandler_base at line 107
public 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.

in iohandler_base at line 119
public 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

in iohandler_base at line 127
public 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

in iohandler_base at line 135
public 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

in iohandler_base at line 143
public 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 365
public 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

in iohandler_base at line 167
public finish_progress(string $message_lang_key)

Finish the progress bar

Parameters

string $message_lang_key Language key for the message

at line 166
public 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 118
public mixed get_input(string $name, mixed $default, bool $multibyte = false)

Returns input variable

Parameters

string $name Name of the input variable to obtain
mixed $default A default value that is returned if the variable was not set. This function will always return a value of the same type as the default.
bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks

Return Value

mixed Value of the input variable

at line 126
public mixed get_raw_input(string $name, mixed $default)

Returns raw input variable

Parameters

string $name Name of the input variable to obtain
mixed $default A default value that is returned if the variable was not set. This function will always return a value of the same type as the default.

Return Value

mixed Value of the raw input variable

at line 134
public mixed get_server_variable(string $name, mixed $default = '')

Returns server variable

This function should work the same as request_interface::server().

Parameters

string $name Name of the server variable
mixed $default Default value to return when the requested variable does not exist

Return Value

mixed Value of the server variable

at line 142
public mixed get_header_variable(string $name, mixed $default = '')

Wrapper function for request_interface::header()

Parameters

string $name Name of the request header variable
mixed $default Default value to return when the requested variable does not exist

Return Value

mixed

at line 150
public bool is_secure()

Returns true if the connection is encrypted

Return Value

bool

at line 158
public add_user_form_group(string $title, array $form)

Adds a requested data group to the rendering queue

Parameters

string $title Language variable with the title of the form
array $form An array describing the required data (options etc)

at line 244
public send_response(bool $no_more_output = false)

Renders or returns response message

Parameters

bool $no_more_output Whether or not there will be more output in this output unit

at line 374
public request_refresh()

Sends refresh request to the client

at line 382
public set_active_stage_menu(array $menu_path)

Marks stage as active in the navigation bar

Parameters

array $menu_path Array to the navigation elem

at line 391
public set_finished_stage_menu(array $menu_path)

Marks stage as completed in the navigation bar

Parameters

array $menu_path Array to the navigation elem

Sends and sets cookies

Parameters

string $cookie_name Name of the cookie to set
string $cookie_value Value of the cookie to set

Adds a download link

Parameters

string $route Route for the link
string $title Language key for the title
string|null|array $msg Language key for the message

at line 430
public render_update_file_status(array $status_array)

Renders the status of update files

Parameters

array $status_array Array containing files in groups to render

at line 461
public redirect(string $url, bool $use_ajax = false)

Redirects the user to a new page

Parameters

string $url URL to redirect to
bool $use_ajax Whether or not to use AJAX redirect

at line 470
public acquire_lock()

Acquires a file lock

at line 484
public release_lock()

Release file lock

at line 500
public string lang_replace_callback(array $matches)

Callback function for language replacing

Parameters

array $matches

Return Value

string