From 4d1167149a9bad94bdc6a6947525d4c610f0e3aa Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 16:30:57 +0200 Subject: Visibility declarations and cleanup for SQLSRV forge and utility classes --- system/database/drivers/sqlsrv/sqlsrv_forge.php | 36 +++++++++-------------- system/database/drivers/sqlsrv/sqlsrv_utility.php | 30 ++++++++----------- 2 files changed, 26 insertions(+), 40 deletions(-) (limited to 'system/database/drivers') diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index 0a276e172..0dc7b5242 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -1,13 +1,13 @@ -db->_escape_identifiers($table); } @@ -80,15 +75,14 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @param bool should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -100,7 +94,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { $sql .= $this->db->_escape_identifiers($table)." ("; $current_field_count = 0; - foreach ($fields as $field=>$attributes) + foreach ($fields as $field => $attributes) { // Numeric field names aren't allowed in databases, so if the key is // numeric, we know it was assigned by PHP and the developer manually @@ -190,17 +184,16 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name * @param string the column definition * @param string the default value - * @param boolean should 'NOT NULL' be added + * @param bool should 'NOT NULL' be added * @param string the field after which we should add the new field - * @return object + * @return string */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -242,12 +235,11 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 44e6fafeb..5830c62de 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -1,13 +1,13 @@ -db->display_error('db_unsuported_feature'); @@ -96,5 +90,5 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { } -/* End of file mssql_utility.php */ -/* Location: ./system/database/drivers/mssql/mssql_utility.php */ \ No newline at end of file +/* End of file sqlsrv_utility.php */ +/* Location: ./system/database/drivers/sqlsrv/sqlsrv_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b