' . __('Quick steps to setup advanced features:') . '
';
echo '
';
- echo '
' . __('Create the needed tables with the examples/create_tables.sql.') . ' ' . PMA_showDocu('linked-tables') . '
';
- echo '
' . __('Create a pma user and give access to these tables.') . ' ' . PMA_showDocu('pmausr') . '
';
- echo '
' . __('Enable advanced features in configuration file (config.inc.php), for example by starting from config.sample.inc.php.') . ' ' . PMA_showDocu('quick_install') . '
';
- echo '
' . __('Re-login to phpMyAdmin to load the updated configuration file.') . '
';
+ echo '
'
+ . __('Create the needed tables with the examples/create_tables.sql.')
+ . ' ' . PMA_showDocu('linked-tables')
+ . '
';
+ echo '
'
+ . __('Create a pma user and give access to these tables.')
+ . ' ' . PMA_showDocu('pmausr')
+ . '
';
+ echo '
'
+ . __('Enable advanced features in configuration file (config.inc.php), for example by starting from config.sample.inc.php.')
+ . ' ' . PMA_showDocu('quick_install')
+ . '
';
+ echo '
'
+ . __('Re-login to phpMyAdmin to load the updated configuration file.')
+ . '
';
if ($src_db_selected != 1) {
- echo sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($src_db));
+ echo sprintf(
+ __('\'%s\' database does not exist.'),
+ htmlspecialchars($src_db)
+ );
}
if ($trg_db_selected != 1) {
- echo sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($trg_db));
+ echo sprintf(
+ __('\'%s\' database does not exist.'),
+ htmlspecialchars($trg_db)
+ );
}
echo '
';
unset($_REQUEST['submit_connect']);
@@ -166,43 +185,91 @@ if ((isset($_REQUEST['submit_connect']))) {
* Using PMA_getMatchingTables to find which of the tables' names match
* in target and source database.
*/
- PMA_getMatchingTables($trg_tables, $src_tables, $matching_tables, $source_tables_uncommon);
+ PMA_getMatchingTables(
+ $trg_tables,
+ $src_tables,
+ $matching_tables,
+ $source_tables_uncommon
+ );
/**
* Finding the uncommon tables for the target database
* using function PMA_getNonMatchingTargetTables()
*/
- PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, $target_tables_uncommon);
+ PMA_getNonMatchingTargetTables(
+ $trg_tables,
+ $matching_tables,
+ $target_tables_uncommon
+ );
/**
* Initializing several arrays to save the data and structure
* difference between the source and target databases.
*/
- $row_count = array(); //number of rows in source table that needs to be created in target database
- $fields_num = array(); //number of fields in each matching table
- $delete_array = array(); //stores the primary key values for target tables that have excessive rows than corresponding source tables.
- $insert_array = array(array(array()));// stores the primary key values for the rows in each source table that are not present in target tables.
- $update_array = array(array(array())); //stores the primary key values, name of field to be updated, value of the field to be updated for
- // each row of matching table.
- $matching_tables_fields = array(); //contains the fields' names for each matching table
- $matching_tables_keys = array(); //contains the primary keys' names for each matching table
- $uncommon_tables_fields = array(); //coantains the fields for all the source tables that are not present in target
+ // number of rows in source table that needs to be created in target
+ // database
+ $row_count = array();
+ // number of fields in each matching table
+ $fields_num = array();
+ // stores the primary key values for target tables that have
+ // excessive rows than corresponding source tables.
+ $delete_array = array();
+ // stores the primary key values for the rows in each source table
+ // that are not present in target tables.
+ $insert_array = array(array(array()));
+ // stores the primary key values, name of field to be updated,
+ // value of the field to be updated for each row of matching table.
+ $update_array = array(array(array()));
+
+ // contains the fields' names for each matching table
+ $matching_tables_fields = array();
+ // contains the primary keys' names for each matching table
+ $matching_tables_keys = array();
+ // coantains the fields for all the source tables that are not
+ // present in target
+ $uncommon_tables_fields = array();
$matching_tables_num = sizeof($matching_tables);
- $source_columns = array(); //contains the full columns' information for all the source tables' columns
- $target_columns = array(); //contains the full columns' information for all the target tables' columns
- $uncommon_columns = array(); //contains names of columns present in source table but absent from the corresponding target table
- $source_indexes = array(); //contains indexes on all the source tables
- $target_indexes = array(); //contains indexes on all the target tables
- $add_indexes_array = array(); //contains the indexes name present in source but absent from target tables
- $target_tables_keys = array(); //contains the keys of all the target tables
- $alter_indexes_array = array(); //contains the names of all the indexes for each table that need to be altered in target database
- $remove_indexes_array = array(); //contains the names of indexes that are excessive in target tables
- $alter_str_array = array(array()); //contains the criteria for each column that needs to be altered in target tables
- $add_column_array = array(array()); //contains the name of columns that need to be added in target tables
+ // contains the full columns' information for all the source
+ // tables' columns
+ $source_columns = array();
+ // contains the full columns' information for all the target
+ // tables' columns
+ $target_columns = array();
+ // contains names of columns present in source table but absent from
+ // the corresponding target table
+ $uncommon_columns = array();
+ // contains indexes on all the source tables
+ $source_indexes = array();
+ // contains indexes on all the target tables
+ $target_indexes = array();
+ // contains the indexes name present in source but absent from
+ // target tables
+ $add_indexes_array = array();
+ // contains the keys of all the target tables
+ $target_tables_keys = array();
+ // contains the names of all the indexes for each table that need
+ // to be altered in target database
+ $alter_indexes_array = array();
+ // contains the names of indexes that are excessive in target tables
+ $remove_indexes_array = array();
+ // contains the criteria for each column that needs to be altered
+ // in target tables
+ $alter_str_array = array(array());
+ // contains the name of columns that need to be added in target tables
+ $add_column_array = array(array());
/**
- * The criteria array contains all the criteria against which columns are compared for differences.
- */
- $criteria = array('Field', 'Type', 'Null', 'Collation', 'Key', 'Default', 'Comment');
+ * The criteria array contains all the criteria against which columns
+ * are compared for differences.
+ */
+ $criteria = array(
+ 'Field',
+ 'Type',
+ 'Null',
+ 'Collation',
+ 'Key',
+ 'Default',
+ 'Comment'
+ );
for ($i = 0; $i < sizeof($matching_tables); $i++) {
/**
@@ -226,7 +293,8 @@ if ((isset($_REQUEST['submit_connect']))) {
PMA_indexesDiffInTables(
$src_db, $trg_db, $src_link, $trg_link,
$matching_tables, $source_indexes, $target_indexes,
- $add_indexes_array, $alter_indexes_array, $remove_indexes_array, $i
+ $add_indexes_array, $alter_indexes_array,
+ $remove_indexes_array, $i
);
}
@@ -378,8 +446,14 @@ if ((isset($_REQUEST['submit_connect']))) {
|| ($num_add_index > 0)
|| ($num_remove_index > 0)
) {
- $btn_structure_params = array($i, $num_alter_cols, $num_insert_cols,
- $num_remove_cols, $num_add_index, $num_remove_index);
+ $btn_structure_params = array(
+ $i,
+ $num_alter_cols,
+ $num_insert_cols,
+ $num_remove_cols,
+ $num_add_index,
+ $num_remove_index
+ );
}
/**
@@ -467,8 +541,9 @@ if ((isset($_REQUEST['submit_connect']))) {
';
/**
- * This fieldset displays the checkbox to confirm deletion of previous rows from target tables
- */
+ * This fieldset displays the checkbox to confirm deletion of previous
+ * rows from target tables
+ */
echo '';
/**
- * This fieldset displays the checkbox to confirm deletion of previous rows from target tables
- */
+ * This fieldset displays the checkbox to confirm deletion of previous
+ * rows from target tables
+ */
echo '