streamWrapper 类
(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)
简介
允许实现自定义协议处理程序和流,以便与其它文件系统函数(比如 fopen()、 fread() 等)一起使用。
注意:
这不是真实的类,只是如何定义协议的原型类。
注意:
不使用此处描述的方法而使用其它方式可能会导致未定义行为。
一旦流函数尝试访问与其关联的协议,就会初始化此类的实例。
类摘要
属性
- 资源 context
-
当前 context,或者没有 context 传递给调用函数,则为
null。使用 stream_context_get_options() 解析 context。
注意:
此属性必须是 public,以便 PHP 可以使用使用实际的 context 资源填充它。
目录
- streamWrapper::__construct — Constructs a new stream wrapper
- streamWrapper::__destruct — Destructs an existing stream wrapper
- streamWrapper::dir_closedir — Close directory handle
- streamWrapper::dir_opendir — Open directory handle
- streamWrapper::dir_readdir — Read entry from directory handle
- streamWrapper::dir_rewinddir — Rewind directory handle
- streamWrapper::mkdir — Create a directory
- streamWrapper::rename — Renames a file or directory
- streamWrapper::rmdir — Removes a directory
- streamWrapper::stream_cast — Retrieve the underlying resource
- streamWrapper::stream_close — Close a resource
- streamWrapper::stream_eof — Tests for end-of-file on a file pointer
- streamWrapper::stream_flush — Flushes the output
- streamWrapper::stream_lock — Advisory file locking
- streamWrapper::stream_metadata — Change stream metadata
- streamWrapper::stream_open — Opens file or URL
- streamWrapper::stream_read — Read from stream
- streamWrapper::stream_seek — Seeks to specific location in a stream
- streamWrapper::stream_set_option — Change stream options
- streamWrapper::stream_stat — Retrieve information about a file resource
- streamWrapper::stream_tell — Retrieve the current position of a stream
- streamWrapper::stream_truncate — Truncate stream
- streamWrapper::stream_write — Write to stream
- streamWrapper::unlink — Delete a file
- streamWrapper::url_stat — Retrieve information about a file