本文整理汇总了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) {