#笔记(三十七)#PHP伪协议小结
编程语言
2019-03-01 08:50:52
阅读次数: 0
官方文档
大佬总结
file://— 访问本地文件系统
- 用法(file:// [文件的绝对路径和文件名])
- /path/to/file.ext
- relative/path/to/file.ext
- fileInCwd.ext
- C:/path/to/winfile.ext
- C:\path\to\winfile.ext
- \smbserver\share\path\to\winfile.ext
- file:///path/to/file.ext
http://— 访问 HTTP(s) 网址
- 允许通过 HTTP 1.0 的 GET方法,以只读访问文件或资源
- 数据流允许读取资源的 body,而 headers 则储存在了 $http_response_header 变量里
- 如果需要知道文档资源来自哪个 URL, 需要处理数据流返回的系列响应报头(response headers)
- 用法
http://example.com
http://example.com/file.php?var1=val1&var2=val2
http://user:[email protected]
https://example.com
https://example.com/file.php?var1=val1&var2=val2
https://user:[email protected]
- stream_get_meta_data
ftp:// — 访问 FTP(s) URLs
- 允许通过 FTP 读取存在的文件,以及创建新文件
- 用法
php://— 访问各个输入/输出流(I/O streams)
php://stdin, php://stdout 和 php://stderr
- 允许直接访问 PHP 进程相应的输入或者输出流
- 如果你打开 php://stdin 并在之后关了它, 仅是关闭了复制品,真正被引用的 STDIN 并不受影响
php://input
php://fd
php://memory 和 php://temp
- 允许读写临时数据
- php://temp 的内存限制可通过添加 /maxmemory:NN 来控 制,NN 是以字节为单位、保留在内存的最大数据量,超过则使用临时文件。
php://filter
- 复合链接
- php://filter/resource=<待过滤的数据流>
- php://filter/read=<读链需要应用的过滤器列表>
- php://filter/write=<写链需要应用的过滤器列表>
zlib:// — 压缩流
- 和phar://一样用于读取压缩文件,不过对于"zip://test.zip#file.txt"中的"#“要编码为”%23".因为url的#后的内容不会被传送
zip://archive.zip#dir/file.txt
zip:// [压缩文件绝对路径]#[压缩文件内的子文件名]
data:// — 数据(RFC 2397)
data://text/plain;base64,
glob:// — 查找匹配的文件路径模式
phar:// — PHP 归档
ssh2:// — Secure Shell 2
rar:// — RAR
rar://<url encoded archive name>[*][#[<url encoded entry name>]]
ogg:// — 音频流
ogg://soundfile.ogg
ogg:///path/to/soundfile.ogg
ogg://http://www.example.com/path/to/soundstream.ogg
expect:// — 处理交互式的流
转载自blog.csdn.net/weixin_43476037/article/details/88044691