2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Schema export handler
10 use PhpMyAdmin\Plugins\SchemaPlugin
;
11 use PhpMyAdmin\Relation
;
14 * Gets some core libraries
16 require_once 'libraries/common.inc.php';
19 * get all variables needed for exporting relational schema
22 $cfgRelation = Relation
::getRelationsParam();
24 require_once 'libraries/pmd_common.php';
25 require_once 'libraries/plugin_interface.lib.php';
27 if (! isset($_REQUEST['export_type'])) {
28 PhpMyAdmin\Util
::checkParameters(array('export_type'));
32 * Include the appropriate Schema Class depending on $export_type
35 PMA_processExportSchema($_REQUEST['export_type']);
38 * get all the export options and verify
39 * call and include the appropriate Schema Class depending on $export_type
41 * @param string $export_type format of the export
45 function PMA_processExportSchema($export_type)
48 * default is PDF, otherwise validate it's only letters a-z
50 if (! isset($export_type) ||
! preg_match('/^[a-zA-Z]+$/', $export_type)) {
54 // sanitize this parameter which will be used below in a file inclusion
55 $export_type = Core
::securePath($export_type);
57 // get the specific plugin
58 /* @var $export_plugin SchemaPlugin */
59 $export_plugin = PMA_getPlugin(
62 'libraries/classes/Plugins/Schema/'
65 // Check schema export type
66 if (! isset($export_plugin)) {
67 Core
::fatalError(__('Bad type!'));
70 $GLOBALS['dbi']->selectDb($GLOBALS['db']);
71 $export_plugin->exportSchema($GLOBALS['db']);