|
| _stream_open ($path, $mode, $options, &$opened_path) |
|
| _stream_read ($count) |
|
| _stream_write ($data) |
|
| _stream_tell () |
|
| _stream_eof () |
|
| _stream_seek ($offset, $whence) |
|
| _stream_metadata ($path, $option, $var) |
|
| _stream_cast ($cast_as) |
|
| _stream_lock ($operation) |
|
| _rename ($path_from, $path_to) |
|
| _dir_opendir ($path, $options) |
|
| _dir_readdir () |
|
| _dir_rewinddir () |
|
| _dir_closedir () |
|
| _mkdir ($path, $mode, $options) |
|
| _rmdir ($path, $options) |
|
| _stream_flush () |
|
| _stream_stat () |
|
| _unlink ($path) |
|
| _url_stat ($path, $flags) |
|
| _stream_truncate ($new_size) |
|
| _stream_set_option ($option, $arg1, $arg2) |
|
| _stream_close () |
|
◆ __construct()
◆ __call()
__call |
( |
|
$name, |
|
|
|
$arguments |
|
) |
| |
__call Magic Method
When you're utilizing an SFTP stream you're not calling the methods in this class directly - PHP is calling them for you. Which kinda begs the question... what methods is PHP calling and what parameters is it passing to them? This function lets you figure that out.
If NET_SFTP_STREAM_LOGGING is defined all calls will be output on the screen and then (regardless of whether or not NET_SFTP_STREAM_LOGGING is enabled) the parameters will be passed through to the appropriate method.
- Paramètres
-
string | $name | |
array | $arguments | |
- Renvoie
- mixed public
Références $i, $last, $name, et $this.
◆ _dir_closedir()
Close directory handle
- Renvoie
- bool public
◆ _dir_opendir()
_dir_opendir |
( |
|
$path, |
|
|
|
$options |
|
) |
| |
|
private |
Open directory handle
The only $options is "whether or not to enforce safe_mode (0x04)". Since safe mode was deprecated in 5.3 and removed in 5.4 I'm just going to ignore it.
Also, nlist() is the best that this function is realistically going to be able to do. When an SFTP client sends a SSH_FXP_READDIR packet you don't generally get info on just one file but on multiple files. Quoting the SFTP specs:
The SSH_FXP_NAME response has the following format:
uint32 id
uint32 count
repeats count times:
string filename
string longname
ATTRS attrs
- Paramètres
-
- Renvoie
- bool public
Références Stream\$path, et Stream\parse_path().
◆ _dir_readdir()
Read entry from directory handle
- Renvoie
- mixed public
◆ _dir_rewinddir()
Rewind directory handle
- Renvoie
- bool public
◆ _mkdir()
_mkdir |
( |
|
$path, |
|
|
|
$mode, |
|
|
|
$options |
|
) |
| |
|
private |
◆ _rename()
_rename |
( |
|
$path_from, |
|
|
|
$path_to |
|
) |
| |
|
private |
Renames a file or directory
Attempts to rename oldname to newname, moving it between directories if necessary. If newname exists, it will be overwritten. This is a departure from what does.
- Paramètres
-
string | $path_from | |
string | $path_to | |
- Renvoie
- bool public
Références Stream\parse_path().
◆ _rmdir()
_rmdir |
( |
|
$path, |
|
|
|
$options |
|
) |
| |
|
private |
◆ _stream_cast()
Retrieve the underlaying resource
- Paramètres
-
- Renvoie
- resource public
◆ _stream_close()
◆ _stream_eof()
Tests for end-of-file on a file pointer
In my testing there are four classes functions that normally effect the pointer: fseek, fputs / fwrite, fgets / fread and ftruncate.
Only fgets / fread, however, results in feof() returning true. do fputs($fp, 'aaa') on a blank file and feof() will return false. do fread($fp, 1) and feof() will then return true. do fseek($fp, 10) on ablank file and feof() will return false. do fread($fp, 1) and feof() will then return true.
- Renvoie
- bool public
Références Stream\$eof.
◆ _stream_flush()
Flushes the output
See http://php.net/fflush. Always returns true because doesn't cache stuff before writing
- Renvoie
- bool public
◆ _stream_lock()
_stream_lock |
( |
|
$operation | ) |
|
|
private |
Advisory file locking
- Paramètres
-
- Renvoie
- bool public
◆ _stream_metadata()
_stream_metadata |
( |
|
$path, |
|
|
|
$option, |
|
|
|
$var |
|
) |
| |
|
private |
◆ _stream_open()
_stream_open |
( |
|
$path, |
|
|
|
$mode, |
|
|
|
$options, |
|
|
& |
$opened_path |
|
) |
| |
|
private |
◆ _stream_read()
◆ _stream_seek()
_stream_seek |
( |
|
$offset, |
|
|
|
$whence |
|
) |
| |
|
private |
◆ _stream_set_option()
_stream_set_option |
( |
|
$option, |
|
|
|
$arg1, |
|
|
|
$arg2 |
|
) |
| |
|
private |
Change stream options
STREAM_OPTION_WRITE_BUFFER isn't supported for the same reason stream_flush isn't. The other two aren't supported because of limitations in .
- Paramètres
-
int | $option | |
int | $arg1 | |
int | $arg2 | |
- Renvoie
- bool public
◆ _stream_stat()
Retrieve information about a file resource
- Renvoie
- mixed public
Références $results, et path.
◆ _stream_tell()
Retrieve the current position of a stream
- Renvoie
- int public
Références Stream\$pos.
◆ _stream_truncate()
_stream_truncate |
( |
|
$new_size | ) |
|
|
private |
Truncate stream
- Paramètres
-
- Renvoie
- bool public
Références $this.
◆ _stream_write()
◆ _unlink()
◆ _url_stat()
_url_stat |
( |
|
$path, |
|
|
|
$flags |
|
) |
| |
|
private |
Retrieve information about a file
Ignores the STREAM_URL_STAT_QUIET flag because the entirety of is quiet by default might be worthwhile to reconstruct bits 12-16 (ie. the file type) if mode doesn't have them but we'll cross that bridge when and if it's reached
- Paramètres
-
- Renvoie
- mixed public
Références Stream\$path, $results, et Stream\parse_path().
◆ parse_path()
Path Parser
Extract a path from a URI and actually connect to an SSH server if appropriate
If "notification" is set as a context parameter the message code for successful login is NET_SSH2_MSG_USERAUTH_SUCCESS. For a failed login it's NET_SSH2_MSG_USERAUTH_FAILURE.
- Paramètres
-
- Renvoie
- string private
Références Stream\$context, SSH2\$host, Stream\$path, SSH2\$port, $query, Stream\$sftp, $user, elseif, et SSH2\getConnectionByResourceId().
Référencé par Stream\_dir_opendir(), Stream\_mkdir(), Stream\_rename(), Stream\_rmdir(), Stream\_stream_metadata(), Stream\_stream_open(), Stream\_unlink(), et Stream\_url_stat().
◆ register()
static register |
( |
|
$protocol = 'sftp' | ) |
|
|
static |
Registers this class as a URL wrapper.
- Paramètres
-
string | $protocol | The wrapper name to be registered. |
- Renvoie
- bool True on success, false otherwise. public
Références Laminas\Diactoros\$protocol.
◆ $context
◆ $entries
◆ $eof
◆ $instances
◆ $mode
◆ $notification
◆ $path
◆ $pos
◆ $sftp
◆ $size
La documentation de cette classe a été générée à partir du fichier suivant :