本文整理匯總了PHP中PMA_AdjustPrivileges_renameOrMoveTable函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_AdjustPrivileges_renameOrMoveTable函數的具體用法?PHP PMA_AdjustPrivileges_renameOrMoveTable怎麽用?PHP PMA_AdjustPrivileges_renameOrMoveTable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_AdjustPrivileges_renameOrMoveTable函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PMA_moveOrCopyTable
/**
* Move or copy a table
*
* @param string $db current database name
* @param string $table current table name
*
* @return void
*/
function PMA_moveOrCopyTable($db, $table)
{
/**
* Selects the database to work with
*/
$GLOBALS['dbi']->selectDb($db);
/**
* $_REQUEST['target_db'] could be empty in case we came from an input field
* (when there are many databases, no drop-down)
*/
if (empty($_REQUEST['target_db'])) {
$_REQUEST['target_db'] = $db;
}
/**
* A target table name has been sent to this script -> do the work
*/
if (PMA_isValid($_REQUEST['new_name'])) {
if ($db == $_REQUEST['target_db'] && $table == $_REQUEST['new_name']) {
if (isset($_REQUEST['submit_move'])) {
$message = Message::error(__('Can\'t move table to same one!'));
} else {
$message = Message::error(__('Can\'t copy table to same one!'));
}
} else {
Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'], $_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table');
if (isset($_REQUEST['adjust_privileges']) && !empty($_REQUEST['adjust_privileges'])) {
if (isset($_REQUEST['submit_move'])) {
PMA_AdjustPrivileges_renameOrMoveTable($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name']);
} else {
PMA_AdjustPrivileges_copyTable($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name']);
}
if (isset($_REQUEST['submit_move'])) {
$message = Message::success(__('Table %s has been moved to %s. Privileges have been ' . 'adjusted.'));
} else {
$message = Message::success(__('Table %s has been copied to %s. Privileges have been ' . 'adjusted.'));
}
} else {
if (isset($_REQUEST['submit_move'])) {
$message = Message::success(__('Table %s has been moved to %s.'));
} else {
$message = Message::success(__('Table %s has been copied to %s.'));
}
}
$old = PMA\libraries\Util::backquote($db) . '.' . PMA\libraries\Util::backquote($table);
$message->addParam($old);
$new = PMA\libraries\Util::backquote($_REQUEST['target_db']) . '.' . PMA\libraries\Util::backquote($_REQUEST['new_name']);
$message->addParam($new);
/* Check: Work on new table or on old table? */
if (isset($_REQUEST['submit_move']) || PMA_isValid($_REQUEST['switch_to_new'])) {
}
}
} else {
/**
* No new name for the table!
*/
$message = Message::error(__('The table name is empty!'));
}
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA\libraries\Response::getInstance();
$response->addJSON('message', $message);
if ($message->isSuccess()) {
$response->addJSON('db', $GLOBALS['db']);
} else {
$response->setRequestStatus(false);
}
exit;
}
}
示例2: unset
include_once 'sql.php';
unset($result);
}
/**
* Updates table comment, type and options if required
*/
if (isset($_REQUEST['submitoptions'])) {
$_message = '';
$warning_messages = array();
if (isset($_REQUEST['new_name'])) {
// Get original names before rename operation
$oldTable = $pma_table->getName();
$oldDb = $pma_table->getDbName();
if ($pma_table->rename($_REQUEST['new_name'])) {
if (isset($_REQUEST['adjust_privileges']) && !empty($_REQUEST['adjust_privileges'])) {
PMA_AdjustPrivileges_renameOrMoveTable($oldDb, $oldTable, $_REQUEST['db'], $_REQUEST['new_name']);
}
// Reselect the original DB
$GLOBALS['db'] = $oldDb;
$GLOBALS['dbi']->selectDb($oldDb);
$_message .= $pma_table->getLastMessage();
$result = true;
$GLOBALS['table'] = $pma_table->getName();
$reread_info = true;
$reload = true;
} else {
$_message .= $pma_table->getLastError();
$result = false;
}
}
if (!empty($_REQUEST['new_tbl_storage_engine']) && mb_strtoupper($_REQUEST['new_tbl_storage_engine']) !== $tbl_storage_engine) {