diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-08-14 09:12:43 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-09-09 08:27:44 +0200 |
commit | f32a94ae5d5df156cc33e34a98d9a2e92385c393 (patch) | |
tree | 55d294751b0119cc20b0f2ac5ce2d9e6193ed4c0 | |
parent | dbfdb61f829166989149ac26bda36bbb4642e1af (diff) | |
download | forums-f32a94ae5d5df156cc33e34a98d9a2e92385c393.tar forums-f32a94ae5d5df156cc33e34a98d9a2e92385c393.tar.gz forums-f32a94ae5d5df156cc33e34a98d9a2e92385c393.tar.bz2 forums-f32a94ae5d5df156cc33e34a98d9a2e92385c393.tar.xz forums-f32a94ae5d5df156cc33e34a98d9a2e92385c393.zip |
[ticket/13904] Pass filesystem to upload avatar again
PHPBB3-13904
-rw-r--r-- | phpBB/config/default/container/services_avatar.yml | 1 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/upload.php | 11 | ||||
-rw-r--r-- | tests/avatar/manager_test.php | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/config/default/container/services_avatar.yml b/phpBB/config/default/container/services_avatar.yml index 67a8097e6f..76057cf5a7 100644 --- a/phpBB/config/default/container/services_avatar.yml +++ b/phpBB/config/default/container/services_avatar.yml @@ -61,6 +61,7 @@ services: - @config - %core.root_path% - %core.php_ext% + - @filesystem - @path_helper - @dispatcher - @files.factory diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index e848f9d2e7..c1ce18cb12 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -19,11 +19,16 @@ namespace phpbb\avatar\driver; class upload extends \phpbb\avatar\driver\driver { /** + * @var \phpbb\filesystem\filesystem_interface + */ + protected $filesystem; + + /** * @var \phpbb\event\dispatcher_interface */ protected $dispatcher; - /**sts + /** * @var \phpbb\files\factory */ protected $files_factory; @@ -34,16 +39,18 @@ class upload extends \phpbb\avatar\driver\driver * @param \phpbb\config\config $config phpBB configuration * @param string $phpbb_root_path Path to the phpBB root * @param string $php_ext PHP file extension + * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem helper * @param \phpbb\path_helper $path_helper phpBB path helper * @param \phpbb\event\dispatcher_interface $dispatcher phpBB Event dispatcher object * @param \phpbb\files\factory $files_factory File classes factory * @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\event\dispatcher_interface $dispatcher, \phpbb\files\factory $files_factory, \phpbb\cache\driver\driver_interface $cache = null) + public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\filesystem\filesystem_interface $filesystem, \phpbb\path_helper $path_helper, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\files\factory $files_factory, \phpbb\cache\driver\driver_interface $cache = null) { $this->config = $config; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; + $this->filesystem = $filesystem; $this->path_helper = $path_helper; $this->dispatcher = $dispatcher; $this->files_factory = $files_factory; diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index faf6976028..9003f72de2 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -83,7 +83,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case } else { - $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $dispatcher, $files_factory, $cache)); + $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $filesystem, $path_helper, $dispatcher, $files_factory, $cache)); } $cur_avatar->expects($this->any()) ->method('get_name') |