mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/14387] Extend avatar-driver by extension in ACP not possible
Create a driver method to provide the driver config name, and use it within the manager method. Default driver config name is the same as now. But new drivers are able to override the config name with their own. PHPBB3-14387
This commit is contained in:
parent
296243f34f
commit
14dc274e9e
3 changed files with 16 additions and 1 deletions
|
@ -119,6 +119,14 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function get_config_name()
|
||||||
|
{
|
||||||
|
return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the name of the driver.
|
* Sets the name of the driver.
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,6 +25,13 @@ interface driver_interface
|
||||||
*/
|
*/
|
||||||
public function get_name();
|
public function get_name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the config name of the driver. To be used in accessing the CONFIG variables.
|
||||||
|
*
|
||||||
|
* @return string Config name of driver.
|
||||||
|
*/
|
||||||
|
public function get_config_name();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the avatar url and dimensions
|
* Get the avatar url and dimensions
|
||||||
*
|
*
|
||||||
|
|
|
@ -276,7 +276,7 @@ class manager
|
||||||
*/
|
*/
|
||||||
public function get_driver_config_name($driver)
|
public function get_driver_config_name($driver)
|
||||||
{
|
{
|
||||||
return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($driver));
|
return $driver->get_config_name();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue