|
@@ -17,14 +17,12 @@ class Yandex extends BaseConnect
|
|
private string $proxyServer;
|
|
private string $proxyServer;
|
|
private int $proxyPort;
|
|
private int $proxyPort;
|
|
private bool $consoleOutput;
|
|
private bool $consoleOutput;
|
|
- /**
|
|
|
|
- * @var string
|
|
|
|
- */
|
|
|
|
private string $fileWebPath;
|
|
private string $fileWebPath;
|
|
private array $logOutput;
|
|
private array $logOutput;
|
|
private bool $useProxy;
|
|
private bool $useProxy;
|
|
private string $proxyUser;
|
|
private string $proxyUser;
|
|
private string $proxyPass;
|
|
private string $proxyPass;
|
|
|
|
+ private string $backupVersionDirName;
|
|
|
|
|
|
function __construct(ProviderOptions\Yandex $options)
|
|
function __construct(ProviderOptions\Yandex $options)
|
|
{
|
|
{
|
|
@@ -44,6 +42,8 @@ class Yandex extends BaseConnect
|
|
$this->proxyPass = $options->proxyPass;
|
|
$this->proxyPass = $options->proxyPass;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ $this->backupVersionDirName = isset($options->backupVersionDirName) ? $options->backupVersionDirName : date('Y-m-d');
|
|
}
|
|
}
|
|
|
|
|
|
private function stdOutput($stage, $message)
|
|
private function stdOutput($stage, $message)
|
|
@@ -89,14 +89,13 @@ class Yandex extends BaseConnect
|
|
*/
|
|
*/
|
|
public function proceedBackup(array $resultFiles)
|
|
public function proceedBackup(array $resultFiles)
|
|
{
|
|
{
|
|
-
|
|
|
|
-
|
|
|
|
$baseRemoteDirectoryPath = $this->remoteDirectoryPath;
|
|
$baseRemoteDirectoryPath = $this->remoteDirectoryPath;
|
|
$fileWebPath = rtrim($this->fileWebPath, '/');
|
|
$fileWebPath = rtrim($this->fileWebPath, '/');
|
|
|
|
+ $backupVersionDirName = $this->backupVersionDirName;
|
|
|
|
|
|
if (!empty($resultFiles)) {
|
|
if (!empty($resultFiles)) {
|
|
|
|
|
|
- $dirName = $baseRemoteDirectoryPath . date('Y-m-d');
|
|
|
|
|
|
+ $dirName = $baseRemoteDirectoryPath . $backupVersionDirName;
|
|
|
|
|
|
$createRemoteDirRequest = Request::put("https://cloud-api.yandex.net/v1/disk/resources?path=$dirName");
|
|
$createRemoteDirRequest = Request::put("https://cloud-api.yandex.net/v1/disk/resources?path=$dirName");
|
|
$this->setCommonRequestParams($createRemoteDirRequest);
|
|
$this->setCommonRequestParams($createRemoteDirRequest);
|