diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index 88f010751a..8a58a078f8 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -186,4 +186,5 @@ services: arguments: - @cache - @config + - @file_downloader - @user diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index c3c3602944..3b455ec5ba 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -50,6 +50,9 @@ class version_helper /** @var \phpbb\config\config */ protected $config; + /** @var \phpbb\file_downloader */ + protected $file_downloader; + /** @var \phpbb\user */ protected $user; @@ -58,12 +61,14 @@ class version_helper * * @param \phpbb\cache\service $cache * @param \phpbb\config\config $config + * @param \phpbb\file_downloader $file_downloader * @param \phpbb\user $user */ - public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, \phpbb\user $user) + public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, file_downloader $file_downloader, \phpbb\user $user) { $this->cache = $cache; $this->config = $config; + $this->file_downloader = $file_downloader; $this->user = $user; if (defined('PHPBB_QA')) @@ -250,7 +255,9 @@ class version_helper else if ($info === false || $force_update) { $errstr = $errno = ''; - $info = get_remote_file($this->host, $this->path, $this->file, $errstr, $errno); + $this->file_downloader->set_error_number($errno) + ->set_error_string($errstr); + $info = $this->file_downloader->get($this->host, $this->path, $this->file); if (!empty($errstr)) {