From f4a4bd8fac188ebc9cda822ffc811c218fd92b45 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 20 Oct 2011 12:18:42 -0500 Subject: adding new license file (OSL 3.0) and updating readme to ReST added notice of license to all source files. OSL to all except the few files we ship inside of the application folder, those are AFL. Updated license in user guide. incrementing next dev version to 3.0 due to licensing change --- system/database/drivers/mysqli/mysqli_forge.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 260549457..cdd5399f2 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MySQLi Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_forge extends CI_DB_forge { -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index cdd5399f2..590efa939 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 1ff49e05b8cb6a7d41a5ed36ff477b8d51b4ef12 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 27 Jan 2012 11:30:41 +0200 Subject: Improve the MySQLi database driver --- system/database/drivers/mysqli/mysqli_forge.php | 137 ++++++++---------------- 1 file changed, 42 insertions(+), 95 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 590efa939..319c6fdac 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -1,13 +1,13 @@ -$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 // entered the field information, so we'll simply add it to the list if (is_numeric($field)) { - $sql .= "\n\t$attributes"; + $sql .= "\n\t".$attributes; } else { $attributes = array_change_key_case($attributes, CASE_UPPER); - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - if (array_key_exists('NAME', $attributes)) - { - $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' '; - } - - if (array_key_exists('TYPE', $attributes)) - { - $sql .= ' '.$attributes['TYPE']; - } - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } + $sql .= "\n\t".$this->db->protect_identifiers($field) + .( ! empty($attributes['NAME']) ? ' '.$this->db->protect_identifiers($attributes['NAME']).' ' : '') + .( ! empty($attributes['TYPE']) ? ' '.$attributes['TYPE'] : '') + .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '') + .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '') + .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '') + .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL') + .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : ''); } // don't add a comma on the end of the last field @@ -146,15 +109,14 @@ class CI_DB_mysqli_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param mixed 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 '; @@ -163,15 +125,12 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= 'IF NOT EXISTS '; } - $sql .= $this->db->_escape_identifiers($table)." ("; - - $sql .= $this->_process_fields($fields); + $sql .= $this->db->_escape_identifiers($table).' ('.$this->_process_fields($fields); if (count($primary_keys) > 0) { - $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; + $key_name = $this->db->protect_identifiers(implode('_', $primary_keys)); + $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')'; } if (is_array($keys) && count($keys) > 0) @@ -180,22 +139,20 @@ class CI_DB_mysqli_forge extends CI_DB_forge { { if (is_array($key)) { - $key_name = $this->db->_protect_identifiers(implode('_', $key)); - $key = $this->db->_protect_identifiers($key); + $key_name = $this->db->protect_identifiers(implode('_', $key)); + $key = $this->db->protect_identifiers($key); } else { - $key_name = $this->db->_protect_identifiers($key); + $key_name = $this->db->protect_identifiers($key); $key = array($key_name); } - $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; + $sql .= ",\n\tKEY ".$key_name.' ('.implode(', ', $key).')'; } } - $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};"; - - return $sql; + return $sql."\n) DEFAULT CHARACTER SET ".$this->db->char_set.' COLLATE '.$this->db->dbcollat.';'; } // -------------------------------------------------------------------- @@ -203,12 +160,11 @@ class CI_DB_mysqli_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return string */ - function _drop_table($table) + public function _drop_table($table) { - return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); + return 'DROP TABLE IF EXISTS '.$this->db->_escape_identifiers($table); } // -------------------------------------------------------------------- @@ -219,31 +175,24 @@ class CI_DB_mysqli_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 array fields * @param string the field after which we should add the new field - * @return object + * @return string */ - function _alter_table($alter_type, $table, $fields, $after_field = '') + public function _alter_table($alter_type, $table, $fields, $after_field = '') { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type "; + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table).' '.$alter_type.' '; // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql.$this->db->_protect_identifiers($fields); - } - - $sql .= $this->_process_fields($fields); - - if ($after_field != '') + if ($alter_type === 'DROP') { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + return $sql.$this->db->protect_identifiers($fields); } - return $sql; + return $sql.$this->_process_fields($fields) + .($after_field != '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : ''); } // -------------------------------------------------------------------- @@ -253,18 +202,16 @@ class CI_DB_mysqli_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) { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; + return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } } /* End of file mysqli_forge.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ -- cgit v1.2.3-24-g4f1b From a3c5cfca6b4a1ec183f3b3c9af88c7f686cf167e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 27 Jan 2012 20:50:33 +0200 Subject: Switch _process_fields() from private to protected --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 319c6fdac..7de036127 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -66,7 +66,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - private function _process_fields($fields) + public function _process_fields($fields) { $current_field_count = 0; $sql = ''; -- cgit v1.2.3-24-g4f1b From 032e7ea646b953a8f4d28327d7f487de2ffa7288 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Mar 2012 19:48:35 +0200 Subject: Resolve _protect_identifiers()/protect_identifiers() usage issues --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 7de036127..744525f02 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -183,7 +183,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ public function _alter_table($alter_type, $table, $fields, $after_field = '') { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table).' '.$alter_type.' '; + $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; // DROP has everything it needs now. if ($alter_type === 'DROP') -- cgit v1.2.3-24-g4f1b From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 7de036127..deb8c0d9e 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From ca6404749a8dd3ee5dd68d64832374dce05fe6a3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:19:35 +0000 Subject: Allow arrays to be used for enum/set constraint. This was working in MySQL but not MySQLi. --- system/database/drivers/mysqli/mysqli_forge.php | 29 ++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 4ab7a639d..9cb1a0c70 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -86,9 +86,32 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= "\n\t".$this->db->protect_identifiers($field) .( ! empty($attributes['NAME']) ? ' '.$this->db->protect_identifiers($attributes['NAME']).' ' : '') - .( ! empty($attributes['TYPE']) ? ' '.$attributes['TYPE'] : '') - .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '') - .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '') + ; + + if ( ! empty($attributes['TYPE'])) + { + $sql .= ' '.$attributes['TYPE']; + + if ( ! empty($attributes['CONSTRAINT'])) + { + switch (strtolower($attributes['TYPE'])) + { + case 'decimal': + case 'float': + case 'numeric': + $sql .= '('.implode(',', $attributes['CONSTRAINT']).')'; + break; + case 'enum': + case 'set': + $sql .= '("'.implode('","', $attributes['CONSTRAINT']).'")'; + break; + default: + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + } + } + + $sql .= (( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '') .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '') .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL') .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : ''); -- cgit v1.2.3-24-g4f1b From 820999cb0d82c80d6dc5dde133568812c8113e29 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:15:57 +0200 Subject: Switch _process_fields() method in MySQL/MySQLi to protected --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 9cb1a0c70..9ec4bf7aa 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -66,7 +66,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - public function _process_fields($fields) + protected function _process_fields($fields) { $current_field_count = 0; $sql = ''; -- cgit v1.2.3-24-g4f1b From 215890b015d219f0d31e8ad678b0b655e6923f3b Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 20 Mar 2012 09:38:16 -0400 Subject: Remove extraneous newlines --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 9ec4bf7aa..8cf0ae1fd 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -237,4 +237,4 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } /* End of file mysqli_forge.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ +/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From d6057485408fab0caaca75ef78434d8077eaadd9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 14:07:31 +0300 Subject: Fix issue #14 --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 8cf0ae1fd..a1caf5cfb 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -42,7 +42,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ public function _create_database($name) { - return 'CREATE DATABASE '.$name; + return 'CREATE DATABASE '.$name.' CHARACTER SET '.$this->db->char_set.' COLLATE '.$this->db->dbcollat; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From ea09a8a5552f2aacdeab0c88a605fe44047ebd0a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 6 Apr 2012 20:50:07 +0300 Subject: Renamed _escape_identifiers() to escape_identifiers() and moved it to CI_DB_driver --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index a1caf5cfb..4b6939e2a 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -148,7 +148,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= 'IF NOT EXISTS '; } - $sql .= $this->db->_escape_identifiers($table).' ('.$this->_process_fields($fields); + $sql .= $this->db->escape_identifiers($table).' ('.$this->_process_fields($fields); if (count($primary_keys) > 0) { @@ -187,7 +187,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ public function _drop_table($table) { - return 'DROP TABLE IF EXISTS '.$this->db->_escape_identifiers($table); + return 'DROP TABLE IF EXISTS '.$this->db->escape_identifiers($table); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From d947eba0bdaf9d86401fdcba9e97706905cacf9d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 14:58:28 +0300 Subject: Multiple DB Forge improvements - Replaced driver methods _create_database(), _drop_database(), _drop_table() and _rename_table() with properties - Added defaults for the above mentioned platform-specific queries, so that not all drivers need to define them - Improved support for the SQLite, ODBC and PDO drivers --- system/database/drivers/mysqli/mysqli_forge.php | 54 +------------------------ 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 4b6939e2a..c0a411c97 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -34,31 +34,7 @@ */ class CI_DB_mysqli_forge extends CI_DB_forge { - /** - * Create database - * - * @param string the database name - * @return string - */ - public function _create_database($name) - { - return 'CREATE DATABASE '.$name.' CHARACTER SET '.$this->db->char_set.' COLLATE '.$this->db->dbcollat; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @param string the database name - * @return string - */ - public function _drop_database($name) - { - return 'DROP DATABASE '.$name; - } - - // -------------------------------------------------------------------- + protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s'; /** * Process Fields @@ -180,18 +156,6 @@ class CI_DB_mysqli_forge extends CI_DB_forge { // -------------------------------------------------------------------- - /** - * Drop Table - * - * @return string - */ - public function _drop_table($table) - { - return 'DROP TABLE IF EXISTS '.$this->db->escape_identifiers($table); - } - - // -------------------------------------------------------------------- - /** * Alter table query * @@ -218,22 +182,6 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .($after_field != '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : ''); } - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @param string the old table name - * @param string the new table name - * @return string - */ - public function _rename_table($table_name, $new_table_name) - { - return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); - } - } /* End of file mysqli_forge.php */ -- cgit v1.2.3-24-g4f1b From a0d4e417ef994628f67a75b2acdb5bb62971e803 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 15:06:40 +0300 Subject: Switched public driver methods in DB forge to protected --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c0a411c97..503574dfc 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -115,7 +115,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * @param bool should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -168,7 +168,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return string */ - public function _alter_table($alter_type, $table, $fields, $after_field = '') + protected function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; -- cgit v1.2.3-24-g4f1b From 48a2baf0e288accd206f5da5031d29076e130792 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:09:54 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/database --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 503574dfc..b00bfde49 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -179,7 +179,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } return $sql.$this->_process_fields($fields) - .($after_field != '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : ''); + .($after_field !== '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : ''); } } -- cgit v1.2.3-24-g4f1b From 5ef194df98294d5427c0e7582ca88b1fc06e1d72 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 8 Jun 2012 01:12:54 +0300 Subject: Resolve formatting differences between DB forge drivers --- system/database/drivers/mysqli/mysqli_forge.php | 45 ++++++++++++++++--------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index b00bfde49..a1f58f0f7 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -60,13 +60,13 @@ class CI_DB_mysqli_forge extends CI_DB_forge { { $attributes = array_change_key_case($attributes, CASE_UPPER); - $sql .= "\n\t".$this->db->protect_identifiers($field) - .( ! empty($attributes['NAME']) ? ' '.$this->db->protect_identifiers($attributes['NAME']).' ' : '') - ; + $sql .= "\n\t".$this->db->escape_identifiers($field); + + empty($attributes['NAME']) OR $sql .= ' '.$this->db->protect_identifiers($attributes['NAME']).' '; if ( ! empty($attributes['TYPE'])) { - $sql .= ' '.$attributes['TYPE']; + $sql .= ' '.$attributes['TYPE']; if ( ! empty($attributes['CONSTRAINT'])) { @@ -87,10 +87,23 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } } - $sql .= (( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '') - .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '') - .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL') - .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : ''); + if ( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (isset($attributes['DEFAULT'])) + { + $sql .= " DEFAULT '".$attributes['DEFAULT']."'"; + } + + $sql .= ( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) + ? ' NULL' : ' NOT NULL'; + + if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } } // don't add a comma on the end of the last field @@ -128,8 +141,8 @@ class CI_DB_mysqli_forge extends CI_DB_forge { if (count($primary_keys) > 0) { - $key_name = $this->db->protect_identifiers(implode('_', $primary_keys)); - $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')'; + $key_name = $this->db->escape_identifiers(implode('_', $primary_keys)); + $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->escape_identifiers($primary_keys)).')'; } if (is_array($keys) && count($keys) > 0) @@ -138,12 +151,12 @@ class CI_DB_mysqli_forge extends CI_DB_forge { { if (is_array($key)) { - $key_name = $this->db->protect_identifiers(implode('_', $key)); - $key = $this->db->protect_identifiers($key); + $key_name = $this->db->escape_identifiers(implode('_', $key)); + $key = $this->db->escape_identifiers($key); } else { - $key_name = $this->db->protect_identifiers($key); + $key_name = $this->db->escape_identifiers($key); $key = array($key_name); } @@ -170,16 +183,16 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ protected function _alter_table($alter_type, $table, $fields, $after_field = '') { - $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; + $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table).' '.$alter_type.' '; // DROP has everything it needs now. if ($alter_type === 'DROP') { - return $sql.$this->db->protect_identifiers($fields); + return $sql.$this->db->escape_identifiers($fields); } return $sql.$this->_process_fields($fields) - .($after_field !== '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : ''); + .($after_field !== '' ? ' AFTER '.$this->db->escape_identifiers($after_field) : ''); } } -- cgit v1.2.3-24-g4f1b From caa04f15096590261093dff2a8b59f266a1dcaf5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 8 Jun 2012 01:39:20 +0300 Subject: Revert back some escape_identifiers() to proect_identifiers() as the first one can't handle arrays --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index a1f58f0f7..e0e98f151 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -62,7 +62,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= "\n\t".$this->db->escape_identifiers($field); - empty($attributes['NAME']) OR $sql .= ' '.$this->db->protect_identifiers($attributes['NAME']).' '; + empty($attributes['NAME']) OR $sql .= ' '.$this->db->escape_identifiers($attributes['NAME']).' '; if ( ! empty($attributes['TYPE'])) { @@ -152,7 +152,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { if (is_array($key)) { $key_name = $this->db->escape_identifiers(implode('_', $key)); - $key = $this->db->escape_identifiers($key); + $key = $this->db->protect_identifiers($key); } else { -- cgit v1.2.3-24-g4f1b From 9637b40ca9e9ac1cdce2b895d3db09848a6eef76 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 8 Jun 2012 15:39:24 +0300 Subject: escape_identifiers() to accept arrays as well --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index e0e98f151..b74c775b2 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -152,7 +152,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { if (is_array($key)) { $key_name = $this->db->escape_identifiers(implode('_', $key)); - $key = $this->db->protect_identifiers($key); + $key = $this->db->escape_identifiers($key); } else { -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/database/drivers/mysqli/mysqli_forge.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index b74c775b2..b3c9e8e23 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -1,4 +1,4 @@ - Date: Fri, 2 Nov 2012 02:04:59 +0200 Subject: [ci skip] DocBlocks for DB drivers' utility classes Partially fixes issue #1295. --- system/database/drivers/mysqli/mysqli_forge.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index b3c9e8e23..0732dfea5 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -35,12 +35,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_mysqli_forge extends CI_DB_forge { + /** + * CREATE DATABASE statement + * + * @var string + */ protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s'; + // -------------------------------------------------------------------- + /** * Process Fields * - * @param mixed the fields + * @param mixed $fields * @return string */ protected function _process_fields($fields) -- cgit v1.2.3-24-g4f1b From a287a34c215903d3452023d74149eb5880125715 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Nov 2012 23:19:59 +0200 Subject: Refactored DB Forge - PDO subdrivers are isolated from each other now. - Added compatibility for pretty much all of the features, for every DB platform. - Unified the way that stuff works in general. - Fixes issue #1005. --- system/database/drivers/mysqli/mysqli_forge.php | 207 +++++++++++------------- 1 file changed, 91 insertions(+), 116 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 0732dfea5..914d6a268 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -42,165 +42,140 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s'; - // -------------------------------------------------------------------- - /** - * Process Fields + * UNSIGNED support * - * @param mixed $fields - * @return string + * @var array */ - protected function _process_fields($fields) - { - $current_field_count = 0; - $sql = ''; - - 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 - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t".$attributes; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->escape_identifiers($field); - - empty($attributes['NAME']) OR $sql .= ' '.$this->db->escape_identifiers($attributes['NAME']).' '; - - if ( ! empty($attributes['TYPE'])) - { - $sql .= ' '.$attributes['TYPE']; - - if ( ! empty($attributes['CONSTRAINT'])) - { - switch (strtolower($attributes['TYPE'])) - { - case 'decimal': - case 'float': - case 'numeric': - $sql .= '('.implode(',', $attributes['CONSTRAINT']).')'; - break; - case 'enum': - case 'set': - $sql .= '("'.implode('","', $attributes['CONSTRAINT']).'")'; - break; - default: - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - } - } + protected $_unsigned = array( + 'TINYINT', + 'SMALLINT', + 'MEDIUMINT', + 'INT', + 'INTEGER', + 'BIGINT', + 'REAL', + 'DOUBLE', + 'DOUBLE PRECISION', + 'FLOAT', + 'DECIMAL', + 'NUMERIC' + ); - if ( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (isset($attributes['DEFAULT'])) - { - $sql .= " DEFAULT '".$attributes['DEFAULT']."'"; - } - - $sql .= ( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) - ? ' NULL' : ' NOT NULL'; + /** + * NULL value representation in CREATE/ALTER TABLE statements + * + * @var string + */ + protected $_null = 'NULL'; - if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } + // -------------------------------------------------------------------- - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } + /** + * Class constructor + * + * @return void + */ + public function __construct() + { + parent::__construct(); - return $sql; + $this->_create_table .= ' DEFAULT CHARSET '.$this->db->char_set.' COLLATE '.$this->db->dbcollat; } // -------------------------------------------------------------------- /** - * Create Table + * ALTER TABLE * - * @param string the table name - * @param mixed the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param bool should 'IF NOT EXISTS' be added to the SQL - * @return bool + * @param string $alter_type ALTER type + * @param string $table Table name + * @param mixed $field Column definition + * @return string|string[] */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _alter_table($alter_type, $table, $field) { - $sql = 'CREATE TABLE '; - - if ($if_not_exists === TRUE) - { - $sql .= 'IF NOT EXISTS '; - } - - $sql .= $this->db->escape_identifiers($table).' ('.$this->_process_fields($fields); - - if (count($primary_keys) > 0) + if ($alter_type === 'DROP') { - $key_name = $this->db->escape_identifiers(implode('_', $primary_keys)); - $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->escape_identifiers($primary_keys)).')'; + return parent::_alter_table($alter_type, $table, $field); } - if (is_array($keys) && count($keys) > 0) + $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table); + for ($i = 0, $c = count($field); $i < $c; $i++) { - foreach ($keys as $key) + if ($field[$i]['_literal'] !== FALSE) { - if (is_array($key)) + $field[$i] = ($alter_type === 'ADD') + ? "\n\tADD ".$field[$i]['_literal'] + : "\n\tMODIFY ".$field[$i]['_literal']; + } + else + { + if ($alter_type === 'ADD') { - $key_name = $this->db->escape_identifiers(implode('_', $key)); - $key = $this->db->escape_identifiers($key); + $field[$i]['_literal'] = "\n\tADD "; } else { - $key_name = $this->db->escape_identifiers($key); - $key = array($key_name); + $field[$i]['_literal'] = empty($field['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE "; } - $sql .= ",\n\tKEY ".$key_name.' ('.implode(', ', $key).')'; + $field[$i] = $field['_literal'].$this->_process_column($field[$i]); } } - return $sql."\n) DEFAULT CHARACTER SET ".$this->db->char_set.' COLLATE '.$this->db->dbcollat.';'; + return array($sql.implode(',', $field)); } // -------------------------------------------------------------------- /** - * Alter table query + * Process column * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), + * @param array $field + * @return string + */ + protected function _process_column($field) + { + return $this->db->escape_identifiers($field['name']) + .(empty($field['new_name']) ? '' : $this->db->escape_identifiers($field['new_name'])) + .' '.$field['type'].$field['length'] + .$field['unsigned'] + .$field['null'] + .$field['default'] + .$field['auto_increment'] + .$field['unique']; + } + + // -------------------------------------------------------------------- + + /** + * Process indexes * - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param array fields - * @param string the field after which we should add the new field + * @param string $table (ignored) * @return string */ - protected function _alter_table($alter_type, $table, $fields, $after_field = '') + protected function _process_indexes($table = NULL) { - $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table).' '.$alter_type.' '; + $sql = ''; - // DROP has everything it needs now. - if ($alter_type === 'DROP') + for ($i = 0, $c = count($this->keys); $i < $c; $i++) { - return $sql.$this->db->escape_identifiers($fields); + if ( ! isset($this->fields[$this->keys[$i]])) + { + unset($this->keys[$i]); + continue; + } + + is_array($this->keys[$i]) OR $this->keys[$i] = array($this->keys[$i]); + + $sql .= ",\n\tKEY ".$this->db->escape_identifiers(implode('_', $this->keys[$i])) + .' ('.implode(', ', $this->db->escape_identifiers($this->keys[$i])).')'; } - return $sql.$this->_process_fields($fields) - .($after_field !== '' ? ' AFTER '.$this->db->escape_identifiers($after_field) : ''); + $this->keys = array(); + + return $sql; } } -- cgit v1.2.3-24-g4f1b From eaa60c71082c1e49f8a48d633347c98b68a387c0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Nov 2012 01:11:22 +0200 Subject: Added possibility to pass custom database objects to DB Forge and DB Utilities Also, their property is no longer public and the utility class no longer extends CI_DB_forge. --- system/database/drivers/mysqli/mysqli_forge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 914d6a268..088a6a09a 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -74,11 +74,12 @@ class CI_DB_mysqli_forge extends CI_DB_forge { /** * Class constructor * + * @param object &$db Database object * @return void */ - public function __construct() + public function __construct(&$db) { - parent::__construct(); + parent::__construct($db); $this->_create_table .= ' DEFAULT CHARSET '.$this->db->char_set.' COLLATE '.$this->db->dbcollat; } -- cgit v1.2.3-24-g4f1b From e8b896348dc29a1c1e02d97b06b7497613924ad6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 8 Nov 2012 12:05:00 +0200 Subject: Fix #1985 --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 088a6a09a..294fc20b6 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -118,10 +118,10 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } else { - $field[$i]['_literal'] = empty($field['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE "; + $field[$i]['_literal'] = empty($field[$i]['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE "; } - $field[$i] = $field['_literal'].$this->_process_column($field[$i]); + $field[$i] = $field[$i]['_literal'].$this->_process_column($field[$i]); } } -- cgit v1.2.3-24-g4f1b From b0a97c100f5e7edc5e21ec7d07f768cd3b5618da Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 11 Nov 2012 13:58:53 +0200 Subject: Fix DBForge index creation on MySQL and CUBRID --- system/database/drivers/mysqli/mysqli_forge.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 294fc20b6..5a6560b25 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -42,6 +42,16 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s'; + /** + * CREATE TABLE keys flag + * + * Whether table keys are created from within the + * CREATE TABLE statement. + * + * @var bool + */ + protected $_create_table_keys = TRUE; + /** * UNSIGNED support * -- cgit v1.2.3-24-g4f1b From b67277b8063b0e6aab051ce269194255ef83e808 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Nov 2012 12:51:14 +0200 Subject: Bring back the AFTER clause for DB Forge add_column() (it was temporarily removed due to multiple inconsistencies with other drivers) This commit also fixes issue #1988. Also added support for the FIRST clause (again, MySQL and CUBRID only). --- system/database/drivers/mysqli/mysqli_forge.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 5a6560b25..a70eef88f 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -148,6 +148,14 @@ class CI_DB_mysqli_forge extends CI_DB_forge { */ protected function _process_column($field) { + $extra_clause = isset($field['after']) + ? ' AFTER '.$this->db->escape_identifiers($field['after']) : ''; + + if (empty($extra_clause) && isset($field['first']) && $field['first'] === TRUE) + { + $extra_clause = ' FIRST'; + } + return $this->db->escape_identifiers($field['name']) .(empty($field['new_name']) ? '' : $this->db->escape_identifiers($field['new_name'])) .' '.$field['type'].$field['length'] @@ -155,7 +163,8 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['null'] .$field['default'] .$field['auto_increment'] - .$field['unique']; + .$field['unique'] + .$extra_clause; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 7ade8b7944d10f4fd1583789309cf003a3eac6f7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 22 Nov 2012 13:12:22 +0200 Subject: Fix modify_column() issues (#2020) --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index a70eef88f..1a6e284ee 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -157,7 +157,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } return $this->db->escape_identifiers($field['name']) - .(empty($field['new_name']) ? '' : $this->db->escape_identifiers($field['new_name'])) + .(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name'])) .' '.$field['type'].$field['length'] .$field['unsigned'] .$field['null'] -- cgit v1.2.3-24-g4f1b From 3545102a83a70a42876148037bec05f4bb32913e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 25 Nov 2012 17:20:04 +0200 Subject: Fix #2027 --- system/database/drivers/mysqli/mysqli_forge.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 1a6e284ee..f29ea5ade 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -175,13 +175,24 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * @param string $table (ignored) * @return string */ - protected function _process_indexes($table = NULL) + protected function _process_indexes($table) { $sql = ''; for ($i = 0, $c = count($this->keys); $i < $c; $i++) { - if ( ! isset($this->fields[$this->keys[$i]])) + if (is_array($this->keys[$i])) + { + for ($i2 = 0, $c2 = count($this->keys[$i]); $i2 < $c2; $i2++) + { + if ( ! isset($this->fields[$this->keys[$i][$i2]])) + { + unset($this->keys[$i][$i2]); + continue; + } + } + } + elseif ( ! isset($this->fields[$this->keys[$i]])) { unset($this->keys[$i]); continue; -- cgit v1.2.3-24-g4f1b From 80500afbd188600212ca913a7bac073009feac73 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Jan 2013 08:16:53 +0200 Subject: [ci skip] Happy new year --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index f29ea5ade..d1e5e20ff 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 27f798b9d64025fecaaecbd80a8cba41d455940f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Jan 2014 18:19:13 +0200 Subject: Add support for optional table attributes to CI_DB_forge::create_table() Supersedes PRs #989, #2776 Related issue: #41 --- system/database/drivers/mysqli/mysqli_forge.php | 30 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index d1e5e20ff..1a568ccd9 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -82,16 +82,34 @@ class CI_DB_mysqli_forge extends CI_DB_forge { // -------------------------------------------------------------------- /** - * Class constructor + * CREATE TABLE attributes * - * @param object &$db Database object - * @return void + * @param array $attributes Associative array of table attributes + * @return string */ - public function __construct(&$db) + protected function _create_table_attr($attributes) { - parent::__construct($db); + $sql = ''; + + foreach (array_keys($attributes) as $key) + { + if (is_string($key)) + { + $sql .= ' '.strtoupper($key).' = '.$attributes[$key]; + } + } - $this->_create_table .= ' DEFAULT CHARSET '.$this->db->char_set.' COLLATE '.$this->db->dbcollat; + if ( ! empty($this->db->char_set) && ! strpos($sql, 'CHARACTER SET') && ! strpos($sql, 'CHARSET')) + { + $sql .= ' DEFAULT CHARACTER SET = '.$this->db->char_set; + } + + if ( ! empty($this->db->dbcollat) && ! strpos($sql, 'COLLATE')) + { + $sql .= ' COLLATE = '.$this->db->dbcollat; + } + + return $sql; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 871754af60251993d640981e107d2def5f2db396 Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 17:34:57 +0100 Subject: 2013 > 2014 Update copyright notices from 2013 to 2014. And update one calendar example in user_guide from year 2013/2014 to 2014/2015. --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 1a568ccd9..3a19405d2 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From bdb96ca1b1dbfc1791172fd169d7751cbc4d7d55 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Oct 2014 00:13:31 +0200 Subject: [ci skip] Switch to MIT license; close #3293 --- system/database/drivers/mysqli/mysqli_forge.php | 41 ++++++++++++++++--------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 3a19405d2..c9a5b6db7 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -4,24 +4,35 @@ * * An open source application development framework for PHP 5.2.4 or newer * - * NOTICE OF LICENSE + * This content is released under the MIT License (MIT) * - * Licensed under the Open Software License version 3.0 + * Copyright (c) 2014, British Columbia Institute of Technology * - * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is - * also available through the world wide web at this URL: - * http://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to obtain it - * through the world wide web, please send an email to - * licensing@ellislab.com so we can send you a copy immediately. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * @package CodeIgniter - * @author EllisLab Dev Team + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @package CodeIgniter + * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * @link http://codeigniter.com - * @since Version 1.0 + * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @license http://opensource.org/licenses/MIT MIT License + * @link http://codeigniter.com + * @since Version 1.3.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); @@ -29,6 +40,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /** * MySQLi Forge Class * + * @package CodeIgniter + * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ -- cgit v1.2.3-24-g4f1b From 24fbc61e4a46c1e9f185c36629960dce0bad71e2 Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Sun, 2 Nov 2014 21:50:15 -0700 Subject: Add support for the COMMENT field in DBForge and MySQL Forge classes (pdo, mysql, and mysqli) Signed-off-by: Zachary Flower --- system/database/drivers/mysqli/mysqli_forge.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c9a5b6db7..c92d22264 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -194,6 +194,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['null'] .$field['default'] .$field['auto_increment'] + .$field['comment'] .$field['unique'] .$extra_clause; } -- cgit v1.2.3-24-g4f1b From 12ee7a1a74e45b1369876ea945ae3347da046087 Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Mon, 3 Nov 2014 08:38:41 -0700 Subject: Move comment field after unique field in db forge --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c92d22264..e37bd1b80 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -194,8 +194,8 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['null'] .$field['default'] .$field['auto_increment'] - .$field['comment'] .$field['unique'] + .$field['comment'] .$extra_clause; } -- cgit v1.2.3-24-g4f1b From e4b10bf0ad59049ed78ed9cfc5f708188f3cd442 Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Mon, 3 Nov 2014 10:42:57 -0700 Subject: Move MySQL comments to MySQL forge classes only --- system/database/drivers/mysqli/mysqli_forge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index e37bd1b80..38f624909 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -187,6 +187,8 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $extra_clause = ' FIRST'; } + $comment_clause = isset($field['comment']) ? ' COMMENT ' . $field['comment'] : ''; + return $this->db->escape_identifiers($field['name']) .(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name'])) .' '.$field['type'].$field['length'] @@ -195,7 +197,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['default'] .$field['auto_increment'] .$field['unique'] - .$field['comment'] + .$comment_clause .$extra_clause; } -- cgit v1.2.3-24-g4f1b From 5289f27c07bfb1d961317de351c4819f25dd5f2e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 3 Nov 2014 22:45:28 +0200 Subject: Polish changes following #3305 Also add support for field comments in PostgreSQL & Oracle ... only via alter_table() for now :/ --- system/database/drivers/mysqli/mysqli_forge.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 38f624909..24dc2b2ad 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -90,7 +90,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * * @var string */ - protected $_null = 'NULL'; + protected $_null = 'NULL'; // -------------------------------------------------------------------- @@ -187,8 +187,6 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $extra_clause = ' FIRST'; } - $comment_clause = isset($field['comment']) ? ' COMMENT ' . $field['comment'] : ''; - return $this->db->escape_identifiers($field['name']) .(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name'])) .' '.$field['type'].$field['length'] @@ -197,7 +195,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['default'] .$field['auto_increment'] .$field['unique'] - .$comment_clause + .(empty($field['comment']) ? '' : ' COMMENT '.$field['comment']) .$extra_clause; } -- cgit v1.2.3-24-g4f1b From fe9309d22c1b088f5363954d6dac013c8c955894 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 Jan 2015 17:48:58 +0200 Subject: Bulk (mostly documentation) update - Remove PHP version from license notices - Bump year number in copyright notices - Recommend PHP 5.4 or newer to be used - Tell Travis-CI to test on PHP 5.3.0 instead of the latest 5.3 version Related: #3450 --- system/database/drivers/mysqli/mysqli_forge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 24dc2b2ad..29a8b4cef 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.3.0 -- cgit v1.2.3-24-g4f1b From 4cbe463b4c442e0e2dae2f43565e77f7ac5ecb86 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 21 Jan 2015 22:56:22 +0100 Subject: Remove closing blocks at end of PHP files --- system/database/drivers/mysqli/mysqli_forge.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 29a8b4cef..196afa845 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -242,6 +242,3 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } } - -/* End of file mysqli_forge.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 125ef4751080a2118cb203357d77687699e3eb25 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:33:00 +0200 Subject: [ci skip] Bump year to 2016 --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 196afa845..0f19b737c 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology + * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.3.0 -- cgit v1.2.3-24-g4f1b From bd202c91b0e9cf0a8c93bcaa71df9574f5909346 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:50:18 +0200 Subject: [ci skip] Update codeigniter.com links to https --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 0f19b737c..42b69b55a 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License - * @link http://codeigniter.com + * @link https://codeigniter.com * @since Version 1.3.0 * @filesource */ @@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @subpackage Drivers * @category Database * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/database/ + * @link https://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_forge extends CI_DB_forge { -- cgit v1.2.3-24-g4f1b From 1924e879b165fb119847a49a7a5eab2f28295fa2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:55:34 +0200 Subject: [ci skip] Update ellislab.com links to https too --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 42b69b55a..c17f729c0 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -28,7 +28,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com -- cgit v1.2.3-24-g4f1b From da60e9bc66ec90970fbd2dfd08b0a6e66b9f5f5f Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sat, 31 Dec 2016 08:46:18 -0800 Subject: Update copyright data to 2017 --- system/database/drivers/mysqli/mysqli_forge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c17f729c0..c5b23b6ca 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2016, British Columbia Institute of Technology + * Copyright (c) 2014 - 2017, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) - * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.3.0 -- cgit v1.2.3-24-g4f1b