AutoUpdaterDownloadHelper

Extends \AbstractAutoUpdaterHelper

Class AutoUpdaterDownloadHelper

package

Default

Methods

AutoUpdaterFilesystemHelper constructor.

__construct(\AutoUpdaterSettings $settings, \AutoUpdaterCurlClient $curl, \LogControl $logControl) 

Arguments

$logControl

\LogControl

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.

Checks the unpacked files.

checkUnpackedFiles(\AutoUpdaterUpdate $update, string $updateFilesDirectory) 
Throws
\AutoUpdaterCouldNotExtractUpdateZipException

If unpacked file is not ok.

Arguments

$updateFilesDirectory

string

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

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

Downloads an external file with curl.

downloadExternalFile(string $url, string $destination) 

Arguments

$url

string

$destination

string

downloadingFilesDone

downloadingFilesDone() 

Downloads a zip archive of a given update and extracts it. If the zip extension is not available on the web server, the downloadUpdateFilesSeparately method will be used as a fallback.

downloadUpdate(\AutoUpdaterUpdate $update, string $updateFilesDirectory, integer|null $lastDownloadedIndex = null) 
Throws
\AutoUpdaterUpdateDownloadFailedException

Arguments

$updateFilesDirectory

string

$lastDownloadedIndex

integer|null

Downloads all update files of a given update into a given update files directory.

downloadUpdateFilesSeparately(\AutoUpdaterUpdate $update, string $updateFilesDirectory, integer|null $lastDownloadedIndex = null) 

This method is a fallback, if the zip extension is not available on the web server.

Throws
\AutoUpdaterUpdateDownloadFailedException

Arguments

$updateFilesDirectory

string

$lastDownloadedIndex

integer|null

Extracts a given zip file to a given directory

extractZip(string $zipFile, string $destination) 
Throws
\AutoUpdaterCouldNotExtractUpdateZipException

Arguments

$zipFile

string

$destination

string

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

getDirectoryFiles(string $directory) : array
inherited

Arguments

$directory

string

Response

array

getLastDownloadedIndex

getLastDownloadedIndex() 

getProgress

getProgress() 

Registers the auto updater ftp manager.

registerFtpManager(\AutoUpdaterFtpManager $ftpManager) 

Arguments

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

curl

curl : \AutoUpdaterCurlClient

ftpManager

ftpManager : \AutoUpdaterFtpManager
inherited

logControl

logControl : \LogControl
var

Type(s)

\LogControl

lastDownloadedIndex

lastDownloadedIndex : integer
var

Type(s)

integer

downloadingFilesDone

downloadingFilesDone : boolean
var

Type(s)

boolean

progress

progress : float
var

Type(s)

float

ajaxTimeout

ajaxTimeout : integer
var

Type(s)

integer