mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/13904] Pass filesystem to upload avatar again
PHPBB3-13904
This commit is contained in:
parent
dbfdb61f82
commit
f32a94ae5d
3 changed files with 11 additions and 3 deletions
|
@ -61,6 +61,7 @@ services:
|
||||||
- @config
|
- @config
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- %core.php_ext%
|
- %core.php_ext%
|
||||||
|
- @filesystem
|
||||||
- @path_helper
|
- @path_helper
|
||||||
- @dispatcher
|
- @dispatcher
|
||||||
- @files.factory
|
- @files.factory
|
||||||
|
|
|
@ -18,12 +18,17 @@ namespace phpbb\avatar\driver;
|
||||||
*/
|
*/
|
||||||
class upload extends \phpbb\avatar\driver\driver
|
class upload extends \phpbb\avatar\driver\driver
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var \phpbb\filesystem\filesystem_interface
|
||||||
|
*/
|
||||||
|
protected $filesystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \phpbb\event\dispatcher_interface
|
* @var \phpbb\event\dispatcher_interface
|
||||||
*/
|
*/
|
||||||
protected $dispatcher;
|
protected $dispatcher;
|
||||||
|
|
||||||
/**sts
|
/**
|
||||||
* @var \phpbb\files\factory
|
* @var \phpbb\files\factory
|
||||||
*/
|
*/
|
||||||
protected $files_factory;
|
protected $files_factory;
|
||||||
|
@ -34,16 +39,18 @@ class upload extends \phpbb\avatar\driver\driver
|
||||||
* @param \phpbb\config\config $config phpBB configuration
|
* @param \phpbb\config\config $config phpBB configuration
|
||||||
* @param string $phpbb_root_path Path to the phpBB root
|
* @param string $phpbb_root_path Path to the phpBB root
|
||||||
* @param string $php_ext PHP file extension
|
* @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\path_helper $path_helper phpBB path helper
|
||||||
* @param \phpbb\event\dispatcher_interface $dispatcher phpBB Event dispatcher object
|
* @param \phpbb\event\dispatcher_interface $dispatcher phpBB Event dispatcher object
|
||||||
* @param \phpbb\files\factory $files_factory File classes factory
|
* @param \phpbb\files\factory $files_factory File classes factory
|
||||||
* @param \phpbb\cache\driver\driver_interface $cache Cache driver
|
* @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->config = $config;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
$this->filesystem = $filesystem;
|
||||||
$this->path_helper = $path_helper;
|
$this->path_helper = $path_helper;
|
||||||
$this->dispatcher = $dispatcher;
|
$this->dispatcher = $dispatcher;
|
||||||
$this->files_factory = $files_factory;
|
$this->files_factory = $files_factory;
|
||||||
|
|
|
@ -83,7 +83,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||||
}
|
}
|
||||||
else
|
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())
|
$cur_avatar->expects($this->any())
|
||||||
->method('get_name')
|
->method('get_name')
|
||||||
|
|
Loading…
Add table
Reference in a new issue