Buffer
通用缓冲区流处理程序
此类提供了一个通用的缓冲区流。它可用于使用标准 PHP 文件系统 I/O 方法存储/检索/操作字符串缓冲区。
| 自 |
1.0 |
|---|---|
| 包 |
Joomla 框架 |
方法
stream_eof
用于测试文件指针是否已结束的函数
stream_eof() :
| 参见 | streamWrapper::stream_eof |
|---|---|
| 自 |
1.0 |
响应
bool如果指针位于流的末尾,则为 true
stream_open
用于打开文件或 URL 的函数
stream_open( path, mode, options, &openedPath) :
| 自 |
1.0 |
|---|---|
| 参见 | streamWrapper::stream_open |
参数
- path
string传递的 URL- mode
string用于打开文件的模式 @see fopen- options
intAPI 使用的标志,可能是 STREAM_USE_PATH 和 STREAM_REPORT_ERRORS- openedPath
string资源的完整路径。与 STREAN_USE_PATH 选项一起使用
响应
bool
stream_read
读取流
stream_read( count) :
| 参见 | streamWrapper::stream_read |
|---|---|
| 自 |
1.0 |
参数
- count
int应返回的当前位置后的数据字节数。
响应
mixed来自流的数据,最多为指定字节数(如果流中的总字节数小于 $count,则为所有数据。如果流为空,则为 null。
stream_seek
读写位置根据 $offset 和 $whence 更新
stream_seek( offset, whence) :
| 参见 | streamWrapper::stream_seek |
|---|---|
| 自 |
1.0 |
参数
- offset
int以字节为单位的偏移量- whence
int偏移量添加到的位置 选项为 SEEK_SET、SEEK_CUR 和 SEEK_END
响应
bool如果更新,则为 true
stream_tell
用于获取流当前位置的函数
stream_tell() :
| 参见 | streamWrapper::stream_tell |
|---|---|
| 自 |
1.0 |
响应
int
stream_write
写入流
stream_write( data) :
| 参见 | streamWrapper::stream_write |
|---|---|
| 自 |
1.0 |
参数
- data
string要写入流的数据。
响应
int
属性
position
流位置
| 自 |
1.0 |
|---|
类型
int
name
缓冲区名称
| 自 |
1.0 |
|---|
类型
string
buffers
缓冲区哈希
| 自 |
1.0 |
|---|
类型
array<string|int, mixed>