AutoUpdaterBackupHelper

Extends \AbstractAutoUpdaterHelper

Class AutoUpdaterBackupHelper

package

Default

Methods

AutoUpdaterFilesystemHelper constructor.

__construct(\AutoUpdaterSettings $settings, \AutoUpdaterDataCache $dataCache, \LogControl $logControl) 

Arguments

$logControl

\LogControl

Creates a backup by a given update and update files directory.

backupFiles(\AutoUpdaterUpdate $update, string $updateFilesDirectory, string|null $backupId = null, array|null $newUpdateFiles = null, integer|null $lastBackupedIndex = null) : string
Throws
\AutoUpdaterBackupCreationFailedException

Arguments

$updateFilesDirectory

string

$backupId

string|null

$newUpdateFiles

array|null

$lastBackupedIndex

integer|null

Response

string

backupingFilesDone

backupingFilesDone() : boolean

Response

boolean

Replaces the base directory path of a given file path with a new base directory path.

changeFileBasePath(string $file, string $oldBasePath, string $newBasePath) : string
inherited

Arguments

$file

string

$oldBasePath

string

$newBasePath

string

Response

string

Returns new path of the file. If an error occurs the unmodified file path will be returned.

Copies a file.

copyFile(string $source, string $destination) : boolean
inherited

Arguments

$source

string

$destination

string

Response

boolean

Creates a new debug log.

createDebugLog(string $message, string|array $additionalData = '') 

Arguments

$message

string

$additionalData

string|array

Return true on success, otherwise false.

createDirectory(string $directory, boolean $writable = false) : boolean
inherited

Arguments

$directory

string

Path of the new directory.

$writable

boolean

Response

boolean

Restores and backup by coping

deleteBackup(string $backupId) 
Throws
\AutoUpdaterBackupRestoreFailedException

Arguments

$backupId

string

Deletes a directory. Return true on success and false otherwise.

deleteDirectory(string $directory) : boolean
inherited

Arguments

$directory

string

Response

boolean

Copies a file.

deleteFile(string $file) : boolean
inherited

Arguments

$file

string

Response

boolean

Returns a list of available backups.

getAvailableBackups() : array

Response

array

Returns a list of files, that belongs to the given backup id.

getBackupFileList(string $backupId) : array

Arguments

$backupId

string

Response

array

getBackupId

getBackupId() : string

Response

string

Returns an array with all files inside a given directory and his subdirectories.

getDirectoryFiles(string $directory) : array
inherited

Arguments

$directory

string

Response

array

getLastBackupedIndex

getLastBackupedIndex() : integer

Response

integer

getLastRestoredIndex

getLastRestoredIndex() : integer

Response

integer

getNewUpdateFiles

getNewUpdateFiles() : array

Response

array

getProgress

getProgress() : float

Response

float

Registers the auto updater ftp manager.

registerFtpManager(\AutoUpdaterFtpManager $ftpManager) 

Arguments

Restores and backup by coping

restoreBackup(string $backupId, integer|null $lastRestoredIndex = null) 
Throws
\AutoUpdaterBackupRestoreFailedException

Arguments

$backupId

string

$lastRestoredIndex

integer|null

restoringFilesDone

restoringFilesDone() : boolean

Response

boolean

Sets the file permissions and ownership correctly.

setCorrectChmodAndOwner(string $file, null|string $chmod = null, null|string $owner = null) : boolean
inherited

Arguments

$file

string

$chmod

null|string

$owner

null|string

Response

boolean

Properties

settings

settings : \AutoUpdaterSettings
inherited
var

Type(s)

\AutoUpdaterSettings

dataCache

dataCache : \AutoUpdaterDataCache
var

Type(s)

\AutoUpdaterDataCache

availableBackups

availableBackups : array
var

Type(s)

array

ftpManager

ftpManager : \AutoUpdaterFtpManager
inherited

logControl

logControl : \LogControl
var

Type(s)

\LogControl

backupingFilesDone

backupingFilesDone : boolean
var

Type(s)

boolean

lastBackupedIndex

lastBackupedIndex : integer|null
var

Type(s)

integer|null

restoringFilesDone

restoringFilesDone : boolean
var

Type(s)

boolean

lastRestoredIndex

lastRestoredIndex : integer|null
var

Type(s)

integer|null

backupId

backupId : string
var

Type(s)

string

newUpdateFiles

newUpdateFiles : array
var

Type(s)

array

progress

progress : float
var

Type(s)

float

ajaxTimeout

ajaxTimeout : integer
var

Type(s)

integer