mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-29 10:39:19 +02:00
[feature/avatars] Docblock fixes and small change for php_ext
PHPBB3-10018
This commit is contained in:
parent
a77fcdb5f9
commit
6522190ff1
@ -23,26 +23,6 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
|||||||
{
|
{
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the driver.
|
|
||||||
*
|
|
||||||
* @return string Name of wrapped driver.
|
|
||||||
*/
|
|
||||||
public function get_name()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the name of the driver.
|
|
||||||
*
|
|
||||||
* @param string $name The driver name
|
|
||||||
*/
|
|
||||||
public function set_name($name)
|
|
||||||
{
|
|
||||||
$this->name = $name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current board configuration
|
* Current board configuration
|
||||||
* @type phpbb_config
|
* @type phpbb_config
|
||||||
@ -50,8 +30,8 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
|||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current board configuration
|
* Request object
|
||||||
* @type phpbb_config
|
* @type phpbb_request
|
||||||
*/
|
*/
|
||||||
protected $request;
|
protected $request;
|
||||||
|
|
||||||
@ -62,10 +42,10 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
|||||||
protected $phpbb_root_path;
|
protected $phpbb_root_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current $phpEx
|
* Current $php_ext
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
protected $phpEx;
|
protected $php_ext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A cache driver
|
* A cache driver
|
||||||
@ -83,18 +63,18 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
|||||||
/**
|
/**
|
||||||
* Construct a driver object
|
* Construct a driver object
|
||||||
*
|
*
|
||||||
* @param $config The phpBB configuration
|
* @param phpbb_config $config The phpBB configuration
|
||||||
* @param $request The request object
|
* @param phpbb_request $request The request object
|
||||||
* @param $phpbb_root_path The path to the phpBB root
|
* @param string $phpbb_root_path The path to the phpBB root
|
||||||
* @param $phpEx The php file extension
|
* @param string $php_ext The php file extension
|
||||||
* @param $cache A cache driver
|
* @param phpbb_cache_driver_interface $cache A cache driver
|
||||||
*/
|
*/
|
||||||
public function __construct(phpbb_config $config, phpbb_request $request, $phpbb_root_path, $phpEx, phpbb_cache_driver_interface $cache = null)
|
public function __construct(phpbb_config $config, phpbb_request $request, $phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null)
|
||||||
{
|
{
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->phpEx = $phpEx;
|
$this->php_ext = $php_ext;
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,4 +150,22 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
|||||||
|
|
||||||
return $template;
|
return $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function get_name()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the name of the driver.
|
||||||
|
*
|
||||||
|
* @param string $name The driver name
|
||||||
|
*/
|
||||||
|
public function set_name($name)
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
|
|||||||
$row['avatar_width'] = $this->request->variable('avatar_gravatar_width', 0);
|
$row['avatar_width'] = $this->request->variable('avatar_gravatar_width', 0);
|
||||||
$row['avatar_height'] = $this->request->variable('avatar_gravatar_height', 0);
|
$row['avatar_height'] = $this->request->variable('avatar_gravatar_height', 0);
|
||||||
|
|
||||||
require_once($this->phpbb_root_path . 'includes/functions_user' . $this->phpEx);
|
require_once($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
|
||||||
|
|
||||||
$error = array_merge($error, validate_data(array(
|
$error = array_merge($error, validate_data(array(
|
||||||
'email' => $row['avatar'],
|
'email' => $row['avatar'],
|
||||||
|
@ -82,7 +82,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
|||||||
$url = 'http://' . $url;
|
$url = 'http://' . $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once($this->phpbb_root_path . 'includes/functions_user' . $this->phpEx);
|
require_once($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
|
||||||
|
|
||||||
$error = array_merge($error, validate_data(array(
|
$error = array_merge($error, validate_data(array(
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
@ -128,7 +128,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($this->phpbb_root_path . 'includes/functions_upload' . $this->phpEx);
|
include_once($this->phpbb_root_path . 'includes/functions_upload' . $this->php_ext);
|
||||||
$types = fileupload::image_types();
|
$types = fileupload::image_types();
|
||||||
$extension = strtolower(filespec::get_extension($url));
|
$extension = strtolower(filespec::get_extension($url));
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
|||||||
if ($ignore_config || $this->config['allow_avatar_upload'])
|
if ($ignore_config || $this->config['allow_avatar_upload'])
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'src' => $this->phpbb_root_path . 'download/file' . $this->phpEx . '?avatar=' . $row['avatar'],
|
'src' => $this->phpbb_root_path . 'download/file' . $this->php_ext . '?avatar=' . $row['avatar'],
|
||||||
'width' => $row['avatar_width'],
|
'width' => $row['avatar_width'],
|
||||||
'height' => $row['avatar_height'],
|
'height' => $row['avatar_height'],
|
||||||
);
|
);
|
||||||
@ -72,7 +72,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($this->phpbb_root_path . 'includes/functions_upload' . $this->phpEx);
|
include_once($this->phpbb_root_path . 'includes/functions_upload' . $this->php_ext);
|
||||||
|
|
||||||
$upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
|
$upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user