ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct () | |
The Constructor. More... | |
_parse_path ($path) | |
Path Parser. More... | |
_stream_open ($path, $mode, $options, &$opened_path) | |
Opens file or URL. More... | |
_stream_read ($count) | |
Read from stream. More... | |
_stream_write ($data) | |
Write to stream. More... | |
_stream_tell () | |
Retrieve the current position of a stream. More... | |
_stream_eof () | |
Tests for end-of-file on a file pointer. More... | |
_stream_seek ($offset, $whence) | |
Seeks to specific location in a stream. More... | |
_stream_metadata ($path, $option, $var) | |
Change stream options. More... | |
_stream_cast ($cast_as) | |
Retrieve the underlaying resource. More... | |
_stream_lock ($operation) | |
Advisory file locking. More... | |
_rename ($path_from, $path_to) | |
Renames a file or directory. More... | |
_dir_opendir ($path, $options) | |
Open directory handle. More... | |
_dir_readdir () | |
Read entry from directory handle. More... | |
_dir_rewinddir () | |
Rewind directory handle. More... | |
_dir_closedir () | |
Close directory handle. More... | |
_mkdir ($path, $mode, $options) | |
Create a directory. More... | |
_rmdir ($path, $options) | |
Removes a directory. More... | |
_stream_flush () | |
Flushes the output. More... | |
_stream_stat () | |
Retrieve information about a file resource. More... | |
_unlink ($path) | |
Delete a file. More... | |
_url_stat ($path, $flags) | |
Retrieve information about a file. More... | |
_stream_truncate ($new_size) | |
Truncate stream. More... | |
_stream_set_option ($option, $arg1, $arg2) | |
Change stream options. More... | |
_stream_close () | |
Close an resource. More... | |
__call ($name, $arguments) | |
__call Magic Method More... | |
Static Public Member Functions | |
static | register ($protocol='sftp') |
Registers this class as a URL wrapper. More... | |
Data Fields | |
$sftp | |
$path | |
$mode | |
$pos | |
$size | |
$entries | |
$eof | |
$context | |
$notification | |
Static Public Attributes | |
static | $instances |
Definition at line 30 of file Stream.php.
phpseclib\Net\SFTP\Stream::__construct | ( | ) |
phpseclib\Net\SFTP\Stream::__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.
string | |
array |
Definition at line 776 of file Stream.php.
phpseclib\Net\SFTP\Stream::_dir_closedir | ( | ) |
phpseclib\Net\SFTP\Stream::_dir_opendir | ( | $path, | |
$options | |||
) |
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
string | $path | |
int | $options |
Definition at line 551 of file Stream.php.
References phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::_dir_readdir | ( | ) |
phpseclib\Net\SFTP\Stream::_dir_rewinddir | ( | ) |
phpseclib\Net\SFTP\Stream::_mkdir | ( | $path, | |
$mode, | |||
$options | |||
) |
Create a directory.
Only valid $options is STREAM_MKDIR_RECURSIVE
string | $path | |
int | $mode | |
int | $options |
Definition at line 610 of file Stream.php.
References PHPMailer\PHPMailer\$options, and phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::_parse_path | ( | $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.
string | $path |
Definition at line 154 of file Stream.php.
References phpseclib\Net\SSH2\$host, $pass, phpseclib\Net\SFTP\Stream\$path, phpseclib\Net\SSH2\$port, $query, phpseclib\Net\SFTP\Stream\$sftp, $user, and notification().
Referenced by phpseclib\Net\SFTP\Stream\_dir_opendir(), phpseclib\Net\SFTP\Stream\_mkdir(), phpseclib\Net\SFTP\Stream\_rename(), phpseclib\Net\SFTP\Stream\_rmdir(), phpseclib\Net\SFTP\Stream\_stream_metadata(), phpseclib\Net\SFTP\Stream\_stream_open(), phpseclib\Net\SFTP\Stream\_unlink(), and phpseclib\Net\SFTP\Stream\_url_stat().
phpseclib\Net\SFTP\Stream::_rename | ( | $path_from, | |
$path_to | |||
) |
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.
string | $path_from | |
string | $path_to |
Definition at line 499 of file Stream.php.
References phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::_rmdir | ( | $path, | |
$options | |||
) |
Removes a directory.
Only valid $options is STREAM_MKDIR_RECURSIVE per http://php.net/streamwrapper.rmdir, however, http://php.net/rmdir does not have a $recursive parameter as mkdir() does so I don't know how STREAM_MKDIR_RECURSIVE is supposed to be set. Also, when I try it out with rmdir() I get 8 as $options. What does 8 correspond to?
string | $path | |
int | $mode | |
int | $options |
Definition at line 634 of file Stream.php.
References phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::_stream_cast | ( | $cast_as | ) |
Retrieve the underlaying resource.
int | $cast_as |
Definition at line 470 of file Stream.php.
phpseclib\Net\SFTP\Stream::_stream_close | ( | ) |
phpseclib\Net\SFTP\Stream::_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.
Definition at line 396 of file Stream.php.
References phpseclib\Net\SFTP\Stream\$eof.
phpseclib\Net\SFTP\Stream::_stream_flush | ( | ) |
Flushes the output.
See http://php.net/fflush. Always returns true because doesn't cache stuff before writing
Definition at line 652 of file Stream.php.
phpseclib\Net\SFTP\Stream::_stream_lock | ( | $operation | ) |
Advisory file locking.
int | $operation |
Definition at line 482 of file Stream.php.
phpseclib\Net\SFTP\Stream::_stream_metadata | ( | $path, | |
$option, | |||
$var | |||
) |
Change stream options.
string | $path | |
int | $option | |
mixed | $var |
Definition at line 438 of file Stream.php.
References phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::_stream_open | ( | $path, | |
$mode, | |||
$options, | |||
& | $opened_path | ||
) |
Opens file or URL.
string | $path | |
string | $mode | |
int | $options | |
string | $opened_path |
Definition at line 260 of file Stream.php.
References phpseclib\Net\SFTP\Stream\$path, phpseclib\Net\SFTP\Stream\$size, phpseclib\Net\SFTP\Stream\_parse_path(), and phpseclib\Net\SFTP\size().
phpseclib\Net\SFTP\Stream::_stream_read | ( | $count | ) |
Read from stream.
int | $count |
Definition at line 302 of file Stream.php.
References $result, notification(), and phpseclib\Net\SFTP\size().
phpseclib\Net\SFTP\Stream::_stream_seek | ( | $offset, | |
$whence | |||
) |
Seeks to specific location in a stream.
int | $offset | |
int | $whence |
Definition at line 409 of file Stream.php.
References phpseclib\Net\SFTP\Stream\$pos, phpseclib\Net\SFTP\Stream\$size, and phpseclib\Net\SFTP\size().
phpseclib\Net\SFTP\Stream::_stream_set_option | ( | $option, | |
$arg1, | |||
$arg2 | |||
) |
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 .
int | $option | |
int | $arg1 | |
int | $arg2 |
Definition at line 747 of file Stream.php.
phpseclib\Net\SFTP\Stream::_stream_stat | ( | ) |
Retrieve information about a file resource.
Definition at line 663 of file Stream.php.
References $results.
phpseclib\Net\SFTP\Stream::_stream_tell | ( | ) |
Retrieve the current position of a stream.
Definition at line 378 of file Stream.php.
References phpseclib\Net\SFTP\Stream\$pos.
phpseclib\Net\SFTP\Stream::_stream_truncate | ( | $new_size | ) |
Truncate stream.
int | $new_size |
Definition at line 723 of file Stream.php.
References phpseclib\Net\SFTP\size().
phpseclib\Net\SFTP\Stream::_stream_write | ( | $data | ) |
Write to stream.
string | $data |
Definition at line 344 of file Stream.php.
References $data, phpseclib\Net\SFTP\Stream\$pos, $result, notification(), phpseclib\Net\SFTP\size(), and phpseclib\Net\SFTP\SOURCE_STRING.
phpseclib\Net\SFTP\Stream::_unlink | ( | $path | ) |
Delete a file.
string | $path |
Definition at line 679 of file Stream.php.
References phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::_url_stat | ( | $path, | |
$flags | |||
) |
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
string | $path | |
int | $flags |
Definition at line 701 of file Stream.php.
References $results, and phpseclib\Net\SFTP\Stream\_parse_path().
|
static |
Registers this class as a URL wrapper.
string | $protocol | The wrapper name to be registered. |
Definition at line 122 of file Stream.php.
References GuzzleHttp\Psr7\$protocol.
phpseclib\Net\SFTP\Stream::$context |
Definition at line 105 of file Stream.php.
phpseclib\Net\SFTP\Stream::$entries |
Definition at line 87 of file Stream.php.
phpseclib\Net\SFTP\Stream::$eof |
Definition at line 95 of file Stream.php.
Referenced by phpseclib\Net\SFTP\Stream\_stream_eof().
|
static |
Definition at line 39 of file Stream.php.
phpseclib\Net\SFTP\Stream::$mode |
Definition at line 63 of file Stream.php.
phpseclib\Net\SFTP\Stream::$notification |
Definition at line 113 of file Stream.php.
phpseclib\Net\SFTP\Stream::$path |
Definition at line 55 of file Stream.php.
Referenced by phpseclib\Net\SFTP\Stream\_parse_path(), and phpseclib\Net\SFTP\Stream\_stream_open().
phpseclib\Net\SFTP\Stream::$pos |
Definition at line 71 of file Stream.php.
Referenced by phpseclib\Net\SFTP\Stream\_stream_seek(), phpseclib\Net\SFTP\Stream\_stream_tell(), and phpseclib\Net\SFTP\Stream\_stream_write().
phpseclib\Net\SFTP\Stream::$sftp |
Definition at line 47 of file Stream.php.
Referenced by phpseclib\Net\SFTP\Stream\_parse_path().
phpseclib\Net\SFTP\Stream::$size |
Definition at line 79 of file Stream.php.
Referenced by phpseclib\Net\SFTP\Stream\_stream_open(), and phpseclib\Net\SFTP\Stream\_stream_seek().