.htaccess
9 months ago
ChunkedDownload.php
9 months ago
ChunkedUpload.php
9 months ago
DirIterator.php
9 months ago
FTP.php
9 months ago
FTPClient.php
9 months ago
index.html
9 months ago
web.config
9 months ago
ChunkedDownload.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace JetBackup\Destination\Vendors\FTP; |
| 4 | |
| 5 | use JetBackup\Destination\Integration\DestinationChunkedDownload; |
| 6 | |
| 7 | if (!defined( '__JETBACKUP__')) die('Direct access is not allowed'); |
| 8 | |
| 9 | class ChunkedDownload implements DestinationChunkedDownload { |
| 10 | |
| 11 | private FTP $_client; |
| 12 | private string $_source; |
| 13 | private string $_destination; |
| 14 | |
| 15 | public function __construct(FTP $client, $source, $destination) { |
| 16 | $this->_client = $client; |
| 17 | $this->_source = $source; |
| 18 | $this->_destination = $destination; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @return string |
| 23 | */ |
| 24 | public function download(int $start, int $end):int { |
| 25 | $this->_client->_client('download', $this->_source, $this->_destination, $start, $end); |
| 26 | return $end - $start + 1; |
| 27 | } |
| 28 | } |