diff --git a/libraries/Table.php b/libraries/Table.php index ae0e3181b9..84d36068cf 100644 --- a/libraries/Table.php +++ b/libraries/Table.php @@ -392,7 +392,7 @@ class Table * @param Current table properties. * @return Return auto increment info if it is set for the selected table or return blank. */ - public function getAutoIncrementInfo() { + public function getAutoIncrement() { $table_auto_increment = $this->getStatusInfo('AUTO_INCREMENT', false, true); return isset($table_auto_increment) ? $table_auto_increment : ''; } @@ -402,11 +402,9 @@ class Table * @param Current table properties. * @return Return options array info if it is set for the selected table or return blank. */ - public function createOptionsArray() { + public function getCreateOptions() { $table_options = $this->getStatusInfo('CREATE_OPTIONS', false, true); - $create_options_tmp = isset($table_options) - ? explode(' ', $table_options) - : array(); + $create_options_tmp = empty($table_options) ? array() : explode(' ', $table_options); $create_options = array(); // export create options by its name as variables into global namespace // f.e. pack_keys=1 becomes available as $pack_keys with value of '1' @@ -422,7 +420,6 @@ class Table $create_options['pack_keys'] = (! isset($create_options['pack_keys']) || strlen($create_options['pack_keys']) == 0) ? 'DEFAULT' : $create_options['pack_keys']; - unset($create_options_tmp, $each_create_option); return $create_options; } diff --git a/libraries/controllers/table/TableChartController.php b/libraries/controllers/table/TableChartController.php index c7abc7d95c..1aa3c602f4 100644 --- a/libraries/controllers/table/TableChartController.php +++ b/libraries/controllers/table/TableChartController.php @@ -133,8 +133,8 @@ class TableChartController extends TableController $tbl_collation = $table_class_object->getCollation(); $table_info_num_rows = $table_class_object->getNumRows(); $row_format = $table_class_object->getRowFormat(); - $auto_increment = $table_class_object->getAutoIncrementInfo(); - $create_options = $table_class_object->createOptionsArray(); + $auto_increment = $table_class_object->getAutoIncrement(); + $create_options = $table_class_object->getCreateOptions(); } elseif (strlen($this->db) > 0) { $url_params['goto'] = Util::getScriptNameForOption( $this->cfg['DefaultTabDatabase'], 'database' diff --git a/libraries/controllers/table/TableIndexesController.php b/libraries/controllers/table/TableIndexesController.php index 32634ebe68..a613c6a32a 100644 --- a/libraries/controllers/table/TableIndexesController.php +++ b/libraries/controllers/table/TableIndexesController.php @@ -81,8 +81,8 @@ class TableIndexesController extends TableController $tbl_collation = $table_class_object->getCollation(); $table_info_num_rows = $table_class_object->getNumRows(); $row_format = $table_class_object->getRowFormat(); - $auto_increment = $table_class_object->getAutoIncrementInfo(); - $create_options = $table_class_object->createOptionsArray(); + $auto_increment = $table_class_object->getAutoIncrement(); + $create_options = $table_class_object->getCreateOptions(); $add_fields = 0; if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) { // coming already from form diff --git a/tbl_operations.php b/tbl_operations.php index 2adc3041b2..90dcd75656 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -227,8 +227,8 @@ if ($reread_info) { $tbl_collation = $pma_table->getCollation(); $table_info_num_rows = $pma_table->getNumRows(); $row_format = $pma_table->getRowFormat(); - $auto_increment = $pma_table->getAutoIncrementInfo(); - $create_options = $pma_table->createOptionsArray(); + $auto_increment = $pma_table->getAutoIncrement(); + $create_options = $pma_table->getCreateOptions(); } unset($reread_info); diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 152fc0939a..c3473d7ecc 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -1295,11 +1295,11 @@ class TableTest extends PMATestCase } /** - * Test for getAutoIncrementInfo + * Test for getAutoIncrement * * @return void */ - public function testGetAutoIncrementInfo(){ + public function testGetAutoIncrement(){ $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1310,7 +1310,7 @@ class TableTest extends PMATestCase $auto_increment = $dbi->getTable( $target_db, $target_table - )->getAutoIncrementInfo(); + )->getAutoIncrement(); $this->assertEquals( $expect, $auto_increment @@ -1318,11 +1318,11 @@ class TableTest extends PMATestCase } /** - * Test for createOptionsArray + * Test for getCreateOptions * * @return void */ - public function testCreateOptionsArray(){ + public function testGetCreateOptions(){ $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1333,7 +1333,7 @@ class TableTest extends PMATestCase $create_options = $dbi->getTable( $target_db, $target_table - )->createOptionsArray(); + )->getCreateOptions(); $this->assertEquals( $expect, $create_options