Skip to content

Commit

Permalink
merged libraries\tbl_move_copy.php in class PMA_Table
Browse files Browse the repository at this point in the history
  • Loading branch information
CybotTM committed Feb 21, 2006
1 parent cd340d8 commit f341c72
Show file tree
Hide file tree
Showing 6 changed files with 557 additions and 561 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ $Source$
libraries/get_foreign.lib.php, libraries/relation.lib.php:
moved PMA_generateFieldSpec(), PMA_tableIsView(), PMA_countRecords(),
PMA_generateAlterTable() into class PMA_Table
* db_operations.php, tbl_move_copy.php, tbl_properties_operations.php,
libraries\Table.class.php, libraries\tbl_move_copy.php:
merged libraries\tbl_move_copy.php in class PMA_Table


2006-02-20 Marc Delisle <[email protected]>
Expand Down
51 changes: 25 additions & 26 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
/**
* requirements
*/
require_once('./libraries/common.lib.php');
require_once('./libraries/mysql_charsets.lib.php');
require_once './libraries/common.lib.php';
require_once './libraries/Table.class.php';
require_once './libraries/mysql_charsets.lib.php';

/**
* Rename/move or copy database
Expand All @@ -25,12 +26,10 @@
((isset($db_rename) && $db_rename == 'true') ||
(isset($db_copy) && $db_copy == 'true'))) {

require_once('./libraries/tbl_move_copy.php');

if (isset($db_rename) && $db_rename == 'true') {
$move = TRUE;
$move = true;
} else {
$move = FALSE;
$move = false;
}

if (!isset($newname) || !strlen($newname)) {
Expand Down Expand Up @@ -70,7 +69,7 @@
}

if ($this_what != 'nocopy') {
PMA_table_move_copy($db, $table, $newname, $table,
PMA_Table::moveCopy($db, $table, $newname, $table,
isset($this_what) ? $this_what : 'data', $move);
}

Expand All @@ -83,13 +82,13 @@
$get_fields = array('user', 'label', 'query');
$where_fields = array('dbase' => $db);
$new_fields = array('dbase' => $newname);
PMA_duplicate_table_info('bookmarkwork', 'bookmark', $get_fields,
PMA_Table::duplicateInfo('bookmarkwork', 'bookmark', $get_fields,
$where_fields, $new_fields);
}

if ($move) {
// cleanup pmadb stuff for this db
require_once('./libraries/relation_cleanup.lib.php');
require_once './libraries/relation_cleanup.lib.php';
PMA_relationsCleanupDatabase($db);

$local_query = 'DROP DATABASE ' . PMA_backquote($db) . ';';
Expand All @@ -101,17 +100,17 @@
$message = sprintf($strCopyDatabaseOK, htmlspecialchars($db),
htmlspecialchars($newname));
}
$reload = TRUE;
$reload = true;

/* Change database to be used */
if ($move) {
$db = $newname;
} else {
if (isset($switch_to_new) && $switch_to_new == 'true') {
PMA_setCookie( 'pma_switch_to_new', 'true' );
PMA_setCookie('pma_switch_to_new', 'true');
$db = $newname;
} else {
PMA_setCookie( 'pma_switch_to_new', '' );
PMA_setCookie('pma_switch_to_new', '');
}
}
}
Expand All @@ -120,7 +119,7 @@
* Settings for relations stuff
*/

require_once('./libraries/relation.lib.php');
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam();

/**
Expand All @@ -133,15 +132,15 @@

/**
* Prepares the tables list if the user where not redirected to this script
* because there is no table in the database ($is_info is TRUE)
* because there is no table in the database ($is_info is true)
*/
if (empty($is_info)) {
require('./libraries/db_details_common.inc.php');
require './libraries/db_details_common.inc.php';
$url_query .= '&amp;goto=db_operations.php';

// Gets the database structure
$sub_part = '_structure';
require('./libraries/db_details_db_info.inc.php');
require './libraries/db_details_db_info.inc.php';
echo "\n";
}

Expand All @@ -150,14 +149,14 @@
}
if (PMA_MYSQL_INT_VERSION < 50002
|| (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
$is_information_schema = FALSE;
$is_information_schema = false;
} else {
$is_information_schema = TRUE;
$is_information_schema = true;
}

if (!$is_information_schema) {

require('./libraries/display_create_table.lib.php');
require './libraries/display_create_table.lib.php';

if ($cfgRelation['commwork']) {
/**
Expand Down Expand Up @@ -299,17 +298,17 @@
echo ' <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"
. ' </legend>' . "\n"
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
'db_collation', 'select_db_collation', $db_collation, FALSE, 3)
'db_collation', 'select_db_collation', $db_collation, false, 3)
. ' <input type="submit" name="submitcollation"'
. ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
. '</fieldset>' . "\n"
. '</form>' . "\n";
}

if ( $num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
echo '<div class="error"><h1>' . $strError . '</h1>'
. sprintf( $strRelationNotWorking,
. sprintf($strRelationNotWorking,
'<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">',
'</a>')
. '</div>';
Expand Down Expand Up @@ -415,9 +414,9 @@
<?php
} // end if

if ( $num_tables > 0
if ($num_tables > 0
&& $cfgRelation['relwork'] && $cfgRelation['commwork']
&& isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir']) ) {
&& isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
/**
* import docSQL files
*/
Expand All @@ -434,5 +433,5 @@
/**
* Displays the footer
*/
require_once('./libraries/footer.inc.php');
require_once './libraries/footer.inc.php';
?>
Loading

0 comments on commit f341c72

Please sign in to comment.