I want to use functionality like here. Please check the code bellow
function notify (
$notification_code,
$severity,
$message,
$message_code,
$bytes_transferred,
$bytes_max
) {
echo "Runned \n";
};
$ctx = stream_context_create();
stream_set_params($ctx, array('notification' => 'notify'));
$ssh_connection = ssh2_connect('myhost');
ssh2_auth_password($ssh_connection, 'login','pass');
$sftp_resource = ssh2_sftp($ssh_connection);
$data = file_get_contents("ssh2.sftp://{$sftp_resource}/path/to/big/file",
false, $ctx);
I expect that my notify function will be called at least once. Actually, the same code works for ftp wrappers
function notify (
$notification_code,
$severity,
$message,
$message_code,
$bytes_transferred,
$bytes_max
) {
echo "Runned \n";
};
$ctx = stream_context_create();
stream_set_params($ctx, array('notification' => 'notify'));
$scheme = 'ftp';
$data = file_get_contents("{scheme}://username:password@host:port/path/to/file",
false, $ctx);
And it works fine! The notify function is called many times. I try to use sftp wrapper like this
$data = file_get_contents("ssh2.sftp://username:password@host:port/path/to/big/file",
false, $ctx);
And it isn`t works too. Any ideas?