Translated using Weblate (Slovenian)
[phpmyadmin.git] / schema_export.php
blobec1c4e0b543d3e0f6ec781eb9b8f5d860164cdac
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Schema export handler
6 * @package PhpMyAdmin
7 */
9 /**
10 * Gets some core libraries
12 require_once 'libraries/common.inc.php';
13 require 'libraries/StorageEngine.class.php';
15 /**
16 * get all variables needed for exporting relational schema
17 * in $cfgRelation
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';
25 /**
26 * Include the appropriate Schema Class depending on $export_type
27 * default is PDF
29 PMA_processExportSchema($_REQUEST['export_type']);
31 /**
32 * get all the export options and verify
33 * call and include the appropriate Schema Class depending on $export_type
35 * @param string $export_type format of the export
37 * @return void
39 function PMA_processExportSchema($export_type)
41 /**
42 * default is PDF, otherwise validate it's only letters a-z
44 if (! isset($export_type) || ! preg_match('/^[a-zA-Z]+$/', $export_type)) {
45 $export_type = 'pdf';
48 // sanitize this parameter which will be used below in a file inclusion
49 $export_type = PMA_securePath($export_type);
51 // get the specific plugin
52 /* @var $export_plugin SchemaPlugin */
53 $export_plugin = PMA_getPlugin(
54 "schema",
55 $export_type,
56 'libraries/plugins/schema/'
59 // Check schema export type
60 if (! isset($export_plugin)) {
61 PMA_fatalError(__('Bad type!'));
64 $GLOBALS['dbi']->selectDb($GLOBALS['db']);
65 $export_plugin->exportSchema($GLOBALS['db']);