AutoUpdaterBackupHelper
extends AbstractAutoUpdaterHelper
in package
Class AutoUpdaterBackupHelper
Table of Contents
- $ajaxTimeout : int
- $availableBackups : array<string|int, mixed>
- $backupId : string
- $backupingFilesDone : bool
- $dataCache : AutoUpdaterDataCache
- $ftpManager : AutoUpdaterFtpManager
- $lastBackupedIndex : int|null
- $lastRestoredIndex : int|null
- $logControl : LogControl
- $newUpdateFiles : array<string|int, mixed>
- $progress : float
- $restoringFilesDone : bool
- $settings : AutoUpdaterSettings
- __construct() : mixed
- AutoUpdaterFilesystemHelper constructor.
- backupFiles() : string
- Creates a backup by a given update and update files directory.
- backupingFilesDone() : bool
- deleteBackup() : mixed
- Restores and backup by coping
- deleteFile() : bool
- Copies a file.
- getAvailableBackups() : array<string|int, mixed>
- Returns a list of available backups.
- getBackupFileList() : array<string|int, mixed>
- Returns a list of files, that belongs to the given backup id.
- getBackupId() : string
- getLastBackupedIndex() : int
- getLastRestoredIndex() : int
- getNewUpdateFiles() : array<string|int, mixed>
- getProgress() : float
- registerFtpManager() : mixed
- Registers the auto updater ftp manager.
- restoreBackup() : mixed
- Restores and backup by coping
- restoringFilesDone() : bool
- changeFileBasePath() : string
- Replaces the base directory path of a given file path with a new base directory path.
- copyFile() : bool
- Copies a file.
- createDebugLog() : mixed
- Creates a new debug log.
- createDirectory() : bool
- Return true on success, otherwise false.
- deleteDirectory() : bool
- Deletes a directory. Return true on success and false otherwise.
- getDirectoryFiles() : array<string|int, mixed>
- Returns an array with all files inside a given directory and his subdirectories.
- setCorrectChmodAndOwner() : bool
- Sets the file permissions and ownership correctly.
Properties
$ajaxTimeout
protected
int
$ajaxTimeout
$availableBackups
protected
array<string|int, mixed>
$availableBackups
$backupId
protected
string
$backupId
$backupingFilesDone
protected
bool
$backupingFilesDone
$dataCache
protected
AutoUpdaterDataCache
$dataCache
$ftpManager
protected
AutoUpdaterFtpManager
$ftpManager
$lastBackupedIndex
protected
int|null
$lastBackupedIndex
$lastRestoredIndex
protected
int|null
$lastRestoredIndex
$logControl
protected
LogControl
$logControl
$newUpdateFiles
protected
array<string|int, mixed>
$newUpdateFiles
$progress
protected
float
$progress
$restoringFilesDone
protected
bool
$restoringFilesDone
$settings
protected
AutoUpdaterSettings
$settings
Methods
__construct()
AutoUpdaterFilesystemHelper constructor.
public
__construct(AutoUpdaterSettings $settings, AutoUpdaterDataCache $dataCache, LogControl $logControl) : mixed
Parameters
- $settings : AutoUpdaterSettings
- $dataCache : AutoUpdaterDataCache
- $logControl : LogControl
Return values
mixed —backupFiles()
Creates a backup by a given update and update files directory.
public
backupFiles(AutoUpdaterUpdate $update, string $updateFilesDirectory[, string|null $backupId = null ][, array<string|int, mixed>|null $newUpdateFiles = null ][, int|null $lastBackupedIndex = null ]) : string
Parameters
- $update : AutoUpdaterUpdate
- $updateFilesDirectory : string
- $backupId : string|null = null
- $newUpdateFiles : array<string|int, mixed>|null = null
- $lastBackupedIndex : int|null = null
Tags
Return values
string —backupingFilesDone()
public
backupingFilesDone() : bool
Return values
bool —deleteBackup()
Restores and backup by coping
public
deleteBackup(string $backupId) : mixed
Parameters
- $backupId : string
Tags
Return values
mixed —deleteFile()
Copies a file.
public
deleteFile(string $file) : bool
Parameters
- $file : string
Return values
bool —getAvailableBackups()
Returns a list of available backups.
public
getAvailableBackups() : array<string|int, mixed>
Return values
array<string|int, mixed> —getBackupFileList()
Returns a list of files, that belongs to the given backup id.
public
getBackupFileList(string $backupId) : array<string|int, mixed>
Parameters
- $backupId : string
Return values
array<string|int, mixed> —getBackupId()
public
getBackupId() : string
Return values
string —getLastBackupedIndex()
public
getLastBackupedIndex() : int
Return values
int —getLastRestoredIndex()
public
getLastRestoredIndex() : int
Return values
int —getNewUpdateFiles()
public
getNewUpdateFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —getProgress()
public
getProgress() : float
Return values
float —registerFtpManager()
Registers the auto updater ftp manager.
public
registerFtpManager(AutoUpdaterFtpManager $ftpManager) : mixed
Parameters
- $ftpManager : AutoUpdaterFtpManager
Return values
mixed —restoreBackup()
Restores and backup by coping
public
restoreBackup(string $backupId[, int|null $lastRestoredIndex = null ]) : mixed
Parameters
- $backupId : string
- $lastRestoredIndex : int|null = null
Tags
Return values
mixed —restoringFilesDone()
public
restoringFilesDone() : bool
Return values
bool —changeFileBasePath()
Replaces the base directory path of a given file path with a new base directory path.
protected
changeFileBasePath(string $file, string $oldBasePath, string $newBasePath) : string
Parameters
- $file : string
- $oldBasePath : string
- $newBasePath : string
Return values
string —Returns new path of the file. If an error occurs the unmodified file path will be returned.
copyFile()
Copies a file.
protected
copyFile(string $source, string $destination) : bool
Parameters
- $source : string
- $destination : string
Return values
bool —createDebugLog()
Creates a new debug log.
protected
createDebugLog(string $message[, string|array<string|int, mixed> $additionalData = '' ]) : mixed
Parameters
- $message : string
- $additionalData : string|array<string|int, mixed> = ''
Return values
mixed —createDirectory()
Return true on success, otherwise false.
protected
createDirectory(string $directory[, bool $writable = false ]) : bool
Parameters
- $directory : string
-
Path of the new directory.
- $writable : bool = false
Return values
bool —deleteDirectory()
Deletes a directory. Return true on success and false otherwise.
protected
deleteDirectory(string $directory) : bool
Parameters
- $directory : string
Return values
bool —getDirectoryFiles()
Returns an array with all files inside a given directory and his subdirectories.
protected
getDirectoryFiles(string $directory) : array<string|int, mixed>
Parameters
- $directory : string
Return values
array<string|int, mixed> —setCorrectChmodAndOwner()
Sets the file permissions and ownership correctly.
protected
setCorrectChmodAndOwner(string $file[, null|string $chmod = null ][, null|string $owner = null ]) : bool
Parameters
- $file : string
- $chmod : null|string = null
- $owner : null|string = null