Wrappers
Aus PHP-Wiki
- Inhaltsverzeichnis</DT >
- wrappers#wrappers.file Filesystem</DT >
- wrappers.http</DT >
- wrappers.ftp</DT >
- wrappers.php</DT >
- wrappers.compression</DT >
- wrappers#wrappers.file Filesystem</DT >
The following is a list of the various URL style protocols that PHP has built-in for use with the filesystem functions such as function.fopen and function.copy. In addition to these wrappers, as of PHP 4.3.0, you can write your own wrappers using PHP script and function.stream-wrapper-register.
FilesystemAll versions of PHP. Explicitly using file:// since PHP 4.3.0
/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
file:// is the default wrapper used with PHP and represents the local filesystem. When a relative path is specified (a path which does not begin with /, \, \\, or a windows drive letter) the path provided will be applied against the current working directory. In many cases this is the directory in which the script resides unless it has been changed. Using the CLI sapi, this defaults to the directory from which the script was called.
With some functions, such as function.fopen and function.file-get-contents, include_path may be optionally searched for relative paths as well.
<P >Tabelle J-1. Wrapper Summary</P ><THEAD >Attribute Supported </THEAD ><TBODY >Restricted by allow_url_fopen. No Allows Reading Yes Allows Writing Yes Allows Appending Yes Allows Simultaneous Reading and Writing Yes Supports function.stat Yes Supports function.unlink Yes Supports function.rename Yes Supports function.mkdir Yes Supports function.rmdir Yes </TBODY >
</DIV >
/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
<P >Tabelle J-1. Wrapper Summary</P >
| Attribute | Supported |
|---|---|
| Restricted by allow_url_fopen. | No |
| Allows Reading | Yes |
| Allows Writing | Yes |
| Allows Appending | Yes |
| Allows Simultaneous Reading and Writing | Yes |
| Supports function.stat | Yes |
| Supports function.unlink | Yes |
| Supports function.rename | Yes |
| Supports function.mkdir | Yes |
| Supports function.rmdir | Yes |