More codestandards.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-06-12 09:30:10 +00:00
parent d0270b00ca
commit 0f3bbf1f47
8 changed files with 124 additions and 42 deletions

View File

@ -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);