mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 03:27:31 +00:00
Merge branch '2.0-callback' into 2.0
This commit is contained in:
commit
82454229f6
@ -2148,10 +2148,11 @@ class SFTP extends SSH2
|
||||
* @param string $local_file
|
||||
* @param int $offset
|
||||
* @param int $length
|
||||
* @param callable|null $progressCallback
|
||||
* @return mixed
|
||||
* @access public
|
||||
*/
|
||||
function get($remote_file, $local_file = false, $offset = 0, $length = -1)
|
||||
function get($remote_file, $local_file = false, $offset = 0, $length = -1, $progressCallback = null)
|
||||
{
|
||||
if (!($this->bitmap & SSH2::MASK_LOGIN)) {
|
||||
return false;
|
||||
@ -2217,6 +2218,9 @@ class SFTP extends SSH2
|
||||
}
|
||||
$packet = null;
|
||||
$read+= $packet_size;
|
||||
if (is_callable($progressCallback)) {
|
||||
call_user_func($progressCallback, $read);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user