mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-14 10:53:09 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
bc62673fdd
@ -2693,14 +2693,6 @@ class SFTP extends SSH2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($length > 0 && $length <= $offset - $start) {
|
|
||||||
if ($local_file === false) {
|
|
||||||
$content = substr($content, 0, $length);
|
|
||||||
} else {
|
|
||||||
ftruncate($fp, $length + $res_offset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($fclose_check) {
|
if ($fclose_check) {
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
@ -779,5 +779,18 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
|||||||
$stat2 = $sftp->stat(self::$scratchDir);
|
$stat2 = $sftp->stat(self::$scratchDir);
|
||||||
$this->assertSame($stat['uid'], $stat2['uid']);
|
$this->assertSame($stat['uid'], $stat2['uid']);
|
||||||
$this->assertSame($stat['gid'], $stat2['gid']);
|
$this->assertSame($stat['gid'], $stat2['gid']);
|
||||||
|
|
||||||
|
return $sftp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @depends testChownChgrp
|
||||||
|
* @group github1934
|
||||||
|
*/
|
||||||
|
public function testCallableGetWithLength($sftp)
|
||||||
|
{
|
||||||
|
$sftp->put('test.txt', 'zzzzz');
|
||||||
|
$sftp->get('test.txt', function($data) {}, 0, 1);
|
||||||
|
$this->assertTrue(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user