Method | Description | |
---|---|---|
curlDownload ( string $remote, string $local ) : mixed | 采集远程文件 | |
download ( string $filename, string $showname = '', string $content = '', integer $expire = 180 ) : void | 下载文件 可以指定下载显示的文件名,并自动发送相应的Header信息 如果指定了content参数,则下载该参数的内容 | |
fsockopenDownload ( string $url, array $conf = [] ) : mixed | 使用 fsockopen 通过 HTTP 协议直接访问(采集)远程文件 如果主机或服务器没有开启 CURL 扩展可考虑使用 fsockopen 比 CURL 稍慢,但性能稳定 | |
getHeaderInfo ( string $header = '', boolean $echo = true ) : string | 显示HTTP Header 信息 | |
mimeContentType ( string $filename ) : string | 获取文件的mime_content类型 | |
sendHttpStatus ( integer $code ) | HTTP Protocol defined status codes |
public static fsockopenDownload ( string $url, array $conf = [] ) : mixed | ||
$url | string | 远程URL |
$conf | array | 其他配置信息 int limit 分段读取字符个数 string post post的内容,字符串或数组,key=value&形式 string cookie 携带cookie访问,该参数是cookie内容 string ip 如果该参数传入,$url将不被使用,ip访问优先 int timeout 采集超时时间 bool block 是否阻塞访问,默认为true |
return | mixed |
public static mimeContentType ( string $filename ) : string | ||
$filename | string | |
return | string |
public static sendHttpStatus ( integer $code ) | ||
$code | integer |