Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauriciofauth@gmail.com>2017-09-12 04:43:07 +0300
committerMaurício Meneghini Fauth <mauriciofauth@gmail.com>2017-09-12 04:43:07 +0300
commit360d0ad62e490c15c6892f1696744fe7fa27ee63 (patch)
tree52ab87d27188768df3ab9bab2c9b7537624647e7 /tbl_create.php
parent11ff8cee1191fae7f283e2ef438c90a5d4b47e5b (diff)
Refactor create_addfield functions to static methods
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'tbl_create.php')
-rw-r--r--tbl_create.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/tbl_create.php b/tbl_create.php
index 1992060772..d9160a6d12 100644
--- a/tbl_create.php
+++ b/tbl_create.php
@@ -7,22 +7,23 @@
*/
use PhpMyAdmin\Core;
+use PhpMyAdmin\CreateAddField;
use PhpMyAdmin\Response;
use PhpMyAdmin\Transformations;
use PhpMyAdmin\Url;
+use PhpMyAdmin\Util;
/**
* Get some core libraries
*/
require_once 'libraries/common.inc.php';
-require_once 'libraries/create_addfield.lib.php';
// Check parameters
-PhpMyAdmin\Util::checkParameters(array('db'));
+Util::checkParameters(array('db'));
/* Check if database name is empty */
if (strlen($db) === 0) {
- PhpMyAdmin\Util::mysqlDie(
+ Util::mysqlDie(
__('The database name is empty!'), '', false, 'index.php'
);
}
@@ -31,7 +32,7 @@ if (strlen($db) === 0) {
* Selects the database to work with
*/
if (!$GLOBALS['dbi']->selectDb($db)) {
- PhpMyAdmin\Util::mysqlDie(
+ Util::mysqlDie(
sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)),
'',
false,
@@ -41,7 +42,7 @@ if (!$GLOBALS['dbi']->selectDb($db)) {
if ($GLOBALS['dbi']->getColumns($db, $table)) {
// table exists already
- PhpMyAdmin\Util::mysqlDie(
+ Util::mysqlDie(
sprintf(__('Table %s already exists!'), htmlspecialchars($table)),
'',
false,
@@ -51,7 +52,7 @@ if ($GLOBALS['dbi']->getColumns($db, $table)) {
// for libraries/tbl_columns_definition_form.inc.php
// check number of fields to be created
-$num_fields = PMA_getNumberOfFieldsFromRequest();
+$num_fields = CreateAddField::getNumberOfFieldsFromRequest();
$action = 'tbl_create.php';
@@ -59,7 +60,7 @@ $action = 'tbl_create.php';
* The form used to define the structure of the table has been submitted
*/
if (isset($_REQUEST['do_save_data'])) {
- $sql_query = PMA_getTableCreationQuery($db, $table);
+ $sql_query = CreateAddField::getTableCreationQuery($db, $table);
// If there is a request for SQL previewing.
if (isset($_REQUEST['preview_sql'])) {