当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_getHtmlForReplicationStatusTable函数代码示例

本文整理汇总了PHP中PMA_getHtmlForReplicationStatusTable函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getHtmlForReplicationStatusTable函数的具体用法?PHP PMA_getHtmlForReplicationStatusTable怎么用?PHP PMA_getHtmlForReplicationStatusTable使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_getHtmlForReplicationStatusTable函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_getHtmlForReplicationInfo

/**
 * Returns HTML to display replication information
 *
 * @return string HTML on replication
 */
function PMA_getHtmlForReplicationInfo()
{
    $retval = '<p class="notice clearfloat">';
    if ($GLOBALS['replication_info']['master']['status'] && $GLOBALS['replication_info']['slave']['status']) {
        $retval .= __('This MySQL server works as <b>master</b> and ' . '<b>slave</b> in <b>replication</b> process.');
    } elseif ($GLOBALS['replication_info']['master']['status']) {
        $retval .= __('This MySQL server works as <b>master</b> ' . 'in <b>replication</b> process.');
    } elseif ($GLOBALS['replication_info']['slave']['status']) {
        $retval .= __('This MySQL server works as <b>slave</b> ' . 'in <b>replication</b> process.');
    }
    $retval .= '</p>';
    /*
     * if the server works as master or slave in replication process,
     * display useful information
     */
    $retval .= '<hr class="clearfloat" />';
    $retval .= '<h3><a name="replication">';
    $retval .= __('Replication status');
    $retval .= '</a></h3>';
    foreach ($GLOBALS['replication_types'] as $type) {
        if (isset($GLOBALS['replication_info'][$type]['status']) && $GLOBALS['replication_info'][$type]['status']) {
            $retval .= PMA_getHtmlForReplicationStatusTable($type);
        }
    }
    return $retval;
}
开发者ID:phpmyadmin,项目名称:phpmyadmin,代码行数:31,代码来源:server_status.lib.php

示例2: PMA_getHtmlForServerStateGeneralInfo

/**
 * Prints server state General information
 *
 * @param PMA_ServerStatusData $ServerStatusData Server status data
 *
 * @return string
 */
function PMA_getHtmlForServerStateGeneralInfo($ServerStatusData)
{
    $start_time = $GLOBALS['dbi']->fetchValue('SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime']);
    $retval = '<h3>';
    $bytes_received = $ServerStatusData->status['Bytes_received'];
    $bytes_sent = $ServerStatusData->status['Bytes_sent'];
    $retval .= sprintf(__('Network traffic since startup: %s'), implode(' ', PMA_Util::formatByteDown($bytes_received + $bytes_sent, 3, 1)));
    $retval .= '</h3>';
    $retval .= '<p>';
    $retval .= sprintf(__('This MySQL server has been running for %1$s. It started up on %2$s.'), PMA_Util::timespanFormat($ServerStatusData->status['Uptime']), PMA_Util::localisedDate($start_time)) . "\n";
    $retval .= '</p>';
    if ($GLOBALS['replication_info']['master']['status'] || $GLOBALS['replication_info']['slave']['status']) {
        $retval .= '<p class="notice">';
        if ($GLOBALS['replication_info']['master']['status'] && $GLOBALS['replication_info']['slave']['status']) {
            $retval .= __('This MySQL server works as <b>master</b> and ' . '<b>slave</b> in <b>replication</b> process.');
        } elseif ($GLOBALS['replication_info']['master']['status']) {
            $retval .= __('This MySQL server works as <b>master</b> ' . 'in <b>replication</b> process.');
        } elseif ($GLOBALS['replication_info']['slave']['status']) {
            $retval .= __('This MySQL server works as <b>slave</b> ' . 'in <b>replication</b> process.');
        }
        $retval .= '</p>';
    }
    /*
     * if the server works as master or slave in replication process,
     * display useful information
     */
    if ($GLOBALS['replication_info']['master']['status'] || $GLOBALS['replication_info']['slave']['status']) {
        $retval .= '<hr class="clearfloat" />';
        $retval .= '<h3><a name="replication">';
        $retval .= __('Replication status');
        $retval .= '</a></h3>';
        foreach ($GLOBALS['replication_types'] as $type) {
            if (isset($GLOBALS['replication_info'][$type]['status']) && $GLOBALS['replication_info'][$type]['status']) {
                $retval .= PMA_getHtmlForReplicationStatusTable($type);
            }
        }
    }
    return $retval;
}
开发者ID:Timandes,项目名称:phpmyadmin,代码行数:46,代码来源:server_status.lib.php

示例3: PMA_getHtmlForSlaveConfiguration

