Skip to content

Commit b056c63

Browse files
committed
store db_type in chunk
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 65d6fc5 commit b056c63

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

lib/Service/ChunkService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,27 +371,30 @@ private function fillChunks(RestoringPoint $point, RestoringData $data) {
371371
* @param RestoringData $data
372372
* @param string $filename
373373
* @param string $path
374+
* @param string $type
374375
*
375376
* @throws ArchiveCreateException
376377
* @throws ArchiveNotFoundException
378+
* @throws NotPermittedException
379+
* @throws RestoringPointNotInitiatedException
377380
*/
378381
public function createSingleFileChunk(
379382
RestoringPoint $point,
380383
RestoringData $data,
381384
string $filename,
382-
string $path
385+
string $path,
386+
string $type = ''
383387
): void {
384388
$chunk = new RestoringChunk($data->getName());
385389
$chunk->setCount(1);
386390
$chunk->addFile(new ArchiveFile($filename));
387391
$chunk->setSize(filesize($path));
392+
$chunk->setType($type);
388393
$data->addChunk($chunk);
389394

390395
$this->createSingleFileZip($point, $chunk, $filename, $path);
391396

392397
$this->updateChecksum($point, $chunk);
393-
// $this->encryptArchive($backup, $archive, true);
394-
// $this->updateChecksum($backup, $archive, true);
395398
}
396399

397400

lib/Service/PointService.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ public function create(bool $complete): RestoringPoint {
277277

278278
$this->activityService->newActivity(
279279
'backup_create', [
280-
'id' => $point->getId(),
281-
'duration' => $point->getDuration(),
282-
'status' => $point->getStatus(),
283-
'complete' => $complete
284-
]
280+
'id' => $point->getId(),
281+
'duration' => $point->getDuration(),
282+
'status' => $point->getStatus(),
283+
'complete' => $complete
284+
]
285285
);
286286

287287
return $point;
@@ -513,7 +513,8 @@ private function backupSql(RestoringPoint $point) {
513513
$point,
514514
$data,
515515
self::SQL_DUMP_FILE,
516-
$tmp
516+
$tmp,
517+
$this->configService->getSystemValue(ISqlDump::DB_TYPE)
517518
);
518519
unlink($tmp);
519520
} catch (Throwable $t) {

0 commit comments

Comments
 (0)