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/mysql/mysql_utility.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 48c4d6316..9cb6645eb 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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 @@ * MySQL Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_utility extends CI_DB_utility { -- 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/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 9cb6645eb..703524165 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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 2caf289a893b8af69bbdce3f29d84d29e5433b58 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 27 Jan 2012 00:12:03 +0200 Subject: Improve the MySQL database driver --- system/database/drivers/mysql/mysql_utility.php | 70 ++++++++++--------------- 1 file changed, 27 insertions(+), 43 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 703524165..0e7c18e16 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -1,13 +1,13 @@ -db->_escape_identifiers($table); + return 'OPTIMIZE TABLE '.$this->db->_escape_identifiers($table); } // -------------------------------------------------------------------- @@ -70,26 +66,24 @@ class CI_DB_mysql_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name - * @return object + * @return string */ - function _repair_table($table) + public function _repair_table($table) { - return "REPAIR TABLE ".$this->db->_escape_identifiers($table); + return 'REPAIR TABLE '.$this->db->_escape_identifiers($table); } // -------------------------------------------------------------------- /** * MySQL Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + public function _backup($params = array()) { - if (count($params) == 0) + if (count($params) === 0) { return FALSE; } @@ -99,16 +93,16 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Build the output $output = ''; - foreach ((array)$tables as $table) + foreach ( (array) $tables as $table) { // Is the table in the "ignore" list? - if (in_array($table, (array)$ignore, TRUE)) + if (in_array($table, (array) $ignore, TRUE)) { continue; } // Get the table schema - $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.`'.$table.'`'); + $query = $this->db->query('SHOW CREATE TABLE `'.$this->db->database.'`.`'.$table.'`'); // No result means the table name was invalid if ($query === FALSE) @@ -141,7 +135,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Grab all the data from the current table - $query = $this->db->query("SELECT * FROM $table"); + $query = $this->db->query('SELECT * FROM '.$table); if ($query->num_rows() == 0) { @@ -149,7 +143,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Fetch the field names and determine if the field is an - // integer type. We use this info to decide whether to + // integer type. We use this info to decide whether to // surround the data with quotes or not $i = 0; @@ -158,11 +152,9 @@ class CI_DB_mysql_utility extends CI_DB_utility { while ($field = mysql_fetch_field($query->result_id)) { // Most versions of MySQL store timestamp as a string - $is_int[$i] = (in_array( - strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'), //, 'timestamp'), - TRUE) - ) ? TRUE : FALSE; + $is_int[$i] = in_array(strtolower(mysql_field_type($query->result_id, $i)), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'), //, 'timestamp'), + TRUE); // Create a string of field names $field_str .= '`'.$field->name.'`, '; @@ -170,8 +162,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Trim off the end comma - $field_str = preg_replace( "/, $/" , "" , $field_str); - + $field_str = preg_replace('/, $/' , '', $field_str); // Build the insert string foreach ($query->result_array() as $row) @@ -189,14 +180,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { else { // Escape the data if it's not an integer - if ($is_int[$i] == FALSE) - { - $val_str .= $this->db->escape($v); - } - else - { - $val_str .= $v; - } + $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; } // Append a comma @@ -205,13 +189,13 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Remove the comma at the end of the string - $val_str = preg_replace( "/, $/" , "" , $val_str); + $val_str = preg_replace('/, $/' , '', $val_str); // Build the INSERT string $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; } - $output .= $newline.$newline; + return $output.$newline.$newline; } return $output; @@ -219,4 +203,4 @@ class CI_DB_mysql_utility extends CI_DB_utility { } /* End of file mysql_utility.php */ -/* Location: ./system/database/drivers/mysql/mysql_utility.php */ \ No newline at end of file +/* Location: ./system/database/drivers/mysql/mysql_utility.php */ -- cgit v1.2.3-24-g4f1b From 93cac5cc7bd1537788506d577c69852b4895a932 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 14 Feb 2012 14:45:02 +0200 Subject: Fix issue #1039 --- system/database/drivers/mysql/mysql_utility.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 0e7c18e16..538aaa0f7 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -56,7 +56,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { */ public function _optimize_table($table) { - return 'OPTIMIZE TABLE '.$this->db->_escape_identifiers($table); + return 'OPTIMIZE TABLE '.$this->db->protect_identifiers($table); } // -------------------------------------------------------------------- @@ -71,7 +71,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { */ public function _repair_table($table) { - return 'REPAIR TABLE '.$this->db->_escape_identifiers($table); + return 'REPAIR TABLE '.$this->db->protect_identifiers($table); } // -------------------------------------------------------------------- @@ -102,7 +102,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Get the table schema - $query = $this->db->query('SHOW CREATE TABLE `'.$this->db->database.'`.`'.$table.'`'); + $query = $this->db->query('SHOW CREATE TABLE '.$this->db->protect_identifiers($this->db->database).'.'.$this->db->protect_identifiers($table)); // No result means the table name was invalid if ($query === FALSE) @@ -115,7 +115,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { if ($add_drop == TRUE) { - $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; + $output .= 'DROP TABLE IF EXISTS '.($this->db->protect_identifiers($table).';'.$newline.$newline; } $i = 0; @@ -135,7 +135,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Grab all the data from the current table - $query = $this->db->query('SELECT * FROM '.$table); + $query = $this->db->query('SELECT * FROM '.$this->db->protect_identifiers($table)); if ($query->num_rows() == 0) { @@ -157,7 +157,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { TRUE); // Create a string of field names - $field_str .= '`'.$field->name.'`, '; + $field_str .= $this->db->protect_identifiers($field->name).', '; $i++; } @@ -192,7 +192,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { $val_str = preg_replace('/, $/' , '', $val_str); // Build the INSERT string - $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; + $output .= 'INSERT INTO '.$this->db->protect_identifiers($table).' ('.$field_str.') VALUES ('.$val_str.');'.$newline; } return $output.$newline.$newline; @@ -200,6 +200,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { return $output; } + } /* End of file mysql_utility.php */ -- cgit v1.2.3-24-g4f1b From c51816da79d4b7a1c517142d7380234a9d8bae77 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 14 Feb 2012 16:55:42 +0200 Subject: Fix another issue --- system/database/drivers/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 538aaa0f7..9d7cb679c 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -195,7 +195,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { $output .= 'INSERT INTO '.$this->db->protect_identifiers($table).' ('.$field_str.') VALUES ('.$val_str.');'.$newline; } - return $output.$newline.$newline; + $output .= $newline.$newline; } return $output; -- cgit v1.2.3-24-g4f1b From 24dd2f9c5cc4476f19c67fe8df6b3ae9cc8a4bb3 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Fri, 17 Feb 2012 17:08:31 +0700 Subject: Syntax error, causing MySQL utility could not used --- system/database/drivers/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 9d7cb679c..952f887fe 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -115,7 +115,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { if ($add_drop == TRUE) { - $output .= 'DROP TABLE IF EXISTS '.($this->db->protect_identifiers($table).';'.$newline.$newline; + $output .= 'DROP TABLE IF EXISTS '.$this->db->protect_identifiers($table).';'.$newline.$newline; } $i = 0; -- 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/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 952f887fe..d716b004a 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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 9cc5c60052d1942a5f49016a8f36cf90b27b7c78 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:36:37 -0400 Subject: Minor mysql/mysqli formatting fixes --- system/database/drivers/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index d716b004a..2d89cb9cb 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -204,4 +204,4 @@ class CI_DB_mysql_utility extends CI_DB_utility { } /* End of file mysql_utility.php */ -/* Location: ./system/database/drivers/mysql/mysql_utility.php */ +/* Location: ./system/database/drivers/mysql/mysql_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From b457a4001ce2380e97f36b0a983b477c3e31de69 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 16:11:56 +0300 Subject: DB Utility improvements - Replaced driver methods _list_databases(), _optimize_table() and _repair_table() with properties - Added defaults for optimize_table() and repair_table() SQL strings (FALSE, as those are mostly MySQL-specific) - Added MSSQL/SQLSRV support for optimize_table() (actually rebuilds table indexes) - Switched public driver methods to protected - Improved CUBRID support for list_databases() as it used to only return the currently used database - Minor speed improvements --- system/database/drivers/mysql/mysql_utility.php | 45 +++---------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 2d89cb9cb..642323dbd 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -34,54 +34,17 @@ */ class CI_DB_mysql_utility extends CI_DB_utility { - /** - * List databases - * - * @return string - */ - public function _list_databases() - { - return 'SHOW DATABASES'; - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Generates a platform-specific query so that a table can be optimized - * - * @param string the table name - * @return string - */ - public function _optimize_table($table) - { - return 'OPTIMIZE TABLE '.$this->db->protect_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @param string the table name - * @return string - */ - public function _repair_table($table) - { - return 'REPAIR TABLE '.$this->db->protect_identifiers($table); - } + protected $_list_databases = 'SHOW DATABASES'; + protected $_optimize_table = 'OPTIMIZE TABLE %s'; + protected $_repair_table = 'REPAIR TABLE %s'; - // -------------------------------------------------------------------- /** * MySQL Export * * @param array Preferences * @return mixed */ - public function _backup($params = array()) + protected function _backup($params = array()) { if (count($params) === 0) { -- 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/mysql/mysql_utility.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 642323dbd..643682fde 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -76,7 +76,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Write out the table schema $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; - if ($add_drop == TRUE) + if ($add_drop === TRUE) { $output .= 'DROP TABLE IF EXISTS '.$this->db->protect_identifiers($table).';'.$newline.$newline; } @@ -92,7 +92,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // If inserts are not needed we're done... - if ($add_insert == FALSE) + if ($add_insert === FALSE) { continue; } @@ -100,7 +100,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Grab all the data from the current table $query = $this->db->query('SELECT * FROM '.$this->db->protect_identifiers($table)); - if ($query->num_rows() == 0) + if ($query->num_rows() === 0) { continue; } @@ -143,7 +143,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { else { // Escape the data if it's not an integer - $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; + $val_str .= ($is_int[$i] === FALSE) ? $this->db->escape($v) : $v; } // Append a comma -- 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/mysql/mysql_utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 643682fde..f0bbc665e 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -65,7 +65,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Get the table schema - $query = $this->db->query('SHOW CREATE TABLE '.$this->db->protect_identifiers($this->db->database).'.'.$this->db->protect_identifiers($table)); + $query = $this->db->query('SHOW CREATE TABLE '.$this->db->escape_identifiers($this->db->database.'.'.$table)); // No result means the table name was invalid if ($query === FALSE) @@ -120,7 +120,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { TRUE); // Create a string of field names - $field_str .= $this->db->protect_identifiers($field->name).', '; + $field_str .= $this->db->escape_identifiers($field->name).', '; $i++; } -- 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/mysql/mysql_utility.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index f0bbc665e..bc20d2556 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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/mysql/mysql_utility.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index bc20d2556..8aa051755 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -35,14 +35,33 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_mysql_utility extends CI_DB_utility { + /** + * List databases statement + * + * @var string + */ protected $_list_databases = 'SHOW DATABASES'; + + /** + * OPTIMIZE TABLE statement + * + * @var string + */ protected $_optimize_table = 'OPTIMIZE TABLE %s'; + + /** + * REPAIR TABLE statement + * + * @var string + */ protected $_repair_table = 'REPAIR TABLE %s'; + // -------------------------------------------------------------------- + /** - * MySQL Export + * Export * - * @param array Preferences + * @param array $params Preferences * @return mixed */ protected function _backup($params = array()) -- cgit v1.2.3-24-g4f1b From 79494dde1c53b671f279e5c5fab2ae03a9ff0353 Mon Sep 17 00:00:00 2001 From: Andrew Podner Date: Wed, 19 Dec 2012 14:15:41 -0500 Subject: Resolves issue #2081 : provides an option to include statements to disable and re-enable foreign key checks in a MySQL database backup output statement. --- system/database/drivers/mysql/mysql_utility.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 8aa051755..e2de82d0b 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -76,6 +76,13 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Build the output $output = ''; + + // Do we need to include a statement to disable FK checks? + if ($fk_checks === FALSE) + { + $output .= "SET foreign_key_checks = 0;".$newline; + } + foreach ( (array) $tables as $table) { // Is the table in the "ignore" list? @@ -181,6 +188,12 @@ class CI_DB_mysql_utility extends CI_DB_utility { $output .= $newline.$newline; } + // Do we need to include a statement to re-enable FK checks? + if ($fk_checks === FALSE) + { + $output .= "SET foreign_key_checks = 1;".$newline; + } + return $output; } -- cgit v1.2.3-24-g4f1b From 4851217a1330580ebf73f0a6fb79ad451b73759a Mon Sep 17 00:00:00 2001 From: Andrew Podner Date: Thu, 20 Dec 2012 07:56:19 -0500 Subject: fixes #2081 : change parameter/variable name to 'foreign_key_checks', update change log Signed-off-by:Andrew Podner --- system/database/drivers/mysql/mysql_utility.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index e2de82d0b..f118033dc 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -77,8 +77,8 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Build the output $output = ''; - // Do we need to include a statement to disable FK checks? - if ($fk_checks === FALSE) + // Do we need to include a statement to disable foreign key checks? + if ($foreign_key_checks === FALSE) { $output .= "SET foreign_key_checks = 0;".$newline; } @@ -188,8 +188,8 @@ class CI_DB_mysql_utility extends CI_DB_utility { $output .= $newline.$newline; } - // Do we need to include a statement to re-enable FK checks? - if ($fk_checks === FALSE) + // Do we need to include a statement to re-enable foreign key checks? + if ($foreign_key_checks === FALSE) { $output .= "SET foreign_key_checks = 1;".$newline; } -- cgit v1.2.3-24-g4f1b From 61c4d0a22e63d44bb07d9a3c5f0da030dd5b5ef9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 20 Dec 2012 16:29:29 +0200 Subject: [ci skip] Minor style/spacing changes following PR #2087 --- system/database/drivers/mysql/mysql_utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index f118033dc..94ef95ae0 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -80,7 +80,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Do we need to include a statement to disable foreign key checks? if ($foreign_key_checks === FALSE) { - $output .= "SET foreign_key_checks = 0;".$newline; + $output .= 'SET foreign_key_checks = 0;'.$newline; } foreach ( (array) $tables as $table) @@ -191,7 +191,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Do we need to include a statement to re-enable foreign key checks? if ($foreign_key_checks === FALSE) { - $output .= "SET foreign_key_checks = 1;".$newline; + $output .= 'SET foreign_key_checks = 1;'.$newline; } return $output; -- 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/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 94ef95ae0..ea8702708 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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 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/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index ea8702708..91de8710e 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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/mysql/mysql_utility.php | 39 ++++++++++++++++--------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 91de8710e..a71701eea 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); -- 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/mysql/mysql_utility.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index a71701eea..2ec4da4b2 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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.0.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/mysql/mysql_utility.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 2ec4da4b2..55857ab08 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -209,6 +209,3 @@ class CI_DB_mysql_utility extends CI_DB_utility { } } - -/* End of file mysql_utility.php */ -/* Location: ./system/database/drivers/mysql/mysql_utility.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/mysql/mysql_utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 55857ab08..3802a46fa 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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.0.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/mysql/mysql_utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 3802a46fa..1b0abf4ee 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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.0.0 * @filesource */ @@ -42,7 +42,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * * @category Database * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/database/ + * @link https://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_utility extends CI_DB_utility { -- 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/mysql/mysql_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 1b0abf4ee..4c1f2391b 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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/mysql/mysql_utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/mysql/mysql_utility.php') diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 4c1f2391b..bc01fc58d 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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.0.0 -- cgit v1.2.3-24-g4f1b