Documentation

Backup
in package

Description of Backup

Tags
author

zozlak

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

$getPath

private callable $getPath

$hashProp

private string $hashProp

$log

private LoggerInterface|null $log = null

$modDateProp

private string $modDateProp

$pathCutpoint

private int $pathCutpoint

$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

Methods

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
string

run()

public run() : int
Return values
int

acquireDbLocks()

private acquireDbLocks() : void

backupDb()

private backupDb() : void

cleanup()

private cleanup() : void

createArchive()

private createArchive(string $path) : Tar
Parameters
$path : string
Return values
Tar

getBackupSize()

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
string

processChunks()

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
string

updateDateFile()

private updateDateFile(string $date) : void
Parameters
$date : string

        
On this page

Search results