本文整理匯總了PHP中PMA_getMaintainActionlink函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getMaintainActionlink函數的具體用法?PHP PMA_getMaintainActionlink怎麽用?PHP PMA_getMaintainActionlink使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_getMaintainActionlink函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PMA_getListofMaintainActionLink
/**
* Get HTML 'li' having a link of maintain action
*
* @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not
* @param boolean $is_innodb whether innodb or not
* @param array $url_params array of URL parameters
* @param boolean $is_berkeleydb whether berkeleydb or not
*
* @return string $html_output
*/
function PMA_getListofMaintainActionLink($is_myisam_or_aria, $is_innodb, $url_params, $is_berkeleydb)
{
$html_output = '';
// analyze table
if ($is_innodb || $is_myisam_or_aria || $is_berkeleydb) {
$params = array('sql_query' => 'ANALYZE TABLE ' . PMA\libraries\Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Analyze table'), $params, $url_params, 'ANALYZE_TABLE');
}
// check table
if ($is_myisam_or_aria || $is_innodb) {
$params = array('sql_query' => 'CHECK TABLE ' . PMA\libraries\Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Check table'), $params, $url_params, 'CHECK_TABLE');
}
// checksum table
$params = array('sql_query' => 'CHECKSUM TABLE ' . Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Checksum table'), $params, $url_params, 'CHECKSUM_TABLE');
// defragment table
if ($is_innodb) {
$params = array('sql_query' => 'ALTER TABLE ' . PMA\libraries\Util::backquote($GLOBALS['table']) . ' ENGINE = InnoDB;');
$html_output .= PMA_getMaintainActionlink(__('Defragment table'), $params, $url_params, 'InnoDB_File_Defragmenting');
}
// flush table
$params = array('sql_query' => 'FLUSH TABLE ' . PMA\libraries\Util::backquote($GLOBALS['table']), 'message_to_show' => sprintf(__('Table %s has been flushed.'), htmlspecialchars($GLOBALS['table'])), 'reload' => 1);
$html_output .= PMA_getMaintainActionlink(__('Flush the table (FLUSH)'), $params, $url_params, 'FLUSH');
// optimize table
if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
$params = array('sql_query' => 'OPTIMIZE TABLE ' . PMA\libraries\Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Optimize table'), $params, $url_params, 'OPTIMIZE_TABLE');
}
// repair table
if ($is_myisam_or_aria) {
$params = array('sql_query' => 'REPAIR TABLE ' . PMA\libraries\Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Repair table'), $params, $url_params, 'REPAIR_TABLE');
}
return $html_output;
}
示例2: testGetMaintainActionlink
/**
* Test for PMA_getMaintainActionlink
*
* @return void
*/
public function testGetMaintainActionlink()
{
$this->assertRegExp('/.*href="sql.php.*post.*/', PMA_getMaintainActionlink("post", array("name" => 'foo', "value" => 'bar'), array(), 'doclink'));
}
示例3: PMA_getListofMaintainActionLink
/**
* Get HTML 'li' having a link of maintain action
*
* @param Table $pma_table Table object
* @param array $url_params Array of URL parameters
*
* @return string $html_output
*/
function PMA_getListofMaintainActionLink($pma_table, $url_params)
{
$html_output = '';
// analyze table
if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB'))) {
$params = array('sql_query' => 'ANALYZE TABLE ' . Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Analyze table'), $params, $url_params, 'ANALYZE_TABLE');
}
// check table
if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB'))) {
$params = array('sql_query' => 'CHECK TABLE ' . Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Check table'), $params, $url_params, 'CHECK_TABLE');
}
// checksum table
$params = array('sql_query' => 'CHECKSUM TABLE ' . Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Checksum table'), $params, $url_params, 'CHECKSUM_TABLE');
// defragment table
if ($pma_table->isEngine(array('INNODB'))) {
$params = array('sql_query' => 'ALTER TABLE ' . Util::backquote($GLOBALS['table']) . ' ENGINE = InnoDB;');
$html_output .= PMA_getMaintainActionlink(__('Defragment table'), $params, $url_params, 'InnoDB_File_Defragmenting');
}
// flush table
$params = array('sql_query' => 'FLUSH TABLE ' . Util::backquote($GLOBALS['table']), 'message_to_show' => sprintf(__('Table %s has been flushed.'), htmlspecialchars($GLOBALS['table'])), 'reload' => 1);
$html_output .= PMA_getMaintainActionlink(__('Flush the table (FLUSH)'), $params, $url_params, 'FLUSH');
// optimize table
if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB'))) {
$params = array('sql_query' => 'OPTIMIZE TABLE ' . Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Optimize table'), $params, $url_params, 'OPTIMIZE_TABLE');
}
// repair table
if ($pma_table->isEngine(array('MYISAM', 'ARIA'))) {
$params = array('sql_query' => 'REPAIR TABLE ' . Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Repair table'), $params, $url_params, 'REPAIR_TABLE');
}
return $html_output;
}
示例4: PMA_getListofMaintainActionLink
/**
* Get HTML 'li' having a link of maintain action
*
* @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not
* @param boolean $is_innodb whether innodb or not
* @param array $url_params array of URL parameters
* @param boolean $is_berkeleydb whether berkeleydb or not
*
* @return string $html_output
*/
function PMA_getListofMaintainActionLink($is_myisam_or_aria, $is_innodb, $url_params, $is_berkeleydb)
{
$html_output = '';
if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
if ($is_myisam_or_aria || $is_innodb) {
$params = array('sql_query' => 'CHECK TABLE ' . PMA_Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Check table'), $params, $url_params, 'CHECK_TABLE');
}
if ($is_innodb) {
$params = array('sql_query' => 'ALTER TABLE ' . PMA_Util::backquote($GLOBALS['table']) . ' ENGINE = InnoDB;');
$html_output .= PMA_getMaintainActionlink(__('Defragment table'), $params, $url_params, 'InnoDB_File_Defragmenting', 'Table_types');
}
if ($is_innodb || $is_myisam_or_aria || $is_berkeleydb) {
$params = array('sql_query' => 'ANALYZE TABLE ' . PMA_Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Analyze table'), $params, $url_params, 'ANALYZE_TABLE');
}
if ($is_myisam_or_aria && !PMA_DRIZZLE) {
$params = array('sql_query' => 'REPAIR TABLE ' . PMA_Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Repair table'), $params, $url_params, 'REPAIR_TABLE');
}
if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb) && !PMA_DRIZZLE) {
$params = array('sql_query' => 'OPTIMIZE TABLE ' . PMA_Util::backquote($GLOBALS['table']), 'table_maintenance' => 'Go');
$html_output .= PMA_getMaintainActionlink(__('Optimize table'), $params, $url_params, 'OPTIMIZE_TABLE');
}
}
// end MYISAM or BERKELEYDB case
$params = array('sql_query' => 'FLUSH TABLE ' . PMA_Util::backquote($GLOBALS['table']), 'message_to_show' => sprintf(__('Table %s has been flushed.'), htmlspecialchars($GLOBALS['table'])), 'reload' => 1);
$html_output .= PMA_getMaintainActionlink(__('Flush the table (FLUSH)'), $params, $url_params, 'FLUSH');
return $html_output;
}