\UbillingUpdateManager
Performs deploy of database and config files updates
Synopsis
class UbillingUpdateManager
{
- // constants
- const URL_RELEASE_STABLE = 'http://ubilling.net.ua/RELEASE';
- const URL_RELEASE_CURRENT = 'http://snaps.ubilling.net.ua/RELEASE';
- const DUMPS_PATH = 'content/updates/sql/';
- const CONFIGS_PATH = 'content/updates/configs/';
- const URL_ME = '?module=updatemanager';
- const URL_RELNOTES = 'wiki.ubilling.net.ua/doku.php?id=relnotes#section';
- const ROUTE_AUTOSYSUPGRADE = 'autosystemupgrade';
- const PROUTE_UPGRADEAGREE = 'runsystemupgrade';
- const PID_AUTOSYSUPGRADE = 'UPDMGRAUTOUPGRADE';
- // members
- protected array $altCfg = ;
- protected array $billCfg = ;
- protected array $mySqlCfg = ;
- protected $messages = '';
- protected array $allDumps = ;
- protected array $allConfigs = ;
- protected array $configFileNames = ;
- protected string $sudoPath = '/usr/local/bin/sudo';
- protected string $atoupdaterPath = '/bin/ubautoupgrade.sh';
- // methods
- public void __construct()
- protected void loadSystemConfigs()
- protected void setOptions()
- protected void initMessages()
- protected void loadDumps()
- protected void loadConfigs()
- protected void setConfigFilenames()
- protected MySQLDB ConnectDB()
- protected string getReleaseConfigFiles()
- public bool isUpdaterAvailable()
- protected string DoSqlDump()
- public string renderSqlDumpsList()
- public string renderConfigsList()
- public string applyMysqlDump()
- protected void fixAccessRights()
- public string applyConfigOptions()
- public string renderVersionInfo()
- public void/string performAutoUpgrade()
Constants
| Name | Value |
|---|---|
| URL_RELEASE_STABLE | 'http://ubilling.net.ua/RELEASE' |
| URL_RELEASE_CURRENT | 'http://snaps.ubilling.net.ua/RELEASE' |
| DUMPS_PATH | 'content/updates/sql/' |
| CONFIGS_PATH | 'content/updates/configs/' |
| URL_ME | '?module=updatemanager' |
| URL_RELNOTES | 'wiki.ubilling.net.ua/doku.php?id=relnotes#section' |
| ROUTE_AUTOSYSUPGRADE | 'autosystemupgrade' |
| PROUTE_UPGRADEAGREE | 'runsystemupgrade' |
| PID_AUTOSYSUPGRADE | 'UPDMGRAUTOUPGRADE' |
Members
protected
- $allConfigs
—
array
Contains available configs updates as release=>configdata - $allDumps
—
array
Available mysql dumps for apply as release=>filename - $altCfg
—
array
System alter.ini config as key=>value - $atoupdaterPath
—
string
Automatic updater full path - $billCfg
—
array
System billing.ini config as key=>value - $configFileNames
—
array
Contais configs filenames as shortid=>filename - $messages
—
System message helper object placeholder - $mySqlCfg
—
array
System mysql.ini config as key=>value - $sudoPath
—
string
system sudo path
Methods
protected
- ConnectDB() — Initialises connection with Ubilling database server and selects needed db
- DoSqlDump() — Apply Mysql Dump and returns results
- fixAccessRights() — Changes access rights for some path to be writable
- getReleaseConfigFiles() — Returns list of files which was updated in some release
- initMessages() — Inits system messages helper object instance
- loadConfigs() — Loads available configs update into protected prop
- loadDumps() — Loads available mysql dumps filenames into protected prop
- loadSystemConfigs() — Loads all required system config files into protected props for further usage
- setConfigFilenames() — Sets shortid=>filename with path configs associations array
- setOptions() — Sets all required options
public
- __construct() — Creates new update manager instance
- applyConfigOptions() — Renders interface and applies new options to some config files
- applyMysqlDump() — Applies mysql dump to current database
- isUpdaterAvailable() — Checks is CLI batch updater available or not?
- performAutoUpgrade() — Performs automatic system upgrade
- renderConfigsList() — Renders list of available config files updates
- renderSqlDumpsList() — Renders list of sql dumps available for applying
- renderVersionInfo() — Renders current release info data and update check controls