CodeSniffer initial steps
This commit is contained in:
@ -4,9 +4,10 @@ namespace App\Rclone;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||
|
||||
class Rclone {
|
||||
private $rclone_path;
|
||||
private $global_options = [];
|
||||
class Rclone
|
||||
{
|
||||
protected $rclone_path;
|
||||
protected $global_options = [];
|
||||
|
||||
function __construct($rclone_path = "rclone")
|
||||
{
|
||||
@ -31,8 +32,7 @@ class Rclone {
|
||||
|
||||
$options[] = $src;
|
||||
$options[] = $dest;
|
||||
if($bandwidth)
|
||||
{
|
||||
if ($bandwidth) {
|
||||
$options[] = "--bwlimit";
|
||||
$options[] = $bandwidth;
|
||||
}
|
||||
@ -40,9 +40,16 @@ class Rclone {
|
||||
return $this->exec('copy', $options);
|
||||
}
|
||||
|
||||
private function exec(string $command, array $options = array())
|
||||
protected function exec(string $command, array $options = array())
|
||||
{
|
||||
$process = new Process(array_merge([$this->rclone_path], $this->global_options, [$command], $options));
|
||||
$process = new Process(
|
||||
array_merge(
|
||||
[$this->rclone_path],
|
||||
$this->global_options,
|
||||
[$command],
|
||||
$options
|
||||
)
|
||||
);
|
||||
$process->setTimeout(4*3600);
|
||||
$process->run();
|
||||
|
||||
|
Reference in New Issue
Block a user