\UnicornTeleport
Can unicorns teleport? I hope so.
Synopsis
class UnicornTeleport
{
- // constants
- const PID_TELEPORT = 'UNICORNTELEPORT';
- const PROUTE_ARCH = 'defaultarch';
- const PROUTE_INT_IF = 'defaultintif';
- const PROUTE_EXT_IF = 'defaultextif';
- const ROUTE_DOWNLOAD = 'download';
- const PROUTE_PACK_DATABASE = 'packdatabase';
- const PROUTE_PACK_WWWDATA = 'packwwwdata';
- const PROUTE_PACK_APACHE_CONF = 'packapacheconf';
- const PROUTE_PACK_RC_CONF = 'packrcconf';
- const PROUTE_PACK_FIREWALL_CONF = 'packfirewallconf';
- const PROUTE_PACK_STGCONFIG = 'packstgconfig';
- const PROUTE_PACK_CRONTAB = 'packcrontab';
- const URL_ME = '?module=unicornteleport';
- // members
- protected string $ubinstallerUrl = 'http://snaps.ubilling.net.ua/';
- protected string $ubinstllerName = 'ubinstaller_current.tar.gz';
- protected string $saveApacheDataPath = '/usr/local/www/apache24/data/';
- protected string $saveApacheConfPath = '/usr/local/etc/apache24/';
- protected string $backupsPath = 'content/backups/sql/';
- protected string $saveRcConfPath = '/etc/rc.conf';
- protected string $saveFirewallConf = '/etc/firewall.conf';
- protected string $saveStargazerDirPath = '/etc/stargazer/';
- protected string $saveStargazerConfPath = '/etc/stargazer/stargazer.conf';
- protected string $tmpPath = '/tmp/unicornteleport/';
- protected string $teleportExportPath = 'exports/';
- protected string $teleportDownloadName = 'unicornteleport.tgz';
- protected string $teleportDumpName = 'unicornteleport.sql';
- protected string $sudoPath = '';
- protected string $tarPath = '';
- protected string $gzipPath = '';
- protected string $grepPath = '';
- protected string $mysqlPath = '';
- protected string $crontabPath = '/usr/bin/crontab';
- protected string $currentRelease = '';
- protected array $teleportData = ;
- protected array $packagesAvailable = ;
- protected array $altCfg = ;
- protected array $billCfg = ;
- protected array $mySqlCfg = ;
- protected $startDust = '';
- protected array $errorMessages = ;
- protected $messages = '';
- // methods
- public void __construct()
- protected void initMessages()
- protected void initStartDust()
- protected void initConfigs()
- protected bool checkSysPaths()
- protected void loadPackagesAvailable()
- protected void loadMigrationData()
- protected bool checkTeleportData()
- protected void prepareTempDir()
- protected void flushTempDir()
- protected string backupDatabase()
- protected bool archivePath()
- public void catchFileDownload()
- protected string renderTeleportReadme()
- protected string runTeleportExport()
- protected string getTeleportForm()
- public string renderTeleportForm()
Constants
| Name | Value |
|---|---|
| PID_TELEPORT | 'UNICORNTELEPORT' |
| PROUTE_ARCH | 'defaultarch' |
| PROUTE_INT_IF | 'defaultintif' |
| PROUTE_EXT_IF | 'defaultextif' |
| ROUTE_DOWNLOAD | 'download' |
| PROUTE_PACK_DATABASE | 'packdatabase' |
| PROUTE_PACK_WWWDATA | 'packwwwdata' |
| PROUTE_PACK_APACHE_CONF | 'packapacheconf' |
| PROUTE_PACK_RC_CONF | 'packrcconf' |
| PROUTE_PACK_FIREWALL_CONF | 'packfirewallconf' |
| PROUTE_PACK_STGCONFIG | 'packstgconfig' |
| PROUTE_PACK_CRONTAB | 'packcrontab' |
| URL_ME | '?module=unicornteleport' |
Members
protected
- $altCfg
—
array
Alternative configuration array - $backupsPath
—
string
SQL backups directory path - $billCfg
—
array
Billing configuration array - $crontabPath
—
string
Crontab binary path - $currentRelease
—
string
Current Ubilling release version - $errorMessages
—
array
Error messages array - $grepPath
—
string
Grep binary path - $gzipPath
—
string
Gzip binary path - $messages
—
System messages helper object placeholder - $mySqlCfg
—
array
MySQL configuration array - $mysqlPath
—
string
MySQL binary path - $packagesAvailable
—
array
Available packages array - $saveApacheConfPath
—
string
Apache configuration directory path - $saveApacheDataPath
—
string
Apache web data directory path - $saveFirewallConf
—
string
Firewall configuration file path - $saveRcConfPath
—
string
RC configuration file path - $saveStargazerConfPath
—
string
Stargazer configuration file path - $saveStargazerDirPath
—
string
Stargazer configuration directory path - $startDust
—
StarDust object placeholder - $sudoPath
—
string
Sudo binary path - $tarPath
—
string
Tar binary path - $teleportData
—
array
Teleport migration data array - $teleportDownloadName
—
string
Teleport package filename - $teleportDumpName
—
string
Database dump filename - $teleportExportPath
—
string
Export directory path for teleport packages - $tmpPath
—
string
Temporary directory path for teleport operations - $ubinstallerUrl
—
string
Ubinstaller download URL - $ubinstllerName
—
string
Ubinstaller package filename
Methods
protected
- archivePath() — Archives specified path to target archive
- backupDatabase() — Creates database backup
- checkSysPaths() — Checks system binary paths availability
- checkTeleportData() — Validates teleport migration data
- flushTempDir() — Removes temporary directory and its contents
- getTeleportForm() — Renders teleport configuration form
- initConfigs() — Initializes configuration arrays and system paths
- initMessages() — Initializes system messages helper
- initStartDust() — Initializes StarDust process manager
- loadMigrationData() — Loads migration data including serial and passwords
- loadPackagesAvailable() — Loads available packages from remote API
- prepareTempDir() — Prepares temporary directory for teleport operations
- renderTeleportReadme() — Renders teleport README content
- runTeleportExport() — Executes teleport export process
public
- __construct() — Creates new UnicornTeleport instance
- catchFileDownload() — Handles file download request
- renderTeleportForm() — Renders main teleport form with validation