Methods
AutoUpdaterFilesystemHelper constructor.
__construct(\AutoUpdaterSettings $settings, \AutoUpdaterDataCache $dataCache, \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
$newUpdateFiles
array|null
$lastBackupedIndex
integer|null
Response
string
backupingFilesDone
backupingFilesDone() : 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
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
Response
boolean
Creates a new debug log.
createDebugLog(string $message, string|array $additionalData = '')
Arguments
$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.
Response
boolean
Restores and backup by coping
deleteBackup(string $backupId)
|
|
Throws |
- \AutoUpdaterBackupRestoreFailedException
|
Arguments
Deletes a directory. Return true on success and false otherwise.
deleteDirectory(string $directory) : boolean
inherited
Arguments
Response
boolean
Copies a file.
deleteFile(string $file) : boolean
inherited
Arguments
Response
boolean
Returns a list of available backups.
getAvailableBackups() : array
Returns a list of files, that belongs to the given backup id.
getBackupFileList(string $backupId) : array
getBackupId
getBackupId() : string
Returns an array with all files inside a given directory and his subdirectories.
getDirectoryFiles(string $directory) : array
inherited
getLastBackupedIndex
getLastBackupedIndex() : integer
getLastRestoredIndex
getLastRestoredIndex() : integer
getNewUpdateFiles
getNewUpdateFiles() : array
getProgress
getProgress() : float
Registers the auto updater ftp manager.
registerFtpManager(\AutoUpdaterFtpManager $ftpManager)
Restores and backup by coping
restoreBackup(string $backupId, integer|null $lastRestoredIndex = null)
|
|
Throws |
- \AutoUpdaterBackupRestoreFailedException
|
Arguments
$lastRestoredIndex
integer|null
restoringFilesDone
restoringFilesDone() : boolean
Sets the file permissions and ownership correctly.
setCorrectChmodAndOwner(string $file, null|string $chmod = null, null|string $owner = null) : boolean
inherited
Arguments
Response
boolean
Properties
settings
settings : \AutoUpdaterSettings
inherited
dataCache
dataCache : \AutoUpdaterDataCache
availableBackups
availableBackups : array
ftpManager
ftpManager : \AutoUpdaterFtpManager
inherited
logControl
logControl : \LogControl
backupingFilesDone
backupingFilesDone : boolean
lastBackupedIndex
lastBackupedIndex : integer|null
restoringFilesDone
restoringFilesDone : boolean
lastRestoredIndex
lastRestoredIndex : integer|null
backupId
backupId : string
newUpdateFiles
newUpdateFiles : array
progress
progress : float
ajaxTimeout
ajaxTimeout : integer