Backup
in package
Description of Backup
Tags
Table of Contents
Constants
- DATE_FORMAT = 'Y-m-d H:i:s'
- ERROR_BACKUP_ERROR = 1
- ERROR_HASHES_CHECK = 2
- ERROR_NO_ERROR = 0
Properties
- $dateFrom : string
- $dateTo : string
- $exitCode : int
- $getPath : callable
- $hashProp : string
- $log : LoggerInterface|null
- $modDateProp : string
- $params : BackupParameters
- $pathCutpoint : int
- $pdo : PDO
- $pgdumpConnStr : string
- $sizeProp : string
- $snapshotId : string
- $sqlFile : string
- $tmpArchive : Tar
- $tmpFileBase : string
- $tmpList : mixed
- $txId : int
Methods
- __construct() : mixed
- checkFile() : void
- checkFiles() : void
- formatMb() : string
- run() : int
- acquireDbLocks() : void
- backupDb() : void
- cleanup() : void
- createArchive() : Tar
- getBackupSize() : array{0: int, 1: int}
- getStorageDir() : string
- processChunks() : void
- processParams() : void
- renameTmp() : string
- updateDateFile() : void
Constants
DATE_FORMAT
public
mixed
DATE_FORMAT
= 'Y-m-d H:i:s'
ERROR_BACKUP_ERROR
public
mixed
ERROR_BACKUP_ERROR
= 1
ERROR_HASHES_CHECK
public
mixed
ERROR_HASHES_CHECK
= 2
ERROR_NO_ERROR
public
mixed
ERROR_NO_ERROR
= 0
Properties
$dateFrom
private
string
$dateFrom
$dateTo
private
string
$dateTo
$exitCode
private
int
$exitCode
$getPath
private
callable
$getPath
$hashProp
private
string
$hashProp
$log
private
LoggerInterface|null
$log
= null
$modDateProp
private
string
$modDateProp
$params
private
BackupParameters
$params
$pathCutpoint
private
int
$pathCutpoint
$pdo
private
PDO
$pdo
$pgdumpConnStr
private
string
$pgdumpConnStr
$sizeProp
private
string
$sizeProp
$snapshotId
private
string
$snapshotId
$sqlFile
private
string
$sqlFile
= ''
$tmpArchive
private
Tar
$tmpArchive
$tmpFileBase
private
string
$tmpFileBase
= '/__no such dir__/'
$tmpList
private
mixed
$tmpList
open-resource
$txId
private
int
$txId
Methods
__construct()
public
__construct(BackupParameters $params[, LoggerInterface|null $log = null ]) : mixed
Parameters
- $params : BackupParameters
- $log : LoggerInterface|null = null
checkFile()
public
checkFile(string $file) : void
Parameters
- $file : string
checkFiles()
public
checkFiles(string $targetFilePrefix) : void
Parameters
- $targetFilePrefix : string
formatMb()
public
static formatMb(int $size[, int $precision = 3 ]) : string
Parameters
- $size : int
- $precision : int = 3
Return values
stringrun()
public
run() : int
Return values
intacquireDbLocks()
private
acquireDbLocks() : void
backupDb()
private
backupDb() : void
cleanup()
private
cleanup() : void
createArchive()
private
createArchive(string $path) : Tar
Parameters
- $path : string
Return values
TargetBackupSize()
private
getBackupSize() : array{0: int, 1: int}
Return values
array{0: int, 1: int}getStorageDir()
private
getStorageDir(int $id, string $path, int $level, int $levelMax) : string
Parameters
- $id : int
- $path : string
- $level : int
- $levelMax : int
Return values
stringprocessChunks()
private
processChunks() : void
processParams()
private
processParams() : void
renameTmp()
private
renameTmp(string $targetFile, int $part, string $tmpArchivePath, string $tmpListPath, string $compression) : string
Parameters
- $targetFile : string
- $part : int
- $tmpArchivePath : string
- $tmpListPath : string
- $compression : string
Return values
stringupdateDateFile()
private
updateDateFile(string $date) : void
Parameters
- $date : string