aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaviexin <javiexin@gmail.com>2015-07-16 10:47:04 +0200
committerMarc Alexander <admin@m-a-styles.de>2016-01-02 17:16:03 +0100
commit14dc274e9e3568a276c654b0845252019525fb6f (patch)
treeeec5c905e17c86876866b380c74e2f9b285e1288
parent296243f34f32e1e811c9cc93d967e774ba2dd2e3 (diff)
downloadforums-14dc274e9e3568a276c654b0845252019525fb6f.tar
forums-14dc274e9e3568a276c654b0845252019525fb6f.tar.gz
forums-14dc274e9e3568a276c654b0845252019525fb6f.tar.bz2
forums-14dc274e9e3568a276c654b0845252019525fb6f.tar.xz
forums-14dc274e9e3568a276c654b0845252019525fb6f.zip
[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
-rw-r--r--phpBB/phpbb/avatar/driver/driver.php8
-rw-r--r--phpBB/phpbb/avatar/driver/driver_interface.php7
-rw-r--r--phpBB/phpbb/avatar/manager.php2
3 files changed, 16 insertions, 1 deletions
diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php
index b3ced7edf7..a23b626e50 100644
--- a/phpBB/phpbb/avatar/driver/driver.php
+++ b/phpBB/phpbb/avatar/driver/driver.php
@@ -120,6 +120,14 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
}
/**
+ * {@inheritdoc}
+ */
+ public function get_config_name()
+ {
+ return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
+ }
+
+ /**
* Sets the name of the driver.
*
* @param string $name Driver name
diff --git a/phpBB/phpbb/avatar/driver/driver_interface.php b/phpBB/phpbb/avatar/driver/driver_interface.php
index 835609745a..d984717d74 100644
--- a/phpBB/phpbb/avatar/driver/driver_interface.php
+++ b/phpBB/phpbb/avatar/driver/driver_interface.php
@@ -26,6 +26,13 @@ interface driver_interface
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
*
* @param array $row User data or group data that has been cleaned with
diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php
index 8d83152ed6..5274ac6a26 100644
--- a/phpBB/phpbb/avatar/manager.php
+++ b/phpBB/phpbb/avatar/manager.php
@@ -276,7 +276,7 @@ class manager
*/
public function get_driver_config_name($driver)
{
- return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($driver));
+ return $driver->get_config_name();
}
/**