diff options
| author | Tristan Darricau <github@nicofuma.fr> | 2015-01-15 21:52:21 +0100 |
|---|---|---|
| committer | Tristan Darricau <github@nicofuma.fr> | 2015-01-15 21:52:21 +0100 |
| commit | f616d9169ee7117fc47f3eac0d42568e2668a2fa (patch) | |
| tree | dd0bea3f4d561ca2e3c01865346ca55885c02249 | |
| parent | 98937a7a18dc605c6d3bb8a3f20f124ec71e058a (diff) | |
| parent | 17daaaf441c4972932a4fa3632eaa20132a8763e (diff) | |
| download | forums-f616d9169ee7117fc47f3eac0d42568e2668a2fa.tar forums-f616d9169ee7117fc47f3eac0d42568e2668a2fa.tar.gz forums-f616d9169ee7117fc47f3eac0d42568e2668a2fa.tar.bz2 forums-f616d9169ee7117fc47f3eac0d42568e2668a2fa.tar.xz forums-f616d9169ee7117fc47f3eac0d42568e2668a2fa.zip | |
Merge pull request #3290 from MGaetan89/ticket/13499
[ticket/13499] Move get_remote_file() to functions_compatibility.php
* MGaetan89/ticket/13499:
[ticket/13499] Move `get_remote_file()` to `functions_compatibility.php`
| -rw-r--r-- | phpBB/includes/functions_admin.php | 20 | ||||
| -rw-r--r-- | phpBB/includes/functions_compatibility.php | 20 | ||||
| -rw-r--r-- | tests/functions/get_remote_file_test.php | 2 |
3 files changed, 21 insertions, 21 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index cfd5aaa0c5..bb7022fff3 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2997,26 +2997,6 @@ function get_database_size() return $database_size; } -/** -* Retrieve contents from remotely stored file -* -* @deprecated 3.1.2 Use file_downloader instead -*/ -function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 6) -{ - global $phpbb_container; - - // Get file downloader and assign $errstr and $errno - /* @var $file_downloader \phpbb\file_downloader */ - $file_downloader = $phpbb_container->get('file_downloader'); - - $file_data = $file_downloader->get($host, $directory, $filename, $port, $timeout); - $errstr = $file_downloader->get_error_string(); - $errno = $file_downloader->get_error_number(); - - return $file_data; -} - /* * Tidy Warnings * Remove all warnings which have now expired from the database diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index c2da02456b..561c72183a 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -198,3 +198,23 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank $rank_img = $rank_data['img']; $rank_img_src = $rank_data['img_src']; } + +/** + * Retrieve contents from remotely stored file + * + * @deprecated 3.1.2 Use file_downloader instead + */ +function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 6) +{ + global $phpbb_container; + + // Get file downloader and assign $errstr and $errno + /* @var $file_downloader \phpbb\file_downloader */ + $file_downloader = $phpbb_container->get('file_downloader'); + + $file_data = $file_downloader->get($host, $directory, $filename, $port, $timeout); + $errstr = $file_downloader->get_error_string(); + $errno = $file_downloader->get_error_number(); + + return $file_data; +} diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php index d412dce164..8e9ad1105a 100644 --- a/tests/functions/get_remote_file_test.php +++ b/tests/functions/get_remote_file_test.php @@ -12,7 +12,7 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php'; /** * @group slow |
