本文整理汇总了PHP中DBConnection::showAllReplicateDelay方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnection::showAllReplicateDelay方法的具体用法?PHP DBConnection::showAllReplicateDelay怎么用?PHP DBConnection::showAllReplicateDelay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnection
的用法示例。
在下文中一共展示了DBConnection::showAllReplicateDelay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFormDBSlave
/**
* Print the config form for slave DB
*
* @return Nothing (display)
**/
function showFormDBSlave()
{
global $DB, $CFG_GLPI, $DBslave;
if (!Config::canUpdate()) {
return false;
}
echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>";
echo "<div class='center' id='tabsbody'>";
echo "<input type='hidden' name='_dbslave_status' value='1'>";
echo "<table class='tab_cadre_fixe'>";
$active = DBConnection::isDBSlaveActive();
echo "<tr class='tab_bg_2'><th colspan='4'>" . _n('Mysql replica', 'Mysql replicas', Session::getPluralNumber()) . "</th></tr>";
$DBslave = DBConnection::getDBSlaveConf();
if (is_array($DBslave->dbhost)) {
$host = implode(' ', $DBslave->dbhost);
} else {
$host = $DBslave->dbhost;
}
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Mysql server') . "</td>";
echo "<td><input type='text' name='_dbreplicate_dbhost' size='40' value='{$host}'></td>";
echo "<td>" . __('Database') . "</td>";
echo "<td><input type='text' name='_dbreplicate_dbdefault' value='" . $DBslave->dbdefault . "'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Mysql user') . "</td>";
echo "<td><input type='text' name='_dbreplicate_dbuser' value='" . $DBslave->dbuser . "'></td>";
echo "<td>" . __('Mysql password') . "</td>";
echo "<td><input type='password' name='_dbreplicate_dbpassword' value='" . rawurldecode($DBslave->dbpassword) . "'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Use the slave for the search engine') . "</td><td>";
$values = array(0 => __('Never'), 1 => __('If synced (all changes)'), 2 => __('If synced (current user changes)'), 3 => __('If synced or read-only account'), 4 => __('Always'));
Dropdown::showFromArray('use_slave_for_search', $values, array('value' => $CFG_GLPI["use_slave_for_search"]));
echo "<td colspan='2'> </td>";
echo "</tr>";
if ($DBslave->connected && !$DB->isSlave()) {
echo "<tr class='tab_bg_2'><td colspan='4' class='center'>";
DBConnection::showAllReplicateDelay();
echo "</td></tr>";
}
echo "<tr class='tab_bg_2'><td colspan='4' class='center'>";
echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">";
echo "</td></tr>";
echo "</table></div>";
Html::closeForm();
}
示例2: showFormDBSlave
/**
* Print the config form for slave DB
*
* @return Nothing (display)
**/
function showFormDBSlave()
{
global $DB, $LANG, $CFG_GLPI, $DBSlave;
if (!haveRight("config", "w")) {
return false;
}
echo "<form name='form' action=\"" . getItemTypeFormURL(__CLASS__) . "\" method='post'>";
echo "<div class='center' id='tabsbody'>";
echo "<input type='hidden' name='id' value='" . $CFG_GLPI["id"] . "'>";
echo "<input type='hidden' name='_dbslave_status' value='1'>";
echo "<table class='tab_cadre_fixe'>";
$active = DBConnection::isDBSlaveActive();
echo "<tr class='tab_bg_2'><th colspan='4'>" . $LANG['setup'][800] . "</th></tr>";
$DBSlave = DBConnection::getDBSlaveConf();
if (is_array($DBSlave->dbhost)) {
$host = implode(' ', $DBSlave->dbhost);
} else {
$host = $DBSlave->dbhost;
}
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['install'][30] . " :</td>";
echo "<td><input type='text' name='_dbreplicate_dbhost' size='40' value='{$host}'></td>";
echo "<td>" . $LANG['setup'][802] . " :</td>";
echo "<td><input type='text' name='_dbreplicate_dbdefault' value='" . $DBSlave->dbdefault . "'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['install'][31] . " :</td>";
echo "<td><input type='text' name='_dbreplicate_dbuser' value='" . $DBSlave->dbuser . "'></td>";
echo "<td>" . $LANG['install'][32] . " :</td>";
echo "<td><input type='password' name='_dbreplicate_dbpassword' value='" . $DBSlave->dbpassword . "'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][804] . " :</td><td>";
Dropdown::showYesNo("use_slave_for_search", $CFG_GLPI["use_slave_for_search"]);
echo "<td colspan='2'> </td>";
echo "</tr>";
if ($DBSlave->connected && !$DB->isSlave()) {
echo "<tr class='tab_bg_2'><td colspan='4' class='center'>";
DBConnection::showAllReplicateDelay();
echo "</td></tr>";
}
echo "<tr class='tab_bg_2'><td colspan='4' class='center'>";
echo "<input type='submit' name='update' class='submit' value=\"" . $LANG['buttons'][2] . "\">";
echo "</td></tr>";
echo "</table></div>";
echo "</form>";
}