PEAR_Common::downloadHttp()

PEAR_Common::downloadHttp() -- Download a file through HTTP

Synopsis

require_once 'PEAR/common.php';

string PEAR_Common::downloadHttp (string $url, object &$ui [, string $save_dir = '.' [, mixed $callback = NULL]])

Описание

Download a file through HTTP. Considers suggested file name in Content-disposition: header and can run a callback function for different events. The callback will be called with two parameters: the callback type, and parameters. The implemented callback types are:

If an HTTP proxy has been configured (http_proxy PEAR_Config setting), the proxy will be used.

Параметр

string $url

the URL to download

object &$ui

PEAR_Frontend_* instance

string $save_dir

directory to save file in

mixed $callback

function/method to call for status updates

object $config

PEAR_Config instance

Возвращаемое значение

string - Returns the full path of the downloaded file or a PEAR error on failure. If the error is caused by socket-related errors, the error object will have the fsockopen error code available through getCode().

Throws

Таблица 28-1. Возможные значения PEAR_Error

Error codeError valueMeaningSolution
 ""  

Заметка

Эта функция не должна вызываться статически.


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