Translated using Weblate (Thai)
[phpmyadmin.git] / schema_export.php
blob90f684a2fd7d624ff639c9d95e10c649a790d61b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
9 * Gets some core libraries
11 require_once 'libraries/common.inc.php';
12 require 'libraries/StorageEngine.class.php';
14 /**
15 * get all variables needed for exporting relational schema
16 * in $cfgRelation
18 $cfgRelation = PMA_getRelationsParam();
20 require_once 'libraries/transformations.lib.php';
21 require_once 'libraries/Index.class.php';
22 require_once 'libraries/schema/Export_Relation_Schema.class.php';
24 /**
25 * get all the export options and verify
26 * call and include the appropriate Schema Class depending on $export_type
27 * default is PDF
30 $post_params = array(
31 'all_tables_same_width',
32 'chpage',
33 'db',
34 'do',
35 'export_type',
36 'orientation',
37 'paper',
38 'names',
39 'pdf_page_number',
40 'show_color',
41 'show_grid',
42 'show_keys',
43 'show_table_dimension',
44 'with_doc'
46 foreach ($post_params as $one_post_param) {
47 if (isset($_POST[$one_post_param])) {
48 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
52 if (! isset($export_type) || ! preg_match('/^[a-zA-Z]+$/', $export_type)) {
53 $export_type = 'pdf';
55 PMA_DBI_select_db($db);
57 $path = PMA_securePath(ucfirst($export_type));
58 if (!file_exists('libraries/schema/' . $path . '_Relation_Schema.class.php')) {
59 PMA_Export_Relation_Schema::dieSchema(
60 $_POST['chpage'],
61 $export_type,
62 __('File doesn\'t exist')
65 require "libraries/schema/".$path.'_Relation_Schema.class.php';
66 $obj_schema = eval("new PMA_".$path."_Relation_Schema();");