AutoUpdaterUpdatesHelper

Extends \AbstractAutoUpdaterHelper

Class AutoUpdaterUpdatesHelper

package

Default

Methods

AutoUpdaterUpdatesChecker constructor.

__construct(\AutoUpdaterSettings $settings, \CI_DB_query_builder $db, \DataCache $dataCache, \AutoUpdaterCurlClient $curl, \LogControl $logControl) 

Arguments

$db

\CI_DB_query_builder

$dataCache

\DataCache

$logControl

\LogControl

Checks if there are downloaded update, that not have been installed.

areUninstalledUpdatesAvailable() : boolean

Response

boolean

True, if uninstalled downloaded updates are available, otherwise false.

Checks if updates are available.

areUpdatesAvailable() : boolean
Throws
\AutoUpdaterException

If connection to update server failed.

Response

boolean

True, if updates are available, otherwise false.

Calls home and sends some feedback about the update processing

callHome(string $message, string $selectedUpdate = '', array $wrongPermittedFiles = array(), \Exception|null $exception = null) 

Arguments

$message

string

$selectedUpdate

string

$wrongPermittedFiles

array

$exception

\Exception|null

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 writing permissions of all needed directories for an update by a given update files directory.

checkFilesPermissions(string $updateFilesDirectory) : array

Arguments

$updateFilesDirectory

string

Response

array

Checks the writing permissions of all needed directories for an update by a given update files directory.

checkFilesPermissionsWithFileList(string $fileList) : array

Arguments

$fileList

string

Response

array

Collects all shop information that are needed for the update server.

collectShopInformation() : array

Response

array

Copies a file.

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

Arguments

$source

string

$destination

string

Response

boolean

Copies the update files into the shop.

copyFilesIntoShop(string $updateFilesDirectory, integer|null $lastCopiedIndex = null) : integer|null
Throws
\AutoUpdaterMovingUpdateFilesFailedException

Arguments

$updateFilesDirectory

string

$lastCopiedIndex

integer|null

Response

integer|null

copyingFilesIntoShopDone

copyingFilesIntoShopDone() : mixed

Response

mixed

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

Marks the admin infobox message with the given identifier as deleted.

deleteInfoboxMessage( $infoboxIdentifier) 

Arguments

$infoboxIdentifier

string

Deletes a given update files directory.

deleteUpdateDirectory(string $updateFilesDirectory) : boolean

Arguments

$updateFilesDirectory

string

Response

boolean

Deletes the updates directory. Return true on success and false otherwise.

deleteUpdatesDirectory() : boolean

Response

boolean

Returns the shop key from database.

determineDownloadedUpdates() : mixed

Response

mixed

Returns the version receipts from filesystem.

determineExistingReceiptFiles() : mixed

Response

mixed

Returns a db dump of the version history table as an array.

determineInstalledUpdates() : mixed

Response

mixed

Returns the shop key.

determineShopKey() : mixed

Response

mixed

Returns the shop key.

determineShopVersion() : mixed

Response

mixed

Determines the version of the version info items while considering known edge cases.

determineUpdateName(string $receiptFilePath) : string

Arguments

$receiptFilePath

string

Response

string

$version

Returns a list of all available updates as an array.

getAvailableUpdates() : array
Throws
\AutoUpdaterException

If connection to update server failed.

Response

array

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

getDirectoryFiles(string $directory) : array
inherited

Arguments

$directory

string

Response

array

getLastCopiedIndex

getLastCopiedIndex() : mixed

Response

mixed

getProcessingStatus

getProcessingStatus(string $updateId) : mixed

Arguments

$updateId

string

Response

mixed

getProgress

getProgress() : float

Response

float

Returns the update check response of the update server.

getUpdateCheckResponse() 
Throws
\AutoUpdaterException

If connection to update server failed.

Checks the version history database table if the given version is installed.

hasUpdateBeenInstalled( $updateName) : boolean

Arguments

$updateName

Response

boolean

Returns true, if the given version is installed, otherwise false.

Registers the auto updater ftp manager.

registerFtpManager(\AutoUpdaterFtpManager $ftpManager) 

Arguments

Removes the version history entry of an update by a given version history name.

resetVersionHistoryName( $versionHistoryName) 

Arguments

$versionHistoryName

string

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

setProcessingStatus

setProcessingStatus(string $updateId,  $status) : mixed

Arguments

$updateId

string

$status

Response

mixed

Properties

settings

settings : \AutoUpdaterSettings
inherited
var

Type(s)

\AutoUpdaterSettings

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

dataCache

dataCache : \DataCache
var

Type(s)

\DataCache

curl

curl : \AutoUpdaterCurlClient

updateStatus

updateStatus : array
var

Type(s)

array

availableUpdates

availableUpdates : array
var

Type(s)

array

ftpManager

ftpManager : \AutoUpdaterFtpManager
inherited

logControl

logControl : \LogControl
var

Type(s)

\LogControl

copyingFilesIntoShopDone

copyingFilesIntoShopDone : boolean
var

Type(s)

boolean

lastCopiedIndex

lastCopiedIndex : integer|null
var

Type(s)

integer|null

progress

progress : float
var

Type(s)

float

ajaxTimeout

ajaxTimeout : integer
var

Type(s)

integer

updateStatusLifetime

updateStatusLifetime : integer
var

Type(s)

integer