Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 88.24% |
Changes | 0 |
1 | <?php |
||
17 | class Ftp extends Adapter |
||
18 | { |
||
19 | public $host = null; |
||
20 | public $ssl = false; |
||
21 | public $port = 21; |
||
22 | public $timeout = 90; |
||
23 | public $login = null; |
||
24 | public $password = null; |
||
25 | public $dir = null; |
||
26 | public $fileName = null; |
||
27 | protected $client = null; |
||
28 | 1 | public function getFiles() { |
|
29 | 1 | $client = $this->getClient(); |
|
30 | 1 | $file = $this->createFile($this->fileName); |
|
31 | |||
32 | 1 | $client->connect($this->host, $this->ssl, $this->port, $this->timeout); |
|
33 | 1 | $client->login($this->login, $this->password); |
|
34 | 1 | $client->raw('OPTS UTF8 ON'); |
|
35 | 1 | $client->pasv(true); |
|
36 | 1 | $client->get($file->filePath, trim($this->dir, '/') . '/' . $this->fileName, FTP_BINARY); |
|
37 | |||
38 | return [ |
||
39 | 1 | $file, |
|
40 | ]; |
||
41 | } |
||
42 | |||
43 | 1 | public function setClient($client) { |
|
46 | } |
||
47 | |||
48 | 1 | public function getClient() { |
|
56 | } |
||
57 | } |