Merge remote-tracking branch 'DavidAnderson84/patch-4' into 1.0

This commit is contained in:
terrafrost 2015-04-15 23:52:00 -05:00
commit b47813cf47

View File

@ -1784,11 +1784,12 @@ class Net_SFTP extends Net_SSH2
* @param optional Integer $mode
* @param optional Integer $start
* @param optional Integer $local_start
* @param optional callable|null $callback
* @return Boolean
* @access public
* @internal ASCII mode for SFTPv4/5/6 can be supported by adding a new function - Net_SFTP::setMode().
*/
function put($remote_file, $data, $mode = NET_SFTP_STRING, $start = -1, $local_start = -1)
function put($remote_file, $data, $mode = NET_SFTP_STRING, $start = -1, $local_start = -1, $callback = null)
{
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
return false;
@ -1885,6 +1886,9 @@ class Net_SFTP extends Net_SSH2
return false;
}
$sent+= strlen($temp);
if (is_callable($callback)) {
call_user_func($callback, $sent);
}
$i++;