1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/avatars] Fix the docs and small naming fixes

PHPBB3-10018
This commit is contained in:
Marc Alexander
2012-11-19 00:30:18 +01:00
parent bea6e845d3
commit 8d0c667dce
7 changed files with 71 additions and 20 deletions

View File

@@ -26,25 +26,37 @@ class phpbb_avatar_manager
private $request;
private $cache;
private static $valid_drivers = false;
private $tasks;
private $avatar_drivers;
private $container;
/**
* @TODO
* Construct an avatar manager object
*
* @param $phpbb_root_path The path to the phpBB root
* @param $phpEx The php file extension
* @param $config The phpBB configuration
* @param $request The request object
* @param $cache A cache driver
* @param $avatar_drivers The avatars drivers passed via the service container
* @param $container The container object
**/
public function __construct($phpbb_root_path, $phpEx, phpbb_config $config, phpbb_request $request, phpbb_cache_driver_interface $cache, $tasks, $container)
public function __construct($phpbb_root_path, $phpEx, phpbb_config $config, phpbb_request $request, phpbb_cache_driver_interface $cache, $avatar_drivers, $container)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
$this->config = $config;
$this->request = $request;
$this->cache = $cache;
$this->tasks = $tasks;
$this->avatar_drivers = $avatar_drivers;
$this->container = $container;
}
/**
* @TODO
* Get the driver object specified by the avatar type
*
* @param string The avatar type; by default an avatar's service container name
*
* @return object The avatar driver object
**/
public function get_driver($avatar_type)
{
@@ -87,14 +99,15 @@ class phpbb_avatar_manager
}
/**
* @TODO
* Load the list of valid drivers
* This is executed once and fills self::$valid_drivers
**/
private function load_valid_drivers()
{
if (!empty($this->tasks))
if (!empty($this->avatar_drivers))
{
self::$valid_drivers = array();
foreach ($this->tasks as $driver)
foreach ($this->avatar_drivers as $driver)
{
self::$valid_drivers[] = $driver->get_name();
}
@@ -102,7 +115,9 @@ class phpbb_avatar_manager
}
/**
* @TODO
* Get a list of valid avatar drivers
*
* @return array An array containing a list of the valid avatar drivers
**/
public function get_valid_drivers()
{
@@ -116,6 +131,11 @@ class phpbb_avatar_manager
/**
* Strip out user_ and group_ prefixes from keys
*
* @param array $row The user data or group data
*
* @return array The user data or group data with keys that have been
* stripped from the preceding "user_" or "group_"
**/
public static function clean_row($row)
{