diff --git a/src/Backup/Sync/Dropbox.php b/src/Backup/Sync/Dropbox.php index b8f4a812..675e7d71 100644 --- a/src/Backup/Sync/Dropbox.php +++ b/src/Backup/Sync/Dropbox.php @@ -67,10 +67,9 @@ public function sync(Target $target, Result $result) { $sourcePath = $target->getPathnameCompressed(); $dropboxPath = $this->path . $target->getFilenameCompressed(); - $client = new \Dropbox\Client($this->token, "phpbu/1.1.0"); + $pathError = \Dropbox\Path::findErrorNonRoot($dropboxPath); - $pathError = \Dropbox\Path::findErrorNonRoot($dropboxPath); if ($pathError !== null) { throw new Exception('Invalid : ' . $pathError); } @@ -82,7 +81,7 @@ public function sync(Target $target, Result $result) try { $fp = fopen($sourcePath, 'rb'); - $res = $client->uploadFile($dropboxPath, dbx\WriteMode::add(), $fp, $size); + $res = $client->uploadFile($dropboxPath, \Dropbox\WriteMode::add(), $fp, $size); fclose($fp); } catch (\Exception $e) { fclose($fp);