當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_Replication_Slave_control函數代碼示例

本文整理匯總了PHP中PMA_Replication_Slave_control函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_Replication_Slave_control函數的具體用法?PHP PMA_Replication_Slave_control怎麽用?PHP PMA_Replication_Slave_control使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_Replication_Slave_control函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PMA_Replication_Slave_changeMaster

/**
 * Changes master for replication slave
 *
 * @param string $user     replication user on master
 * @param string $password password for the user
 * @param string $host     master's hostname or IP
 * @param int    $port     port, where mysql is running
 * @param array  $pos      position of mysql replication,
 *                         array should contain fields File and Position
 * @param bool   $stop     shall we stop slave?
 * @param bool   $start    shall we start slave?
 * @param mixed  $link     mysql link
 *
 * @return string output of CHANGE MASTER mysql command
 */
function PMA_Replication_Slave_changeMaster($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null)
{
    if ($stop) {
        PMA_Replication_Slave_control("STOP", null, $link);
    }
    $out = $GLOBALS['dbi']->tryQuery('CHANGE MASTER TO ' . 'MASTER_HOST=\'' . $host . '\',' . 'MASTER_PORT=' . $port * 1 . ',' . 'MASTER_USER=\'' . $user . '\',' . 'MASTER_PASSWORD=\'' . $password . '\',' . 'MASTER_LOG_FILE=\'' . $pos["File"] . '\',' . 'MASTER_LOG_POS=' . $pos["Position"] . ';', $link);
    if ($start) {
        PMA_Replication_Slave_control("START", null, $link);
    }
    return $out;
}
開發者ID:itgsod-philip-skalander,項目名稱:phpmyadmin,代碼行數:26,代碼來源:replication.inc.php

示例2: PMA_handleRequestForSlaveSkipError

/**
 * handle control requests for Slave Skip Error
 *
 * @return boolean
 */
function PMA_handleRequestForSlaveSkipError()
{
    $count = 1;
    if (isset($_REQUEST['sr_skip_errors_count'])) {
        $count = $_REQUEST['sr_skip_errors_count'] * 1;
    }
    $qStop = PMA_Replication_Slave_control("STOP");
    $qSkip = $GLOBALS['dbi']->tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";");
    $qStart = PMA_Replication_Slave_control("START");
    $result = $qStop !== false && $qStop !== -1 && $qSkip !== false && $qSkip !== -1 && $qStart !== false && $qStart !== -1;
    return $result;
}
開發者ID:bajajahsaas,項目名稱:phpmyadmin,代碼行數:17,代碼來源:replication_gui.lib.php

示例3: PMA_handleRequestForSlaveSkipError

/**
 * handle control requests for Slave Skip Error
 *
 * @return NULL
 */
function PMA_handleRequestForSlaveSkipError()
{
    $count = 1;
    if (isset($_REQUEST['sr_skip_errors_count'])) {
        $count = $_REQUEST['sr_skip_errors_count'] * 1;
    }
    PMA_Replication_Slave_control("STOP");
    $GLOBALS['dbi']->tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";");
    PMA_Replication_Slave_control("START");
}
開發者ID:roccivic,項目名稱:phpmyadmin,代碼行數:15,代碼來源:replication_gui.lib.php


注:本文中的PMA_Replication_Slave_control函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。