class Stream (View source)

SFTP Stream Wrapper

Properties

static array $instances SFTP instances
resource $context Context resource

Methods

static bool
register(string $protocol = 'sftp')

Registers this class as a URL wrapper.

__construct()

The Constructor

string
parse_path(string $path)

Path Parser

mixed
__call(string $name, array $arguments)

__call Magic Method

Details

static bool register(string $protocol = 'sftp')

Registers this class as a URL wrapper.

Parameters

string $protocol The wrapper name to be registered.

Return Value

bool True on success, false otherwise.

__construct()

The Constructor

protected string parse_path(string $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.

Parameters

string $path

Return Value

string

mixed __call(string $name, array $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.

Parameters

string $name
array $arguments

Return Value

mixed