UpdateController
extends Controller
in package
Class UpdateController
The main Update component
Tags
Table of Contents
Properties
- $cli : Application
- Command Line Interface
- $cx : Cx
- Main class instance
- $pendingCodeBaseChangesYml : string
- pending codeBase changes yml
- $systemComponentController : SystemComponentController
- SystemComponentController for this Component
Methods
- __call() : mixed
- Route methods like getName(), getType(), getDirectory(), etc.
- __construct() : mixed
- Creates new controller
- applyDelta() : null
- Get the serialized Delta
- calculateDbDelta() : mixed
- Calculate database delta
- getAllCodeBaseVersions() : array<string|int, mixed>
- getAllCodeBaseVersions
- getDoctrineMigrationCli() : Application
- Get Doctrine Migration Command Line Interface
- getPendingCodeBaseChangesFile() : string
- Get codeBase Changes file
- getSystemComponentController() : SystemComponentController
- Returns the main controller
- getUpdateWebsiteDetailsFromYml() : array<string|int, mixed>
- Get update websiteDetailsFromYml
- registerDbUpdateHooks() : mixed
- Register DB Update hooks
- storeUpdateWebsiteDetailsToYml() : null
- Store the website details into the YML file
- updateCodeBase() : mixed
- Update CodeBase
- getDoctrineMigrationCommand() : object
- Get the doctrine migrations command as object
- rollBackDelta() : mixed
- Rollback the delta to make the website as old state
Properties
$cli
Command Line Interface
protected
Application
$cli
= null
| null
$cx
Main class instance
protected
Cx
$cx
= null
$pendingCodeBaseChangesYml
pending codeBase changes yml
protected
string
$pendingCodeBaseChangesYml
= 'PendingCodeBaseChanges.yml'
$systemComponentController
SystemComponentController for this Component
private
SystemComponentController
$systemComponentController
= null
Methods
__call()
Route methods like getName(), getType(), getDirectory(), etc.
public
__call(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
- $methodName : string
-
Name of method to call
- $arguments : array<string|int, mixed>
-
List of arguments for the method to call
Return values
mixed —Return value of the method to call
__construct()
Creates new controller
public
__construct(SystemComponentController $systemComponentController, Cx $cx) : mixed
Parameters
- $systemComponentController : SystemComponentController
-
Main controller for this system component
- $cx : Cx
-
Main class instance
applyDelta()
Get the serialized Delta
public
applyDelta() : null
This loads the serialized Delta and calls applyNext() on it until returns false.
Return values
nullcalculateDbDelta()
Calculate database delta
public
calculateDbDelta(int $oldVersion, string $codeBasePath) : mixed
It will calculate which codeBase database update scripts need to be executed. If the original version number is smaller than new version number, Add each version between those two versions to the delta as non-rollback updates otherwise delta as rollback updates
Parameters
- $oldVersion : int
- $codeBasePath : string
getAllCodeBaseVersions()
getAllCodeBaseVersions
public
getAllCodeBaseVersions(string $codeBasePath) : array<string|int, mixed>
Parameters
- $codeBasePath : string
-
codeBase path
Return values
array<string|int, mixed> —codeBase versions
getDoctrineMigrationCli()
Get Doctrine Migration Command Line Interface
public
getDoctrineMigrationCli() : Application
Return values
ApplicationgetPendingCodeBaseChangesFile()
Get codeBase Changes file
public
getPendingCodeBaseChangesFile() : string
Return values
string —$pendingCodeBaseChangesYml
getSystemComponentController()
Returns the main controller
public
getSystemComponentController() : SystemComponentController
Return values
SystemComponentController —Main controller for this system component
getUpdateWebsiteDetailsFromYml()
Get update websiteDetailsFromYml
public
getUpdateWebsiteDetailsFromYml(string $file) : array<string|int, mixed>
Parameters
- $file : string
-
yml file name
Return values
array<string|int, mixed> —website details
registerDbUpdateHooks()
Register DB Update hooks
public
registerDbUpdateHooks(Delta $delta) : mixed
This saves the calculated delta to /tmp/Update/$pendingCodeBaseChangesYml. It contains a serialized Delta.
Parameters
- $delta : Delta
Tags
storeUpdateWebsiteDetailsToYml()
Store the website details into the YML file
public
storeUpdateWebsiteDetailsToYml(string $folderPath, string $filePath, array<string|int, mixed> $ymlContent) : null
Parameters
- $folderPath : string
- $filePath : string
- $ymlContent : array<string|int, mixed>
Return values
nullupdateCodeBase()
Update CodeBase
public
updateCodeBase(string $newCodeBaseVersion, string $installationRootPath[, string $oldCodeBaseVersion = '' ]) : mixed
Parameters
- $newCodeBaseVersion : string
-
latest codeBase version
- $installationRootPath : string
-
installationRoot path
- $oldCodeBaseVersion : string = ''
-
old codeBase version
getDoctrineMigrationCommand()
Get the doctrine migrations command as object
protected
getDoctrineMigrationCommand(string $migrationCommandNameSpace, object $configuration) : object
Parameters
- $migrationCommandNameSpace : string
- $configuration : object
Return values
object —doctrine migration command
rollBackDelta()
Rollback the delta to make the website as old state
protected
rollBackDelta() : mixed