Hi,
for db export, is there a possible logic path where the $table_select array would not exist? (It contains the tables chosen by user).
Now that the tables to export are selected by default, my plan is to show in the list the tables + the views, allowing to export or not the views.
Then in export.php, instead of looping thru $tables, I would only get the table names or view names present in $table_select.
Of course, I would test all export formats to ensure correct results.The code already avoids to export data for a view.
Comments on that?
Another point, in this code:
// Check if we have something to export if ($export_type == 'database') { $tables = PMA_DBI_get_tables($db); $num_tables = count($tables); if ($num_tables == 0) { $message = $strNoTablesFound; $js_to_run = 'functions.js'; require_once('./libraries/header.inc.php'); if ($export_type == 'server') { $active_page = 'server_export.php'; require('./server_export.php'); } elseif ($export_type == 'database') { $active_page = 'db_details_export.php'; require('./db_details_export.php'); } else { $active_page = 'tbl_properties_export.php'; require('./tbl_properties_export.php'); } exit(); } }
the if ($export_type == 'server') { and the last "else" block can never be reached (if I read correctly).
Marc
Hi
On Fri, 13 Oct 2006 17:37:16 -0400 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
for db export, is there a possible logic path where the $table_select array would not exist? (It contains the tables chosen by user).
Maybe when user unselects all tables? Or directly loads export.php?
Another point, in this code:
// Check if we have something to export if ($export_type == 'database') { $tables = PMA_DBI_get_tables($db); $num_tables = count($tables); if ($num_tables == 0) { $message = $strNoTablesFound; $js_to_run = 'functions.js'; require_once('./libraries/header.inc.php'); if ($export_type == 'server') { $active_page = 'server_export.php'; require('./server_export.php'); } elseif ($export_type == 'database') { $active_page = 'db_details_export.php'; require('./db_details_export.php'); } else { $active_page = 'tbl_properties_export.php'; require('./tbl_properties_export.php'); } exit(); } }
the if ($export_type == 'server') { and the last "else" block can never be reached (if I read correctly).
Yes, I read it same :-)
Michal Čihař a écrit :
Hi
On Fri, 13 Oct 2006 17:37:16 -0400 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
for db export, is there a possible logic path where the $table_select array would not exist? (It contains the tables chosen by user).
Maybe when user unselects all tables? Or directly loads export.php?
Direct loading of export.php did not work, at least in 2.9.0.2 (unless you know which parameters to pass; in fact, I seem to remember that this was documented somewhere?)
When a user unselects all tables, in trunk (9650) it chooses all tables :) but I think we should abort in this case...
Another point, in this code:
// Check if we have something to export if ($export_type == 'database') { $tables = PMA_DBI_get_tables($db); $num_tables = count($tables); if ($num_tables == 0) { $message = $strNoTablesFound; $js_to_run = 'functions.js'; require_once('./libraries/header.inc.php'); if ($export_type == 'server') { $active_page = 'server_export.php'; require('./server_export.php'); } elseif ($export_type == 'database') { $active_page = 'db_details_export.php'; require('./db_details_export.php'); } else { $active_page = 'tbl_properties_export.php'; require('./tbl_properties_export.php'); } exit(); } }
the if ($export_type == 'server') { and the last "else" block can never be reached (if I read correctly).
Yes, I read it same :-)
In trunk (9650) I deactivated the parts that could not be reached. I guess that the "if" that correspond to server or table should be moved elsewhere?
Marc
On Sun, 15 Oct 2006 14:15:06 -0400 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
Direct loading of export.php did not work, at least in 2.9.0.2 (unless you know which parameters to pass; in fact, I seem to remember that this was documented somewhere?)
I don't know about any such documentation...
When a user unselects all tables, in trunk (9650) it chooses all tables :) but I think we should abort in this case...
Yes, we most likely should.
In trunk (9650) I deactivated the parts that could not be reached. I guess that the "if" that correspond to server or table should be moved elsewhere?
There was probably only copied too much code to this place.
Michal Čihař a écrit :
On Sun, 15 Oct 2006 14:15:06 -0400 Marc Delisle Marc.Delisle@cegepsherbrooke.qc.ca wrote:
Direct loading of export.php did not work, at least in 2.9.0.2 (unless you know which parameters to pass; in fact, I seem to remember that this was documented somewhere?)
I don't know about any such documentation...
When a user unselects all tables, in trunk (9650) it chooses all tables :) but I think we should abort in this case...
Yes, we most likely should.
Done in trunk.
In trunk (9650) I deactivated the parts that could not be reached. I guess that the "if" that correspond to server or table should be moved elsewhere?
There was probably only copied too much code to this place.
Extra code removed in trunk.
Marc