diff options
Diffstat (limited to 'phpBB/phpbb/db/tools.php')
-rw-r--r-- | phpBB/phpbb/db/tools.php | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index dbe00f6be2..f594fbe63f 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db; + /** * @ignore */ @@ -21,7 +23,7 @@ if (!defined('IN_PHPBB')) * * @package dbal */ -class phpbb_db_tools +class tools { /** * Current sql layer @@ -310,10 +312,10 @@ class phpbb_db_tools /** * Constructor. Set DB Object and set {@link $return_statements return_statements}. * - * @param phpbb_db_driver $db Database connection + * @param \phpbb\db\driver\driver $db Database connection * @param bool $return_statements True if only statements should be returned and no SQL being executed */ - public function __construct(phpbb_db_driver $db, $return_statements = false) + public function __construct(\phpbb\db\driver\driver $db, $return_statements = false) { $this->db = $db; $this->return_statements = $return_statements; @@ -503,7 +505,7 @@ class phpbb_db_tools trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } - // here we add the definition of the new column to the list of columns + // here we add the definition of the new \column to the list of columns switch ($this->sql_layer) { case 'mssql': @@ -990,7 +992,7 @@ class phpbb_db_tools $column_list[] = $entities[0]; } - // note down the primary key notation because sqlite only supports adding it to the end for the new table + // note down the primary key notation because sqlite only supports adding it to the end for the new \table $primary_key = false; $_new_cols = array(); @@ -1070,7 +1072,7 @@ class phpbb_db_tools { $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')'; } - // Add a new one or the old primary key + // Add a new \one or the old primary key else if ($primary_key !== false) { $new_table_cols[] = $primary_key; @@ -1078,7 +1080,7 @@ class phpbb_db_tools $columns = implode(',', $column_list); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -1701,7 +1703,7 @@ class phpbb_db_tools } /** - * Add new column + * Add new \column */ function sql_column_add($table_name, $column_name, $column_data, $inline = false) { @@ -1810,7 +1812,7 @@ class phpbb_db_tools $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols; - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -1925,7 +1927,7 @@ class phpbb_db_tools $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -2117,7 +2119,7 @@ class phpbb_db_tools $columns = implode(',', $column_list); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -2483,7 +2485,7 @@ class phpbb_db_tools $columns = implode(',', $column_list); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; |