AutoUpdaterUpdatesHelper
extends AbstractAutoUpdaterHelper
in package
Class AutoUpdaterUpdatesHelper
Table of Contents
- $ajaxTimeout : int
- $copyingFilesIntoShopDone : bool
- $ftpManager : AutoUpdaterFtpManager
- $lastCopiedIndex : int|null
- $logControl : LogControl
- $progress : float
- $settings : AutoUpdaterSettings
- $updateStatusLifetime : int
- $availableUpdates : array<string|int, mixed>
- $curl : AutoUpdaterCurlClient
- $dataCache : DataCache
- $db : CI_DB_query_builder
- $updateStatus : array<string|int, mixed>
- __construct() : mixed
- AutoUpdaterUpdatesChecker constructor.
- areUninstalledUpdatesAvailable() : bool
- Checks if there are downloaded update, that not have been installed.
- areUpdatesAvailable() : bool
- Checks if updates are available.
- callHome() : mixed
- Calls home and sends some feedback about the update processing
- checkFilesPermissions() : array<string|int, mixed>
- Checks the writing permissions of all needed directories for an update by a given update files directory.
- checkFilesPermissionsWithFileList() : array<string|int, mixed>
- Checks the writing permissions of all needed directories for an update by a given update files directory.
- copyFilesIntoShop() : int|null
- Copies the update files into the shop.
- copyingFilesIntoShopDone() : mixed
- deleteFile() : bool
- Copies a file.
- deleteInfoboxMessage() : mixed
- Marks the admin infobox message with the given identifier as deleted.
- deleteUpdateDirectory() : bool
- Deletes a given update files directory.
- deleteUpdatesDirectory() : bool
- Deletes the updates directory. Return true on success and false otherwise.
- getAvailableUpdates() : array<string|int, mixed>
- Returns a list of all available updates as an array.
- getLastCopiedIndex() : mixed
- getProcessingStatus() : mixed
- getProgress() : float
- getUpdateCheckResponse() : mixed
- Returns the update check response of the update server.
- registerFtpManager() : mixed
- Registers the auto updater ftp manager.
- resetVersionHistoryName() : mixed
- Removes the version history entry of an update by a given version history name.
- setProcessingStatus() : mixed
- changeFileBasePath() : string
- Replaces the base directory path of a given file path with a new base directory path.
- collectShopInformation() : array<string|int, mixed>
- Collects all shop information that are needed for the update server.
- 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.
- determineDownloadedUpdates() : mixed
- Returns the shop key from database.
- determineExistingReceiptFiles() : mixed
- Returns the version receipts from filesystem.
- determineInstalledUpdates() : mixed
- Returns a db dump of the version history table as an array.
- determineShopKey() : mixed
- Returns the shop key.
- determineShopVersion() : mixed
- Returns the shop key.
- determineUpdateName() : string
- Determines the version of the version info items while considering known edge cases.
- getDirectoryFiles() : array<string|int, mixed>
- Returns an array with all files inside a given directory and his subdirectories.
- hasUpdateBeenInstalled() : bool
- Checks the version history database table if the given version is installed.
- setCorrectChmodAndOwner() : bool
- Sets the file permissions and ownership correctly.
Properties
$ajaxTimeout
protected
int
$ajaxTimeout
$copyingFilesIntoShopDone
protected
bool
$copyingFilesIntoShopDone
$ftpManager
protected
AutoUpdaterFtpManager
$ftpManager
$lastCopiedIndex
protected
int|null
$lastCopiedIndex
$logControl
protected
LogControl
$logControl
$progress
protected
float
$progress
$settings
protected
AutoUpdaterSettings
$settings
$updateStatusLifetime
protected
int
$updateStatusLifetime
$availableUpdates
private
array<string|int, mixed>
$availableUpdates
$curl
private
AutoUpdaterCurlClient
$curl
$dataCache
private
DataCache
$dataCache
$db
private
CI_DB_query_builder
$db
$updateStatus
private
array<string|int, mixed>
$updateStatus
Methods
__construct()
AutoUpdaterUpdatesChecker constructor.
public
__construct(AutoUpdaterSettings $settings, CI_DB_query_builder $db, DataCache $dataCache, AutoUpdaterCurlClient $curl, LogControl $logControl) : mixed
Parameters
- $settings : AutoUpdaterSettings
- $db : CI_DB_query_builder
- $dataCache : DataCache
- $curl : AutoUpdaterCurlClient
- $logControl : LogControl
Return values
mixed —areUninstalledUpdatesAvailable()
Checks if there are downloaded update, that not have been installed.
public
areUninstalledUpdatesAvailable() : bool
Return values
bool —True, if uninstalled downloaded updates are available, otherwise false.
areUpdatesAvailable()
Checks if updates are available.
public
areUpdatesAvailable() : bool
Tags
Return values
bool —True, if updates are available, otherwise false.
callHome()
Calls home and sends some feedback about the update processing
public
callHome(string $message[, string $selectedUpdate = '' ][, array<string|int, mixed> $wrongPermittedFiles = [] ][, Exception|null $exception = null ]) : mixed
Parameters
- $message : string
- $selectedUpdate : string = ''
- $wrongPermittedFiles : array<string|int, mixed> = []
- $exception : Exception|null = null
Return values
mixed —checkFilesPermissions()
Checks the writing permissions of all needed directories for an update by a given update files directory.
public
checkFilesPermissions(string $updateFilesDirectory) : array<string|int, mixed>
Parameters
- $updateFilesDirectory : string
Return values
array<string|int, mixed> —checkFilesPermissionsWithFileList()
Checks the writing permissions of all needed directories for an update by a given update files directory.
public
checkFilesPermissionsWithFileList(string $fileList) : array<string|int, mixed>
Parameters
- $fileList : string
Return values
array<string|int, mixed> —copyFilesIntoShop()
Copies the update files into the shop.
public
copyFilesIntoShop(string $updateFilesDirectory[, int|null $lastCopiedIndex = null ]) : int|null
Parameters
- $updateFilesDirectory : string
- $lastCopiedIndex : int|null = null
Tags
Return values
int|null —copyingFilesIntoShopDone()
public
copyingFilesIntoShopDone() : mixed
Return values
mixed —deleteFile()
Copies a file.
public
deleteFile(string $file) : bool
Parameters
- $file : string
Return values
bool —deleteInfoboxMessage()
Marks the admin infobox message with the given identifier as deleted.
public
deleteInfoboxMessage( $infoboxIdentifier) : mixed
Parameters
Return values
mixed —deleteUpdateDirectory()
Deletes a given update files directory.
public
deleteUpdateDirectory(string $updateFilesDirectory) : bool
Parameters
- $updateFilesDirectory : string
Return values
bool —deleteUpdatesDirectory()
Deletes the updates directory. Return true on success and false otherwise.
public
deleteUpdatesDirectory() : bool
Return values
bool —getAvailableUpdates()
Returns a list of all available updates as an array.
public
getAvailableUpdates() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getLastCopiedIndex()
public
getLastCopiedIndex() : mixed
Return values
mixed —getProcessingStatus()
public
getProcessingStatus(string $updateId) : mixed
Parameters
- $updateId : string
Return values
mixed —getProgress()
public
getProgress() : float
Return values
float —getUpdateCheckResponse()
Returns the update check response of the update server.
public
getUpdateCheckResponse() : mixed
Tags
Return values
mixed —registerFtpManager()
Registers the auto updater ftp manager.
public
registerFtpManager(AutoUpdaterFtpManager $ftpManager) : mixed
Parameters
- $ftpManager : AutoUpdaterFtpManager
Return values
mixed —resetVersionHistoryName()
Removes the version history entry of an update by a given version history name.
public
resetVersionHistoryName( $versionHistoryName) : mixed
Parameters
Return values
mixed —setProcessingStatus()
public
setProcessingStatus(string $updateId, mixed $status) : mixed
Parameters
- $updateId : string
- $status : mixed
Return values
mixed —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.
collectShopInformation()
Collects all shop information that are needed for the update server.
protected
collectShopInformation() : array<string|int, mixed>
Return values
array<string|int, mixed> —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 —determineDownloadedUpdates()
Returns the shop key from database.
protected
determineDownloadedUpdates() : mixed
Return values
mixed —determineExistingReceiptFiles()
Returns the version receipts from filesystem.
protected
determineExistingReceiptFiles() : mixed
Return values
mixed —determineInstalledUpdates()
Returns a db dump of the version history table as an array.
protected
determineInstalledUpdates() : mixed
Return values
mixed —determineShopKey()
Returns the shop key.
protected
determineShopKey() : mixed
Return values
mixed —determineShopVersion()
Returns the shop key.
protected
determineShopVersion() : mixed
Return values
mixed —determineUpdateName()
Determines the version of the version info items while considering known edge cases.
protected
determineUpdateName(string $receiptFilePath) : string
Parameters
- $receiptFilePath : string
Return values
string —$version
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> —hasUpdateBeenInstalled()
Checks the version history database table if the given version is installed.
protected
hasUpdateBeenInstalled(mixed $updateName) : bool
Parameters
- $updateName : mixed
Return values
bool —Returns true, if the given version is installed, otherwise false.
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