@@ 85-108 (lines=24) @@ | ||
82 | /** |
|
83 | * @return Ftp |
|
84 | */ |
|
85 | protected function prepareAdapter() |
|
86 | { |
|
87 | $config = []; |
|
88 | ||
89 | foreach ([ |
|
90 | 'host', |
|
91 | 'port', |
|
92 | 'username', |
|
93 | 'password', |
|
94 | 'ssl', |
|
95 | 'timeout', |
|
96 | 'root', |
|
97 | 'permPrivate', |
|
98 | 'permPublic', |
|
99 | 'passive', |
|
100 | 'transferMode', |
|
101 | ] as $name) { |
|
102 | if ($this->$name !== null) { |
|
103 | $config[$name] = $this->$name; |
|
104 | } |
|
105 | } |
|
106 | ||
107 | return new Ftp($config); |
|
108 | } |
|
109 | } |
|
110 |
@@ 85-106 (lines=22) @@ | ||
82 | /** |
|
83 | * @return SftpAdapter |
|
84 | */ |
|
85 | protected function prepareAdapter() |
|
86 | { |
|
87 | $config = []; |
|
88 | ||
89 | foreach ([ |
|
90 | 'host', |
|
91 | 'port', |
|
92 | 'username', |
|
93 | 'password', |
|
94 | 'timeout', |
|
95 | 'root', |
|
96 | 'privateKey', |
|
97 | 'permPrivate', |
|
98 | 'permPublic', |
|
99 | ] as $name) { |
|
100 | if ($this->$name !== null) { |
|
101 | $config[$name] = $this->$name; |
|
102 | } |
|
103 | } |
|
104 | ||
105 | return new SftpAdapter($config); |
|
106 | } |
|
107 | } |
|
108 |