PHP Class Scalr\Upgrade\UpgradeHandler

Since: 4.5.0 (10.10.2013)
Author: Vitaliy Demidov ([email protected])
Datei anzeigen Open project: scalr/scalr Class Usage Examples

Protected Properties

Property Type Description
$console Scalr\Upgrade\Console Console
$db ADODB_mysqli Database instance

Public Methods

Method Description
__construct ( object $opt ) Constructor
checkFilesystemStorage ( ) Checks filesystem storage
checkPid ( ) : boolean Checks and creates pid file
getPathToUpdates ( ) : string Gets path to updates
removePid ( ) Removes pid
run ( ) : boolean Runs upgrade process

Protected Methods

Method Description
applyUpdate ( Scalr\Upgrade\AbstractUpdate $upd ) : boolean Applies update
getLastDate ( ) : string Gets last datetime which has been processed
loadUpdates ( ) Loads updates from the implemented classes

Private Methods

Method Description
fetchMysqlStatusBefore ( string $service = 'adodb' ) Getches statuses of the previous updates for specified database service from container
fetchStatusBefore ( ) Fetches statuses of the previous updates
isOutdatedPid ( string $timestamp ) : boolean Checks if pid is outdated

Method Details

__construct() public method

Constructor
public __construct ( object $opt )
$opt object Run options

applyUpdate() protected method

Applies update
protected applyUpdate ( Scalr\Upgrade\AbstractUpdate $upd ) : boolean
$upd Scalr\Upgrade\AbstractUpdate Update to apply
return boolean Returns true if update is successful, false otherwise

checkFilesystemStorage() public static method

Checks filesystem storage
public static checkFilesystemStorage ( )

checkPid() public static method

Checks and creates pid file
public static checkPid ( ) : boolean
return boolean Returns false if process has already been started or creates a new pid file

getLastDate() protected method

Gets last datetime which has been processed
protected getLastDate ( ) : string
return string Returns UTC in format 'YYYY-MM-DD HH:ii:ss'

getPathToUpdates() public static method

Gets path to updates
public static getPathToUpdates ( ) : string
return string Returns path to updates without trailing slash

loadUpdates() protected method

Loads updates from the implemented classes
protected loadUpdates ( )

removePid() public static method

Removes pid
public static removePid ( )

run() public method

Runs upgrade process
public run ( ) : boolean
return boolean Returns true if all updates completed successfully, false otherwise

Property Details

$console protected_oe property

Console
protected Console,Scalr\Upgrade $console
return Scalr\Upgrade\Console

$db protected_oe property

Database instance
protected ADODB_mysqli $db
return ADODB_mysqli