I want to use features like here . Please check the code below.
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 my notification function to be called at least once. In fact, 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 everything works fine! The notification function is called many times. I am trying to use sftp wrapper like this
$data = file_get_contents("ssh2.sftp://username: password@host :port/path/to/big/file", false, $ctx);
And that doesn't work either. Any ideas?
Stanislav
source share