1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/15311] Move get_temp_dir to another service

PHPBB3-15311
This commit is contained in:
Rubén Calvo
2018-05-30 23:15:31 +02:00
parent d156bf3757
commit b43268e8fc
52 changed files with 160 additions and 130 deletions

View File

@@ -17,7 +17,7 @@ use bantu\IniGetWrapper\IniGetWrapper;
use phpbb\config\config;
use phpbb\files\factory;
use phpbb\files\filespec;
use phpbb\filesystem\filesystem;
use phpbb\filesystem\temp;
use phpbb\language\language;
use phpbb\request\request_interface;
@@ -29,8 +29,8 @@ class remote extends base
/** @var factory Files factory */
protected $factory;
/** @var filesystem Filesystem */
protected $filesystem;
/** @var filesystem Filesystem temp */
protected $temp;
/** @var language */
protected $language;
@@ -41,29 +41,24 @@ class remote extends base
/** @var request_interface */
protected $request;
/** @var string phpBB root path */
protected $phpbb_root_path;
/**
* Construct a form upload type
*
* @param config $config phpBB config
* @param factory $factory Files factory
* @param filesystem $filesystem Filesystem
* @param temp $temp Filesystem temp
* @param language $language Language class
* @param IniGetWrapper $php_ini ini_get() wrapper
* @param request_interface $request Request object
* @param string $phpbb_root_path phpBB root path
*/
public function __construct(config $config, factory $factory, filesystem $filesystem, language $language, IniGetWrapper $php_ini, request_interface $request, $phpbb_root_path)
public function __construct(config $config, factory $factory, temp $temp, language $language, IniGetWrapper $php_ini, request_interface $request)
{
$this->config = $config;
$this->factory = $factory;
$this->filesystem = $filesystem;
$this->temp = $temp;
$this->language = $language;
$this->php_ini = $php_ini;
$this->request = $request;
$this->phpbb_root_path = $phpbb_root_path;
}
/**
@@ -151,7 +146,7 @@ class remote extends base
$data = $response->getBody();
$filename = tempnam($this->filesystem->get_temp_dir(), unique_id() . '-');
$filename = tempnam($this->temp->get_temp_dir(), unique_id() . '-');
if (!($fp = @fopen($filename, 'wb')))
{

View File

@@ -17,7 +17,7 @@ use bantu\IniGetWrapper\IniGetWrapper;
use phpbb\config\config;
use phpbb\files\factory;
use phpbb\files\filespec;
use phpbb\filesystem\filesystem;
use phpbb\filesystem\temp;
use phpbb\language\language;
use phpbb\request\request_interface;
@@ -29,8 +29,8 @@ class remote_storage extends base
/** @var factory Files factory */
protected $factory;
/** @var filesystem Filesystem */
protected $filesystem;
/** @var temp Filesystem temp */
protected $temp;
/** @var language */
protected $language;
@@ -41,29 +41,24 @@ class remote_storage extends base
/** @var request_interface */
protected $request;
/** @var string phpBB root path */
protected $phpbb_root_path;
/**
* Construct a form upload type
*
* @param config $config phpBB config
* @param factory $factory Files factory
* @param filesystem $filesystem Filesystem
* @param temp $temp Filesystem temp
* @param language $language Language class
* @param IniGetWrapper $php_ini ini_get() wrapper
* @param request_interface $request Request object
* @param string $phpbb_root_path phpBB root path
*/
public function __construct(config $config, factory $factory, filesystem $filesystem, language $language, IniGetWrapper $php_ini, request_interface $request, $phpbb_root_path)
public function __construct(config $config, factory $factory, temp $temp, language $language, IniGetWrapper $php_ini, request_interface $request)
{
$this->config = $config;
$this->factory = $factory;
$this->filesystem = $filesystem;
$this->temp = $temp;
$this->language = $language;
$this->php_ini = $php_ini;
$this->request = $request;
$this->phpbb_root_path = $phpbb_root_path;
}
/**
@@ -150,7 +145,7 @@ class remote_storage extends base
$data = $response->getBody();
$filename = tempnam($this->filesystem->get_temp_dir(), unique_id() . '-');
$filename = tempnam($this->temp->get_temp_dir(), unique_id() . '-');
if (!($fp = @fopen($filename, 'wb')))
{