aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/avatar/driver/driver.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-02-08 20:46:14 +0100
committerMarc Alexander <admin@m-a-styles.de>2015-04-24 13:31:36 +0200
commit2fa99602c6f6431e99468ca13f4a58344a401c24 (patch)
tree0be2c3641e6f9b60d69130793484c8dfff5f932b /phpBB/phpbb/avatar/driver/driver.php
parent746a33b57bf9bba645c826b596fbc54ee13d1954 (diff)
downloadforums-2fa99602c6f6431e99468ca13f4a58344a401c24.tar
forums-2fa99602c6f6431e99468ca13f4a58344a401c24.tar.gz
forums-2fa99602c6f6431e99468ca13f4a58344a401c24.tar.bz2
forums-2fa99602c6f6431e99468ca13f4a58344a401c24.tar.xz
forums-2fa99602c6f6431e99468ca13f4a58344a401c24.zip
[ticket/8672] Add class for retrieving imagesize without download
getimagesize() always downloads the complete file before checking the actual image dimensions. This class will be able to do the same without having to download possibly large files. PHPBB3-8672
Diffstat (limited to 'phpBB/phpbb/avatar/driver/driver.php')
-rw-r--r--phpBB/phpbb/avatar/driver/driver.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php
index b3ced7edf7..aa92ba2012 100644
--- a/phpBB/phpbb/avatar/driver/driver.php
+++ b/phpBB/phpbb/avatar/driver/driver.php
@@ -30,6 +30,9 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
*/
protected $config;
+ /** @var \phpbb\upload\imagesize */
+ protected $imagesize;
+
/**
* Current $phpbb_root_path
* @var string
@@ -73,14 +76,16 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
* Construct a driver object
*
* @param \phpbb\config\config $config phpBB configuration
+ * @param \phpbb\upload\imagesize $imagesize phpBB imagesize class
* @param string $phpbb_root_path Path to the phpBB root
* @param string $php_ext PHP file extension
* @param \phpbb\path_helper $path_helper phpBB path helper
* @param \phpbb\cache\driver\driver_interface $cache Cache driver
*/
- public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
+ public function __construct(\phpbb\config\config $config, \phpbb\upload\imagesize $imagesize, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
{
$this->config = $config;
+ $this->imagesize = $imagesize;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->path_helper = $path_helper;