2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Schema export handler
10 * Gets some core libraries
12 require_once 'libraries/common.inc.php';
13 require 'libraries/StorageEngine.class.php';
16 * get all variables needed for exporting relational schema
19 $cfgRelation = PMA_getRelationsParam();
21 require_once 'libraries/Index.class.php';
22 require_once 'libraries/pmd_common.php';
23 require_once 'libraries/plugin_interface.lib.php';
26 * get all the export options and verify
27 * call and include the appropriate Schema Class depending on $export_type
34 foreach ($post_params as $one_post_param) {
35 if (isset($_REQUEST[$one_post_param])) {
36 $GLOBALS[$one_post_param] = $_REQUEST[$one_post_param];
40 PMA_processExportSchema($_REQUEST['export_type']);
43 * get all the export options and verify
44 * call and include the appropriate Schema Class depending on $export_type
46 * @param string $export_type format of the export
50 function PMA_processExportSchema($export_type)
53 * default is PDF, otherwise validate it's only letters a-z
55 if (! isset($export_type) ||
! preg_match('/^[a-zA-Z]+$/', $export_type)) {
59 // sanitize this parameter which will be used below in a file inclusion
60 $export_type = PMA_securePath($export_type);
62 // get the specific plugin
63 $export_plugin = PMA_getPlugin(
66 'libraries/plugins/schema/'
69 // Check schema export type
70 if (! isset($export_plugin)) {
71 PMA_fatalError(__('Bad type!'));
74 $GLOBALS['dbi']->selectDb($GLOBALS['db']);
75 $export_plugin->exportSchema($GLOBALS['db']);