Translated using Weblate (Turkish)
[phpmyadmin.git] / libraries / tbl_common.inc.php
blob22f63ad1ce5d7c1586fb9022c6666ddb013e945b
1 <?php
2 /**
3 * Common includes for the table level views
5 * @package PhpMyAdmin
6 */
7 declare(strict_types=1);
9 use PhpMyAdmin\Url;
10 use PhpMyAdmin\Util;
12 if (! defined('PHPMYADMIN')) {
13 exit;
16 global $db, $table, $db_is_system_schema, $url_query, $url_params, $cfg, $dbi;
18 // Check parameters
19 Util::checkParameters(['db', 'table']);
21 $db_is_system_schema = $dbi->isSystemSchema($db);
23 /**
24 * Set parameters for links
25 * @deprecated
27 $url_query = Url::getCommon(['db' => $db, 'table' => $table]);
29 /**
30 * Set parameters for links
32 $url_params = [];
33 $url_params['db'] = $db;
34 $url_params['table'] = $table;
36 /**
37 * Defines the urls to return to in case of error in a sql statement
39 $err_url_0 = Util::getScriptNameForOption(
40 $cfg['DefaultTabDatabase'],
41 'database'
43 $err_url_0 .= Url::getCommon(['db' => $db], strpos($err_url_0, '?') === false ? '?' : '&');
45 $err_url = Util::getScriptNameForOption(
46 $cfg['DefaultTabTable'],
47 'table'
49 $err_url .= Url::getCommon($url_params, strpos($err_url, '?') === false ? '?' : '&');
51 /**
52 * Ensures the database and the table exist (else move to the "parent" script)
53 * Skip test if we are exporting as we can't tell whether a table name is an alias (which would fail the test).
55 if (($_GET['route'] ?? $_POST['route'] ?? '') === '/table/export') {
56 require_once ROOT_PATH . 'libraries/db_table_exists.inc.php';