@@ -339,7 +339,7 @@ |
||
339 | 339 | * |
340 | 340 | * @param string $path |
341 | 341 | * |
342 | - * @return array|false |
|
342 | + * @return string |
|
343 | 343 | */ |
344 | 344 | public function getMetadata($path) |
345 | 345 | { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->connection = new Curl(); |
50 | 50 | $this->connection->setOptions([ |
51 | 51 | CURLOPT_URL => $this->getUrl(), |
52 | - CURLOPT_USERPWD => $this->getUsername() . ':' . $this->getPassword(), |
|
52 | + CURLOPT_USERPWD => $this->getUsername().':'.$this->getPassword(), |
|
53 | 53 | CURLOPT_SSL_VERIFYPEER => false, |
54 | 54 | CURLOPT_SSL_VERIFYHOST => false, |
55 | 55 | CURLOPT_FTP_SSL => CURLFTPSSL_TRY, |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $connection = $this->getConnection(); |
121 | 121 | |
122 | 122 | $result = $connection->exec([ |
123 | - CURLOPT_URL => $this->getUrl() . '/' . $path, |
|
123 | + CURLOPT_URL => $this->getUrl().'/'.$path, |
|
124 | 124 | CURLOPT_UPLOAD => 1, |
125 | 125 | CURLOPT_INFILE => $resource, |
126 | 126 | ]); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $connection = $this->getConnection(); |
176 | 176 | |
177 | 177 | $result = $connection->exec([ |
178 | - CURLOPT_POSTQUOTE => ['RNFR ' . $this->getRoot() . '/' . $path, 'RNTO ' . $this->getRoot() . '/' . $newpath], |
|
178 | + CURLOPT_POSTQUOTE => ['RNFR '.$this->getRoot().'/'.$path, 'RNTO '.$this->getRoot().'/'.$newpath], |
|
179 | 179 | ]); |
180 | 180 | |
181 | 181 | return $result !== false; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | return false; |
198 | 198 | } |
199 | 199 | |
200 | - return $this->write($this->getRoot() . '/' . $newpath, $file['contents'], new Config()) !== false; |
|
200 | + return $this->write($this->getRoot().'/'.$newpath, $file['contents'], new Config()) !== false; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $connection = $this->getConnection(); |
213 | 213 | |
214 | 214 | $result = $connection->exec([ |
215 | - CURLOPT_POSTQUOTE => ['DELE ' . $this->getRoot() . '/' . $path], |
|
215 | + CURLOPT_POSTQUOTE => ['DELE '.$this->getRoot().'/'.$path], |
|
216 | 216 | ]); |
217 | 217 | |
218 | 218 | return $result !== false; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $connection = $this->getConnection(); |
231 | 231 | |
232 | 232 | $result = $connection->exec([ |
233 | - CURLOPT_POSTQUOTE => ['RMD ' . $this->getRoot() . '/' . $dirname], |
|
233 | + CURLOPT_POSTQUOTE => ['RMD '.$this->getRoot().'/'.$dirname], |
|
234 | 234 | ]); |
235 | 235 | |
236 | 236 | return $result !== false; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $connection = $this->getConnection(); |
250 | 250 | |
251 | 251 | $result = $connection->exec([ |
252 | - CURLOPT_POSTQUOTE => ['MKD ' . $this->getRoot() . '/' . $dirname], |
|
252 | + CURLOPT_POSTQUOTE => ['MKD '.$this->getRoot().'/'.$dirname], |
|
253 | 253 | ]); |
254 | 254 | |
255 | 255 | if ($result === false) { |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | $connection = $this->getConnection(); |
320 | 320 | |
321 | 321 | $result = $connection->exec([ |
322 | - CURLOPT_URL => $this->getUrl() . '/' . $path, |
|
322 | + CURLOPT_URL => $this->getUrl().'/'.$path, |
|
323 | 323 | CURLOPT_FILE => $stream, |
324 | 324 | ]); |
325 | 325 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | return ['type' => 'dir', 'path' => '']; |
348 | 348 | } |
349 | 349 | |
350 | - $request = rtrim('LIST -A ' . $this->normalizePath($this->getRoot() . '/' . $path)); |
|
350 | + $request = rtrim('LIST -A '.$this->normalizePath($this->getRoot().'/'.$path)); |
|
351 | 351 | |
352 | 352 | $connection = $this->getConnection(); |
353 | 353 | $result = $connection->exec([CURLOPT_CUSTOMREQUEST => $request]); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | */ |
387 | 387 | public function getTimestamp($path) |
388 | 388 | { |
389 | - $response = $this->rawCommand('MDTM ' . $this->getRoot() . '/' . $path); |
|
389 | + $response = $this->rawCommand('MDTM '.$this->getRoot().'/'.$path); |
|
390 | 390 | list($code, $time) = explode(' ', end($response), 2); |
391 | 391 | if ($code !== '213') { |
392 | 392 | return false; |
@@ -405,10 +405,10 @@ discard block |
||
405 | 405 | protected function listDirectoryContents($directory, $recursive = false) |
406 | 406 | { |
407 | 407 | if ($recursive === true) { |
408 | - return $this->listDirectoryContentsRecursive($this->getRoot() . '/' . $directory); |
|
408 | + return $this->listDirectoryContentsRecursive($this->getRoot().'/'.$directory); |
|
409 | 409 | } |
410 | 410 | |
411 | - $request = rtrim('LIST -aln ' . $this->normalizePath($this->getRoot() . '/' . $directory)); |
|
411 | + $request = rtrim('LIST -aln '.$this->normalizePath($this->getRoot().'/'.$directory)); |
|
412 | 412 | |
413 | 413 | $connection = $this->getConnection(); |
414 | 414 | $result = $connection->exec([CURLOPT_CUSTOMREQUEST => $request]); |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | */ |
431 | 431 | protected function listDirectoryContentsRecursive($directory) |
432 | 432 | { |
433 | - $request = rtrim('LIST -aln ' . $this->normalizePath($this->getRoot() . '/' . $directory)); |
|
433 | + $request = rtrim('LIST -aln '.$this->normalizePath($this->getRoot().'/'.$directory)); |
|
434 | 434 | |
435 | 435 | $connection = $this->getConnection(); |
436 | 436 | $result = $connection->exec([CURLOPT_CUSTOMREQUEST => $request]); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $output[] = $item; |
444 | 444 | } elseif ($item['type'] === 'dir') { |
445 | 445 | $output = array_merge($output, |
446 | - $this->listDirectoryContentsRecursive($this->getRoot() . '/' . $item['path'])); |
|
446 | + $this->listDirectoryContentsRecursive($this->getRoot().'/'.$item['path'])); |
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | // split up the permission groups |
468 | 468 | $parts = str_split($permissions, 3); |
469 | 469 | // convert the groups |
470 | - $mapper = function ($part) { |
|
470 | + $mapper = function($part) { |
|
471 | 471 | return array_sum(str_split($part)); |
472 | 472 | }; |
473 | 473 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | protected function rawCommand($command) |
523 | 523 | { |
524 | 524 | $response = ''; |
525 | - $callback = function ($ch, $string) use (&$response) { |
|
525 | + $callback = function($ch, $string) use (&$response) { |
|
526 | 526 | $response .= $string; |
527 | 527 | |
528 | 528 | return strlen($string); |
@@ -538,6 +538,6 @@ discard block |
||
538 | 538 | |
539 | 539 | protected function getUrl() |
540 | 540 | { |
541 | - return $this->protocol . '://' . $this->getHost() . ':' . $this->getPort() . '/' . $this->getRoot(); |
|
541 | + return $this->protocol.'://'.$this->getHost().':'.$this->getPort().'/'.$this->getRoot(); |
|
542 | 542 | } |
543 | 543 | } |