class Replication

PhpMyAdmin\Replication class

Methods

array
fillInfo(string $type, string $replicationInfoKey, array $mysqlInfo, string $mysqlKey)

Fill global replication_info variable.

string
extractDbOrTable(string $string, string $what = 'db')

Extracts database or table name from string

mixed
slaveControl(string $action, string $control = null, mixed $link = null)

Configures replication slave

string
slaveChangeMaster(string $user, string $password, string $host, int $port, array $pos, bool $stop = true, bool $start = true, mixed $link = null)

Changes master for replication slave

mixed
connectToMaster(string $user, string $password, string $host = null, int $port = null, string $socket = null)

This function provides connection to remote mysql server

array
slaveBinLogMaster(mixed $link = null)

Fetches position and file of current binary log on master

Details

at line 28
array fillInfo(string $type, string $replicationInfoKey, array $mysqlInfo, string $mysqlKey)

Fill global replication_info variable.

Parameters

string $type Type: master, slave
string $replicationInfoKey Key in replication_info variable
array $mysqlInfo MySQL data about replication
string $mysqlKey MySQL key

Return Value

array

at line 53
string extractDbOrTable(string $string, string $what = 'db')

Extracts database or table name from string

Parameters

string $string contains "dbname.tablename"
string $what what to extract (db|table)

Return Value

string the extracted part

at line 75
mixed slaveControl(string $action, string $control = null, mixed $link = null)

Configures replication slave

Parameters

string $action possible values: START or STOP
string $control default: null, possible values: SQL_THREAD or IO_THREAD or null. If it is set to null, it controls both SQL_THREAD and IO_THREAD
mixed $link mysql link

Return Value

mixed output of DatabaseInterface::tryQuery

at line 105
string slaveChangeMaster(string $user, string $password, string $host, int $port, array $pos, bool $stop = true, bool $start = true, mixed $link = null)

Changes master for replication slave

Parameters

string $user replication user on master
string $password password for the user
string $host master's hostname or IP
int $port port, where mysql is running
array $pos position of mysql replication, array should contain fields File and Position
bool $stop shall we stop slave?
bool $start shall we start slave?
mixed $link mysql link

Return Value

string output of CHANGE MASTER mysql command

at line 148
mixed connectToMaster(string $user, string $password, string $host = null, int $port = null, string $socket = null)

This function provides connection to remote mysql server

Parameters

string $user mysql username
string $password password for the user
string $host mysql server's hostname or IP
int $port mysql remote port
string $socket path to unix socket

Return Value

mixed mysql link on success

at line 175
array slaveBinLogMaster(mixed $link = null)

Fetches position and file of current binary log on master

Parameters

mixed $link mysql link

Return Value

array an array containing File and Position in MySQL replication on master server, useful for slaveChangeMaster()