More codestandards.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -81,21 +81,28 @@ class Rclone
|
||||
/**
|
||||
* Copy from source to destination.
|
||||
*
|
||||
* @param $src Source mount and path
|
||||
* @param $dest Destination mount and path
|
||||
* @param $bandwidth Bandwidth limit provided as string
|
||||
* @param $src Source mount and path
|
||||
* @param $dest Destination mount and path
|
||||
* @param $additionalOptions strings[] Bandwidth limit provided as string
|
||||
*
|
||||
* @return string Stdout from command
|
||||
*/
|
||||
public function copy(string $src, string $dest, string $bandwidth = null): string
|
||||
public function copy(string $src, string $dest, array $additionalOptions = array()): string
|
||||
{
|
||||
$options = array();
|
||||
|
||||
$options[] = $src;
|
||||
$options[] = $dest;
|
||||
if ($bandwidth) {
|
||||
$options[] = "--bwlimit";
|
||||
$options[] = $bandwidth;
|
||||
foreach ($additionalOptions as $key => $value) {
|
||||
if (strlen($key) == 1) {
|
||||
$options[] = '-' . $key;
|
||||
$options[] = $value;
|
||||
} elseif (strlen($key) > 2) {
|
||||
$options[] = '--' . $key;
|
||||
$options[] = $value;
|
||||
} else {
|
||||
$options[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->exec('copy', $options);
|
||||
|
Reference in New Issue
Block a user