abstract class driver implements driver_interface

Base class for avatar drivers

Properties

protected string $name

Avatar driver name

protected config $config

Current board configuration

protected FastImageSize $imagesize
protected string $phpbb_root_path

Current $phpbb_root_path

protected string $php_ext

Current $php_ext

protected path_helper $path_helper

Path Helper

protected driver_interface $cache

Cache driver

protected array $allowed_extensions

Array of allowed avatar image extensions Array is used for setting the allowed extensions in the fileupload class and as a base for a regex of allowed extensions, which will be formed by imploding the array with a "|".

Methods

__construct(config $config, FastImageSize $imagesize, string $phpbb_root_path, string $php_ext, path_helper $path_helper, driver_interface $cache = null)

Construct a driver object

string
get_custom_html(user $user, array $row, string $alt = '')

Returns custom html if it is needed for displaying this avatar

array
prepare_form_acp(user $user)

Prepare form for changing the acp settings of this avatar

bool
delete(array $row)

Delete avatar

string
get_name()

Returns the name of the driver.

string
get_config_name()

Returns the config name of the driver. To be used in accessing the CONFIG variables.

string
get_acp_template_name()

Get the avatar driver's template name (ACP)

set_name(string $name)

Sets the name of the driver.

Details

at line 85
__construct(config $config, FastImageSize $imagesize, string $phpbb_root_path, string $php_ext, path_helper $path_helper, driver_interface $cache = null)

Construct a driver object

Parameters

config $config

phpBB configuration

FastImageSize $imagesize

FastImageSize class

string $phpbb_root_path

Path to the phpBB root

string $php_ext

PHP file extension

path_helper $path_helper

phpBB path helper

driver_interface $cache

Cache driver

at line 98
string get_custom_html(user $user, array $row, string $alt = '')

Returns custom html if it is needed for displaying this avatar

Parameters

user $user

phpBB user object

array $row

User data or group data that has been cleaned with \phpbb\avatar\manager::clean_row

string $alt

Alternate text for avatar image

Return Value

string

HTML

at line 106
array prepare_form_acp(user $user)

Prepare form for changing the acp settings of this avatar

Parameters

user $user

phpBB user object

Return Value

array

Array of configuration options as consumed by acp_board. The setting for enabling/disabling the avatar will be handled by the avatar manager.

at line 114
bool delete(array $row)

Delete avatar

Parameters

array $row

User data or group data that has been cleaned with \phpbb\avatar\manager::clean_row

Return Value

bool

True if avatar has been deleted or there is no need to delete, i.e. when the avatar is not hosted locally.

at line 122
string get_name()

Returns the name of the driver.

Return Value

string

Name of driver.

at line 130
string get_config_name()

Returns the config name of the driver. To be used in accessing the CONFIG variables.

Return Value

string

Config name of driver.

at line 138
string get_acp_template_name()

Get the avatar driver's template name (ACP)

Return Value

string

Avatar driver's template name

at line 148
set_name(string $name)

Sets the name of the driver.

Parameters

string $name

Driver name