/**
 * returns HTML for slave replication configuration
 *
 * @param bool  $server_slave_status      Whether it is Master or Slave
 * @param Array $server_slave_replication Slave replication
 *
 * @return String HTML code
 */
function PMA_getHtmlForSlaveConfiguration($server_slave_status, $server_slave_replication)
{
    $html = '<fieldset>';
    $html .= '<legend>' . __('Slave replication') . '</legend>';
    /**
     * check for multi-master replication functionality
     */
    $server_slave_multi_replication = $GLOBALS['dbi']->fetchResult('SHOW ALL SLAVES STATUS');
    if ($server_slave_multi_replication) {
        $html .= __('Master connection:');
        $html .= '<form method="get" action="server_replication.php">';
        $html .= PMA_URL_getHiddenInputs($GLOBALS['url_params']);
        $html .= ' <select name="master_connection">';
        $html .= '<option value="">' . __('Default') . '</option>';
        foreach ($server_slave_multi_replication as $server) {
            $html .= '<option' . (isset($_REQUEST['master_connection']) && $_REQUEST['master_connection'] == $server['Connection_name'] ? ' selected="selected"' : '') . '>' . $server['Connection_name'] . '</option>';
        }
        $html .= '</select>';
        $html .= ' <input type="submit" value="' . __('Go') . '" id="goButton" />';
        $html .= '</form>';
        $html .= '<br /><br />';
    }
    if ($server_slave_status) {
        $html .= '<div id="slave_configuration_gui">';
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sr_take_action'] = true;
        $_url_params['sr_slave_server_control'] = true;
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
            $_url_params['sr_slave_action'] = 'start';
        } else {
            $_url_params['sr_slave_action'] = 'stop';
        }
        $_url_params['sr_slave_control_parm'] = 'IO_THREAD';
        $slave_control_io_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $_url_params['sr_slave_action'] = 'start';
        } else {
            $_url_params['sr_slave_action'] = 'stop';
        }
        $_url_params['sr_slave_control_parm'] = 'SQL_THREAD';
        $slave_control_sql_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No' || $server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $_url_params['sr_slave_action'] = 'start';
        } else {
            $_url_params['sr_slave_action'] = 'stop';
        }
        $_url_params['sr_slave_control_parm'] = null;
        $slave_control_full_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        $_url_params['sr_slave_action'] = 'reset';
        $slave_control_reset_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sr_take_action'] = true;
        $_url_params['sr_slave_skip_error'] = true;
        $slave_skip_error_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $html .= PMA_Message::error(__('Slave SQL Thread not running!'))->getDisplay();
        }
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
            $html .= PMA_Message::error(__('Slave IO Thread not running!'))->getDisplay();
        }
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sl_configure'] = true;
        $_url_params['repl_clear_scr'] = true;
        $reconfiguremaster_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        $html .= __('Server is configured as slave in a replication process. Would you ' . 'like to:');
        $html .= '<br />';
        $html .= '<ul>';
        $html .= ' <li><a href="#" id="slave_status_href">';
        $html .= __('See slave status table') . '</a>';
        $html .= PMA_getHtmlForReplicationStatusTable('slave', true, false);
        $html .= ' </li>';
        $html .= ' <li><a href="#" id="slave_control_href">';
        $html .= __('Control slave:') . '</a>';
        $html .= ' <div id="slave_control_gui" style="display: none">';
        $html .= '  <ul>';
        $html .= '   <li><a href="' . $slave_control_full_link . '">';
        $html .= ($server_slave_replication[0]['Slave_IO_Running'] == 'No' || $server_slave_replication[0]['Slave_SQL_Running'] == 'No' ? __('Full start') : __('Full stop')) . ' </a></li>';
        $html .= '   <li><a href="' . $slave_control_reset_link . '">';
        $html .= __('Reset slave') . '</a></li>';
        if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $html .= '   <li><a href="' . $slave_control_sql_link . '">';
            $html .= __('Start SQL Thread only') . '</a></li>';
        } else {
            $html .= '   <li><a href="' . $slave_control_sql_link . '">';
            $html .= __('Stop SQL Thread only') . '</a></li>';
        }
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
            $html .= '   <li><a href="' . $slave_control_io_link . '">';
            $html .= __('Start IO Thread only') . '</a></li>';
        } else {
            $html .= '   <li><a href="' . $slave_control_io_link . '">';
            $html .= __('Stop IO Thread only') . '</a></li>';
//.........这里部分代码省略.........
开发者ID:bajajahsaas,项目名称:phpmyadmin,代码行数:101,代码来源:replication_gui.lib.php

示例4: PMA_getHtmlForSlaveConfiguration

/**
 * returns HTML for slave replication configuration
 *
 * @param bool  $server_slave_status      Whether it is Master or Slave
 * @param Array $server_slave_replication Slave replication
 *
 * @return String HTML code
 */
function PMA_getHtmlForSlaveConfiguration($server_slave_status, $server_slave_replication)
{
    $html = '<fieldset>';
    $html .= '<legend>' . __('Slave replication') . '</legend>';
    if ($server_slave_status) {
        $html .= '<div id="slave_configuration_gui">';
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sr_take_action'] = true;
        $_url_params['sr_slave_server_control'] = true;
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
            $_url_params['sr_slave_action'] = 'start';
        } else {
            $_url_params['sr_slave_action'] = 'stop';
        }
        $_url_params['sr_slave_control_parm'] = 'IO_THREAD';
        $slave_control_io_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $_url_params['sr_slave_action'] = 'start';
        } else {
            $_url_params['sr_slave_action'] = 'stop';
        }
        $_url_params['sr_slave_control_parm'] = 'SQL_THREAD';
        $slave_control_sql_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No' || $server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $_url_params['sr_slave_action'] = 'start';
        } else {
            $_url_params['sr_slave_action'] = 'stop';
        }
        $_url_params['sr_slave_control_parm'] = null;
        $slave_control_full_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        $_url_params['sr_slave_action'] = 'reset';
        $slave_control_reset_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sr_slave_skip_error'] = true;
        $slave_skip_error_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $html .= PMA_Message::error(__('Slave SQL Thread not running!'))->getDisplay();
        }
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
            $html .= PMA_Message::error(__('Slave IO Thread not running!'))->getDisplay();
        }
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sl_configure'] = true;
        $_url_params['repl_clear_scr'] = true;
        $reconfiguremaster_link = 'server_replication.php' . PMA_URL_getCommon($_url_params);
        $html .= __('Server is configured as slave in a replication process. Would you like to:');
        $html .= '<br />';
        $html .= '<ul>';
        $html .= ' <li><a href="#" id="slave_status_href">';
        $html .= __('See slave status table') . '</a>';
        $html .= PMA_getHtmlForReplicationStatusTable('slave', true, false);
        $html .= ' </li>';
        $html .= ' <li><a href="#" id="slave_control_href">';
        $html .= __('Control slave:') . '</a>';
        $html .= ' <div id="slave_control_gui" style="display: none">';
        $html .= '  <ul>';
        $html .= '   <li><a href="' . $slave_control_full_link . '">';
        $html .= ($server_slave_replication[0]['Slave_IO_Running'] == 'No' || $server_slave_replication[0]['Slave_SQL_Running'] == 'No' ? __('Full start') : __('Full stop')) . ' </a></li>';
        $html .= '   <li><a href="' . $slave_control_reset_link . '">';
        $html .= __('Reset slave') . '</a></li>';
        if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
            $html .= '   <li><a href="' . $slave_control_sql_link . '">';
            $html .= __('Start SQL Thread only') . '</a></li>';
        } else {
            $html .= '   <li><a href="' . $slave_control_sql_link . '">';
            $html .= __('Stop SQL Thread only') . '</a></li>';
        }
        if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
            $html .= '   <li><a href="' . $slave_control_io_link . '">';
            $html .= __('Start IO Thread only') . '</a></li>';
        } else {
            $html .= '   <li><a href="' . $slave_control_io_link . '">';
            $html .= __('Stop IO Thread only') . '</a></li>';
        }
        $html .= '  </ul>';
        $html .= ' </div>';
        $html .= ' </li>';
        $html .= ' <li>';
        $html .= PMA_getHtmlForSlaveErrorManagement($slave_skip_error_link);
        $html .= ' </li>';
        $html .= ' <li><a href="' . $reconfiguremaster_link . '">';
        $html .= __('Change or reconfigure master server') . '</a></li>';
        $html .= '</ul>';
        $html .= '</div>';
    } elseif (!isset($_REQUEST['sl_configure'])) {
        $_url_params = $GLOBALS['url_params'];
        $_url_params['sl_configure'] = true;
        $_url_params['repl_clear_scr'] = true;
        $html .= sprintf(__('This server is not configured as slave in a replication process. ' . 'Would you like to <a href="%s">configure</a> it?'), 'server_replication.php' . PMA_URL_getCommon($_url_params));
    }
    $html .= '</fieldset>';
    return $html;
//.........这里部分代码省略.........
开发者ID:yszar,项目名称:linuxwp,代码行数:101,代码来源:replication_gui.lib.php


注:本文中的PMA_getHtmlForReplicationStatusTable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。