From 26086874ebb5425a38e879018f9a654182f93b40 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 11:21:58 +0300 Subject: Rename the 'interbase' DB driver to 'ibase' in order to match PHP's function prefix --- system/database/drivers/ibase/ibase_driver.php | 447 ++++++++++++++++++++++++ system/database/drivers/ibase/ibase_forge.php | 194 ++++++++++ system/database/drivers/ibase/ibase_result.php | 260 ++++++++++++++ system/database/drivers/ibase/ibase_utility.php | 62 ++++ system/database/drivers/ibase/index.html | 10 + 5 files changed, 973 insertions(+) create mode 100644 system/database/drivers/ibase/ibase_driver.php create mode 100644 system/database/drivers/ibase/ibase_forge.php create mode 100644 system/database/drivers/ibase/ibase_result.php create mode 100644 system/database/drivers/ibase/ibase_utility.php create mode 100644 system/database/drivers/ibase/index.html (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php new file mode 100644 index 000000000..a257e3c55 --- /dev/null +++ b/system/database/drivers/ibase/ibase_driver.php @@ -0,0 +1,447 @@ +hostname.':'.$this->database, $this->username, $this->password, $this->char_set); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @return resource + */ + public function db_pconnect() + { + return @ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); + } + + // -------------------------------------------------------------------- + + /** + * Database version number + * + * @return string + */ + public function version() + { + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + + if (($service = ibase_service_attach($this->hostname, $this->username, $this->password))) + { + $this->data_cache['version'] = ibase_server_info($service, IBASE_SVC_SERVER_VERSION); + + // Don't keep the service open + ibase_service_detach($service); + return $this->data_cache['version']; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @param string an SQL query + * @return resource + */ + protected function _execute($sql) + { + return @ibase_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @return bool + */ + public function trans_begin($test_mode = FALSE) + { + // When transactions are nested we only begin/commit/rollback the outermost ones + if ( ! $this->trans_enabled OR $this->_trans_depth > 0) + { + return TRUE; + } + + // Reset the transaction failure flag. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. + $this->_trans_failure = ($test_mode === TRUE); + + $this->trans = @ibase_trans($this->conn_id); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @return bool + */ + public function trans_commit() + { + // When transactions are nested we only begin/commit/rollback the outermost ones + if ( ! $this->trans_enabled OR $this->_trans->depth > 0) + { + return TRUE; + } + + return @ibase_commit($this->trans); + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @return bool + */ + public function trans_rollback() + { + // When transactions are nested we only begin/commit/rollback the outermost ones + if ( ! $this->trans_enabled OR $this->_trans_depth > 0) + { + return TRUE; + } + + return @ibase_rollback($this->trans); + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @param string + * @param bool whether or not the string will be used in a LIKE condition + * @return string + */ + public function escape_str($str, $like = FALSE) + { + if (is_array($str)) + { + foreach ($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + + // escape LIKE condition wildcards + if ($like === TRUE) + { + return str_replace(array($this->_like_escape_chr, '%', '_'), + array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), + $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @return int + */ + public function affected_rows() + { + return @ibase_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @param string $generator_name + * @param int $inc_by + * @return int + */ + public function insert_id($generator_name, $inc_by = 0) + { + //If a generator hasn't been used before it will return 0 + return ibase_gen_id('"'.$generator_name.'"', $inc_by); + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @param bool + * @return string + */ + protected function _list_tables($prefix_limit = FALSE) + { + $sql = 'SELECT "RDB$RELATION_NAME" FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; + + if ($prefix_limit !== FALSE && $this->dbprefix !== '') + { + return $sql.' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + .sprintf($this->_like_escape_str, $this->_like_escape_chr); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @param string the table name + * @return string + */ + protected function _list_columns($table = '') + { + return 'SELECT "RDB$FIELD_NAME" FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @param string the table name + * @return string + */ + protected function _field_data($table) + { + return $this->_limit('SELECT * FROM '.$this->protect_identifiers($table), 1, NULL); + } + + // -------------------------------------------------------------------- + + /** + * Error + * + * Returns an array containing code and message of the last + * database error that has occured. + * + * @return array + */ + public function error() + { + return array('code' => ibase_errcode(), 'message' => ibase_errmsg()); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This public function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @param array + * @return string + */ + protected function _from_tables($tables) + { + return is_array($tables) ? implode(', ', $tables) : $tables; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause (ignored) + * @param array the like clause + * @return string + */ + protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE, $like = array()) + { + foreach ($values as $key => $val) + { + $valstr[] = $key.' = '.$val; + } + + $where = empty($where) ? '' : ' WHERE '.implode(' ', $where); + + if ( ! empty($like)) + { + $where .= ($where === '' ? ' WHERE ' : ' AND ').implode(' ', $like); + } + + return 'UPDATE '.$table.' SET '.implode(', ', $valstr) + .$where + .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : ''); + } + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * + * If the database does not support the truncate() command, + * then this method maps to 'DELETE FROM table' + * + * @param string the table name + * @return string + */ + protected function _truncate($table) + { + return 'DELETE FROM '.$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @param string the table name + * @param array the where clause + * @param array the like clause + * @param string the limit clause (ignored) + * @return string + */ + protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) + { + $conditions = array(); + + empty($where) OR $conditions[] = implode(' ', $where); + empty($like) OR $conditions[] = implode(' ', $like); + + return 'DELETE FROM '.$table.(count($conditions) > 0 ? ' WHERE '.implode(' AND ', $conditions) : ''); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @param string the sql query string + * @param int the number of rows to limit the query to + * @param int the offset value + * @return string + */ + protected function _limit($sql, $limit, $offset) + { + // Limit clause depends on if Interbase or Firebird + if (stripos($this->version(), 'firebird') !== FALSE) + { + $select = 'FIRST '. (int) $limit + .($offset ? ' SKIP '. (int) $offset : ''); + } + else + { + $select = 'ROWS ' + .($offset ? (int) $offset.' TO '.($limit + $offset) : (int) $limit); + } + + return preg_replace('`SELECT`i', 'SELECT '.$select, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @return void + */ + protected function _close() + { + @ibase_close($this->conn_id); + } + +} + +/* End of file ibase_driver.php */ +/* Location: ./system/database/drivers/ibase/ibase_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php new file mode 100644 index 000000000..da75eb9c3 --- /dev/null +++ b/system/database/drivers/ibase/ibase_forge.php @@ -0,0 +1,194 @@ +db->hostname) OR $db_name = $this->hostname.':'.$db_name; + + return parent::create_database('"'.$db_name.'"'); + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @param string the database name + * - not used in this driver, the current db is dropped + * @return bool + */ + public function drop_database($db_name = '') + { + if ( ! ibase_drop_db($this->conn_id)) + { + return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE; + } + elseif ( ! empty($this->db->data_cache['db_names'])) + { + $key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE); + if ($key !== FALSE) + { + unset($this->db->data_cache['db_names'][$key]); + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @param string the table name + * @param array the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param bool should 'IF NOT EXISTS' be added to the SQL + * @return string + */ + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + $sql .= $this->db->escape_identifiers($table).'('; + $current_field_count = 0; + + 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).' '.$attributes['TYPE']; + + empty($attributes['CONSTRAINT']) OR $sql .= '('.$attributes['CONSTRAINT'].')'; + + 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 + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + if (count($primary_keys) > 0) + { + $primary_keys = $this->db->escape_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).')'; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + $key = is_array($key) + ? $this->db->escape_identifiers($key) + : array($this->db->escape_identifiers($key)); + + $sql .= ",\n\tUNIQUE (".implode(', ', $key).')'; + } + } + + return $sql."\n)"; + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param bool should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return string + */ + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + return 'ALTER TABLE '.$this->db->escape_identifiers($table).' '.$alter_type.' '.$this->db->escape_identifiers($column_name) + .' '.$column_definition + .($default_value !== '' ? ' DEFAULT "'.$default_value.'"' : '') + .($null === NULL ? ' NULL' : ' NOT NULL') + .($after_field !== '' ? ' AFTER '.$this->db->escape_identifiers($after_field) : ''); + } + +} + +/* End of file ibase_forge.php */ +/* Location: ./system/database/drivers/ibase/ibase_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php new file mode 100644 index 000000000..4aaaaba4a --- /dev/null +++ b/system/database/drivers/ibase/ibase_result.php @@ -0,0 +1,260 @@ +num_rows)) + { + return $this->num_rows; + } + + // Get the results so that you can get an accurate rowcount + $this->result(); + + return $this->num_rows; + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @return int + */ + public function num_fields() + { + return @ibase_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @return array + */ + public function list_fields() + { + $field_names = array(); + for ($i = 0, $num_fields = $this->num_fields(); $i < $num_fields; $i++) + { + $info = ibase_field_info($this->result_id, $i); + $field_names[] = $info['name']; + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @return array + */ + public function field_data() + { + $retval = array(); + for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) + { + $info = ibase_field_info($this->result_id, $i); + + $retval[$i] = new stdClass(); + $retval[$i]->name = $info['name']; + $retval[$i]->type = $info['type']; + $retval[$i]->max_length = $info['length']; + $retval[$i]->primary_key = 0; + $retval[$i]->default = ''; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return void + */ + public function free_result() + { + @ibase_free_result($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @return array + */ + protected function _fetch_assoc() + { + if (($row = @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) + { + //Increment row count + $this->num_rows++; + } + + return $row; + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @return object + */ + protected function _fetch_object() + { + if (($row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) + { + //Increment row count + $this->num_rows++; + } + + return $row; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "object" version. + * + * @return object + */ + public function result_object() + { + if (count($this->result_object) === $this->num_rows) + { + return $this->result_object; + } + + // Convert result array to object so that + // We don't have to get the result again + if (($c = count($this->result_array)) > 0) + { + for ($i = 0; $i < $c; $i++) + { + $this->result_object[$i] = (object) $this->result_array[$i]; + } + + return $this->result_object; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE) + { + return array(); + } + + $this->num_rows = 0; + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + + return $this->result_object; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @return array + */ + public function result_array() + { + if (count($this->result_array) === $this->num_rows) + { + return $this->result_array; + } + + // Since the object and array are really similar, just case + // the result object to an array if need be + if (($c = count($this->result_object)) > 0) + { + for ($i = 0; $i < $c; $i++) + { + $this->result_array[$i] = (array) $this->result_object[$i]; + } + + return $this->result_array; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE) + { + return array(); + } + + $this->num_rows = 0; + while ($row = $this->_fetch_assoc()) + { + $this->result_array[] = $row; + } + + return $this->result_array; + } + +} + +/* End of file ibase_result.php */ +/* Location: ./system/database/drivers/ibase/ibase_result.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php new file mode 100644 index 000000000..d0e84a7b2 --- /dev/null +++ b/system/database/drivers/ibase/ibase_utility.php @@ -0,0 +1,62 @@ +db->hostname, $this->db->username, $this->db->password)) + { + $res = ibase_backup($service, $this->db->database, $filename.'.fbk'); + + // Close the service connection + ibase_service_detach($service); + return $res; + } + + return FALSE; + } + +} + +/* End of file ibase_utility.php */ +/* Location: ./system/database/drivers/ibase/ibase_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/index.html b/system/database/drivers/ibase/index.html new file mode 100644 index 000000000..c942a79ce --- /dev/null +++ b/system/database/drivers/ibase/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 5ca0513e1af6c2498f6f28b769c30d762495389f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 12:06:34 +0300 Subject: Change DB_result::num_rows default value to NULL --- system/database/drivers/ibase/ibase_result.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 4aaaaba4a..6a607f589 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -21,7 +21,7 @@ * @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 3.0 + * @since Version 1.0 * @filesource */ @@ -33,11 +33,10 @@ * @category Database * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ + * @since 3.0 */ class CI_DB_ibase_result extends CI_DB_result { - public $num_rows; - /** * Number of rows in the result set * -- cgit v1.2.3-24-g4f1b From c7db6bb9b64c8322af4d727bcb71122cd7f09dbf Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 15:11:20 +0300 Subject: Clean-up the separate drivers' DB result classes from no longer needed methods --- system/database/drivers/ibase/ibase_result.php | 122 +------------------------ 1 file changed, 2 insertions(+), 120 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 6a607f589..fdf74096f 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -37,26 +37,6 @@ */ class CI_DB_ibase_result extends CI_DB_result { - /** - * Number of rows in the result set - * - * @return int - */ - public function num_rows() - { - if (is_int($this->num_rows)) - { - return $this->num_rows; - } - - // Get the results so that you can get an accurate rowcount - $this->result(); - - return $this->num_rows; - } - - // -------------------------------------------------------------------- - /** * Number of fields in the result set * @@ -138,13 +118,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ protected function _fetch_assoc() { - if (($row = @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) - { - //Increment row count - $this->num_rows++; - } - - return $row; + return @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS); } // -------------------------------------------------------------------- @@ -158,99 +132,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ protected function _fetch_object() { - if (($row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) - { - //Increment row count - $this->num_rows++; - } - - return $row; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "object" version. - * - * @return object - */ - public function result_object() - { - if (count($this->result_object) === $this->num_rows) - { - return $this->result_object; - } - - // Convert result array to object so that - // We don't have to get the result again - if (($c = count($this->result_array)) > 0) - { - for ($i = 0; $i < $c; $i++) - { - $this->result_object[$i] = (object) $this->result_array[$i]; - } - - return $this->result_object; - } - - // In the event that query caching is on the result_id variable - // will return FALSE since there isn't a valid SQL resource so - // we'll simply return an empty array. - if ($this->result_id === FALSE) - { - return array(); - } - - $this->num_rows = 0; - while ($row = $this->_fetch_object()) - { - $this->result_object[] = $row; - } - - return $this->result_object; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "array" version. - * - * @return array - */ - public function result_array() - { - if (count($this->result_array) === $this->num_rows) - { - return $this->result_array; - } - - // Since the object and array are really similar, just case - // the result object to an array if need be - if (($c = count($this->result_object)) > 0) - { - for ($i = 0; $i < $c; $i++) - { - $this->result_array[$i] = (array) $this->result_object[$i]; - } - - return $this->result_array; - } - - // In the event that query caching is on the result_id variable - // will return FALSE since there isn't a valid SQL resource so - // we'll simply return an empty array. - if ($this->result_id === FALSE) - { - return array(); - } - - $this->num_rows = 0; - while ($row = $this->_fetch_assoc()) - { - $this->result_array[] = $row; - } - - return $this->result_array; + return @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS); } } -- cgit v1.2.3-24-g4f1b From 77a5d94974f546fb5f1cb04cfca4dbdf54f1d46b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 15:42:14 +0300 Subject: Add a default _count_string property --- system/database/drivers/ibase/ibase_driver.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index a257e3c55..c9027670d 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -49,13 +49,7 @@ class CI_DB_ibase_driver extends CI_DB { protected $_like_escape_str = " ESCAPE '%s' "; protected $_like_escape_chr = '!'; - /** - * The syntax to count rows is slightly different across different - * database engines, so this string appears in each driver and is - * used for the count_all() and count_all_results() functions. - */ - protected $_count_string = 'SELECT COUNT(*) AS '; - protected $_random_keyword = ' Random()'; // database specific random keyword + protected $_random_keyword = ' Random()'; // database specific random keyword // Keeps track of the resource for the current transaction protected $trans; -- cgit v1.2.3-24-g4f1b From 9a4f356846daa078c077cbadb227524c857b8f97 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 6 Jul 2012 11:57:37 +0300 Subject: _fetch_object(), custom_result_object() to utilize PHP's native capability to directly return custom class results --- system/database/drivers/ibase/ibase_result.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index fdf74096f..95e55710b 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -128,11 +128,25 @@ class CI_DB_ibase_result extends CI_DB_result { * * Returns the result set as an object * + * @param string * @return object */ - protected function _fetch_object() + protected function _fetch_object($class_name = 'stdClass') { - return @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS); + $row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS); + + if ($class_name === 'stdClass' OR ! $row) + { + return $row; + } + + $class_name = new $class_name(); + foreach ($row as $key => $value) + { + $class_name->$key = $value; + } + + return $class_name; } } -- cgit v1.2.3-24-g4f1b From b04786599e1b032078f1d3bdd8941405d47447a0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 18 Jul 2012 15:34:46 +0300 Subject: Remove dependancies on qb_like and remove unneeded parameters from _delete(), _like(), _update(), _update_batch() --- system/database/drivers/ibase/ibase_driver.php | 36 +++++--------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index c9027670d..86c1fee6d 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -328,29 +328,12 @@ class CI_DB_ibase_driver extends CI_DB { * * @param string the table name * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause (ignored) - * @param array the like clause * @return string */ - protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE, $like = array()) + protected function _update($table, $values) { - foreach ($values as $key => $val) - { - $valstr[] = $key.' = '.$val; - } - - $where = empty($where) ? '' : ' WHERE '.implode(' ', $where); - - if ( ! empty($like)) - { - $where .= ($where === '' ? ' WHERE ' : ' AND ').implode(' ', $like); - } - - return 'UPDATE '.$table.' SET '.implode(', ', $valstr) - .$where - .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : ''); + $this->qb_limit = FALSE; + return parent::_update($table, $values); } // -------------------------------------------------------------------- @@ -379,19 +362,12 @@ class CI_DB_ibase_driver extends CI_DB { * Generates a platform-specific delete string from the supplied data * * @param string the table name - * @param array the where clause - * @param array the like clause - * @param string the limit clause (ignored) * @return string */ - protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) + protected function _delete($table) { - $conditions = array(); - - empty($where) OR $conditions[] = implode(' ', $where); - empty($like) OR $conditions[] = implode(' ', $like); - - return 'DELETE FROM '.$table.(count($conditions) > 0 ? ' WHERE '.implode(' AND ', $conditions) : ''); + $this->qb_limit = FALSE; + return parent::_delete($table); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From c9b924c1498847d8f324d81c8994fff0b95f26dc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 19 Jul 2012 13:06:02 +0300 Subject: Remove _limit()'s extra parameters and qb_limit, qb_offset unneeded typecasts + add _compile_group_by() method --- system/database/drivers/ibase/ibase_driver.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 86c1fee6d..7b37b9999 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -285,7 +285,10 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _field_data($table) { - return $this->_limit('SELECT * FROM '.$this->protect_identifiers($table), 1, NULL); + $this->qb_limit = 1; + $sql = $this->_limit('SELECT * FROM '.$this->protect_identifiers($table)); + $this->qb_limit = 0; + return $sql; } // -------------------------------------------------------------------- @@ -378,22 +381,20 @@ class CI_DB_ibase_driver extends CI_DB { * Generates a platform-specific LIMIT clause * * @param string the sql query string - * @param int the number of rows to limit the query to - * @param int the offset value * @return string */ - protected function _limit($sql, $limit, $offset) + protected function _limit($sql) { // Limit clause depends on if Interbase or Firebird if (stripos($this->version(), 'firebird') !== FALSE) { - $select = 'FIRST '. (int) $limit - .($offset ? ' SKIP '. (int) $offset : ''); + $select = 'FIRST '.$this->qb_limit + .($this->qb_offset ? ' SKIP '.$this->qb_offset : ''); } else { $select = 'ROWS ' - .($offset ? (int) $offset.' TO '.($limit + $offset) : (int) $limit); + .($this->qb_offset ? $this->qb_offset.' TO '.($this->qb_limit + $this->qb_offset) : $this->qb_limit); } return preg_replace('`SELECT`i', 'SELECT '.$select, $sql); -- cgit v1.2.3-24-g4f1b From 2ea33c37e9bfa3ff0e029c18a0d2c9ef05016bf0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 4 Oct 2012 12:37:51 +0300 Subject: Fix issue #1789 Signed-off-by: Andrey Andreev --- system/database/drivers/ibase/ibase_driver.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index c9027670d..f7811bf46 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -45,10 +45,6 @@ class CI_DB_ibase_driver extends CI_DB { // The character used to escape with protected $_escape_char = '"'; - // clause and character used for LIKE escape sequences - protected $_like_escape_str = " ESCAPE '%s' "; - protected $_like_escape_chr = '!'; - protected $_random_keyword = ' Random()'; // database specific random keyword // Keeps track of the resource for the current transaction -- cgit v1.2.3-24-g4f1b From cd50592b26a26a2e55fc193529a2463d9a465378 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 6 Oct 2012 21:27:01 +0300 Subject: Fix issue #1257 --- system/database/drivers/ibase/ibase_driver.php | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index f7811bf46..ab1d1b88d 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -301,22 +301,6 @@ class CI_DB_ibase_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * From Tables - * - * This public function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @param array - * @return string - */ - protected function _from_tables($tables) - { - return is_array($tables) ? implode(', ', $tables) : $tables; - } - - // -------------------------------------------------------------------- - /** * Update statement * -- cgit v1.2.3-24-g4f1b From 5fd3ae8d33a4f5d3159b86683b9a670e973a63f5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 24 Oct 2012 14:55:35 +0300 Subject: [ci skip] style and phpdoc-related changes (rel #1295) --- system/database/drivers/ibase/ibase_driver.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 96d6f6526..c3be519bf 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -116,6 +116,7 @@ class CI_DB_ibase_driver extends CI_DB { /** * Begin Transaction * + * @param bool $test_mode = FALSE * @return bool */ public function trans_begin($test_mode = FALSE) -- 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/ibase/ibase_driver.php | 3 ++- system/database/drivers/ibase/ibase_forge.php | 3 ++- system/database/drivers/ibase/ibase_result.php | 3 ++- system/database/drivers/ibase/ibase_utility.php | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index c3be519bf..3b5d8f4c6 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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/ibase/ibase_forge.php | 9 ++++++++- system/database/drivers/ibase/ibase_utility.php | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 7f3693dbd..7c4d00a23 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -35,12 +35,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_ibase_forge extends CI_DB_forge { + /** + * DROP TABLE statement + * + * @var string + */ protected $_drop_table = 'DROP TABLE %s'; + // -------------------------------------------------------------------- + /** * Create database * - * @param string the database name + * @param string $db_name * @return string */ public function create_database($db_name) diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 06de677b6..5eb209ae1 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_utility.php @@ -35,10 +35,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_ibase_utility extends CI_DB_utility { - protected $_list_databases = FALSE; - /** - * Interbase/Firebird Export + * Export * * @param string $filename * @return mixed -- cgit v1.2.3-24-g4f1b From 8463b919e17d9bd7fa35821d547c4acc229520f7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Nov 2012 02:16:28 +0200 Subject: [ci skip] DocBlocks for DB drivers' result classes Partially fixes issue #1295. --- system/database/drivers/ibase/ibase_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 6ee0a7d59..bbad9d895 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -129,7 +129,7 @@ class CI_DB_ibase_result extends CI_DB_result { * * Returns the result set as an object * - * @param string + * @param string $class_name * @return object */ protected function _fetch_object($class_name = 'stdClass') -- cgit v1.2.3-24-g4f1b From a24e52e1c0136db0c1949e73255b4e9bf114b437 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Nov 2012 03:54:12 +0200 Subject: [ci skip] DocBlocks for DB drivers' driver classes Partially fixes issue #1295. --- system/database/drivers/ibase/ibase_driver.php | 59 ++++++++++++++++---------- 1 file changed, 37 insertions(+), 22 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 3b5d8f4c6..fc1c28f31 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -41,15 +41,30 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_ibase_driver extends CI_DB { + /** + * Database driver + * + * @var string + */ public $dbdriver = 'ibase'; - // The character used to escape with - protected $_escape_char = '"'; + // -------------------------------------------------------------------- + + /** + * ORDER BY random keyword + * + * @var string + */ + protected $_random_keyword = ' Random()'; - protected $_random_keyword = ' Random()'; // database specific random keyword + /** + * IBase Transaction status flag + * + * @var resource + */ + protected $_ibase_trans; - // Keeps track of the resource for the current transaction - protected $trans; + // -------------------------------------------------------------------- /** * Non-persistent database connection @@ -104,7 +119,7 @@ class CI_DB_ibase_driver extends CI_DB { /** * Execute the query * - * @param string an SQL query + * @param string $sql an SQL query * @return resource */ protected function _execute($sql) @@ -117,7 +132,7 @@ class CI_DB_ibase_driver extends CI_DB { /** * Begin Transaction * - * @param bool $test_mode = FALSE + * @param bool $test_mode * @return bool */ public function trans_begin($test_mode = FALSE) @@ -133,7 +148,7 @@ class CI_DB_ibase_driver extends CI_DB { // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE); - $this->trans = @ibase_trans($this->conn_id); + $this->_ibase_trans = @ibase_trans($this->conn_id); return TRUE; } @@ -153,7 +168,7 @@ class CI_DB_ibase_driver extends CI_DB { return TRUE; } - return @ibase_commit($this->trans); + return @ibase_commit($this->_ibase_trans); } // -------------------------------------------------------------------- @@ -171,7 +186,7 @@ class CI_DB_ibase_driver extends CI_DB { return TRUE; } - return @ibase_rollback($this->trans); + return @ibase_rollback($this->_ibase_trans); } // -------------------------------------------------------------------- @@ -179,8 +194,8 @@ class CI_DB_ibase_driver extends CI_DB { /** * Escape String * - * @param string - * @param bool whether or not the string will be used in a LIKE condition + * @param string $str + * @param bool $like Whether or not the string will be used in a LIKE condition * @return string */ public function escape_str($str, $like = FALSE) @@ -240,7 +255,7 @@ class CI_DB_ibase_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @param bool + * @param bool $prefix_limit * @return string */ protected function _list_tables($prefix_limit = FALSE) @@ -263,7 +278,7 @@ class CI_DB_ibase_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * - * @param string the table name + * @param string $table * @return string */ protected function _list_columns($table = '') @@ -278,7 +293,7 @@ class CI_DB_ibase_driver extends CI_DB { * * Generates a platform-specific query so that the column data can be retrieved * - * @param string the table name + * @param string $table * @return string */ protected function _field_data($table) @@ -311,8 +326,8 @@ class CI_DB_ibase_driver extends CI_DB { * * Generates a platform-specific update string from the supplied data * - * @param string the table name - * @param array the update data + * @param string $table + * @param array $values * @return string */ protected function _update($table, $values) @@ -328,10 +343,10 @@ class CI_DB_ibase_driver extends CI_DB { * * Generates a platform-specific truncate string from the supplied data * - * If the database does not support the truncate() command, + * If the database does not support the TRUNCATE statement, * then this method maps to 'DELETE FROM table' * - * @param string the table name + * @param string $table * @return string */ protected function _truncate($table) @@ -346,7 +361,7 @@ class CI_DB_ibase_driver extends CI_DB { * * Generates a platform-specific delete string from the supplied data * - * @param string the table name + * @param string $table * @return string */ protected function _delete($table) @@ -358,11 +373,11 @@ class CI_DB_ibase_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Limit string + * LIMIT * * Generates a platform-specific LIMIT clause * - * @param string the sql query string + * @param string $sql SQL Query * @return string */ protected function _limit($sql) -- 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/ibase/ibase_forge.php | 204 +++++++++++++++----------- 1 file changed, 122 insertions(+), 82 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 7c4d00a23..a0c4e6563 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -36,11 +36,43 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class CI_DB_ibase_forge extends CI_DB_forge { /** - * DROP TABLE statement + * CREATE TABLE IF statement * * @var string */ - protected $_drop_table = 'DROP TABLE %s'; + protected $_create_table_if = FALSE; + + /** + * RENAME TABLE statement + * + * @var string + */ + protected $_rename_table = FALSE; + + /** + * DROP TABLE IF statement + * + * @var string + */ + protected $_drop_table_if = FALSE; + + /** + * UNSIGNED support + * + * @var array + */ + protected $_unsigned = array( + 'SMALLINT' => 'INTEGER', + 'INTEGER' => 'INT64', + 'FLOAT' => 'DOUBLE PRECISION' + ); + + /** + * NULL value representation in CREATE/ALTER TABLE statements + * + * @var string + */ + protected $_null = 'NULL'; // -------------------------------------------------------------------- @@ -65,8 +97,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { /** * Drop database * - * @param string the database name - * - not used in this driver, the current db is dropped + * @param string $db_name (ignored) * @return bool */ public function drop_database($db_name = '') @@ -90,110 +121,119 @@ class CI_DB_ibase_forge extends CI_DB_forge { // -------------------------------------------------------------------- /** - * Create Table + * ALTER TABLE * - * @param string the table name - * @param array the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param bool should 'IF NOT EXISTS' be added to the SQL - * @return string + * @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) - { - $sql = 'CREATE TABLE '; - - $sql .= $this->db->escape_identifiers($table).'('; - $current_field_count = 0; + protected function _alter_table($alter_type, $table, $field) + { + if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) + { + return parent::_alter_table($alter_type, $table, $field); + } - foreach ($fields as $field => $attributes) + $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table); + $sqls = array(); + for ($i = 0, $c = count($field), $sql .= $alter_type.' '; $i < $c; $i++) { - // 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)) + if ($field[$i]['_literal'] !== FALSE) { - $sql .= "\n\t".$attributes; + return FALSE; } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->escape_identifiers($field).' '.$attributes['TYPE']; - - empty($attributes['CONSTRAINT']) OR $sql .= '('.$attributes['CONSTRAINT'].')'; - - 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'; - } + if (isset($field[$i]['type'])) + { + $sqls[] = $sql.' TYPE '.$field[$i]['type'].$field[$i]['length']; } - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) + if ( ! empty($field[$i]['default'])) { - $sql .= ','; + $sqls[] = $sql.' ALTER '.$this->db->escape_identifiers($field[$i]['name']) + .' SET '.$field[$i]['default']; } - } - if (count($primary_keys) > 0) - { - $primary_keys = $this->db->escape_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).')'; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) + if (isset($field[$i]['null'])) { - $key = is_array($key) - ? $this->db->escape_identifiers($key) - : array($this->db->escape_identifiers($key)); + $sqls[] = 'UPDATE "RDB$RELATION_FIELDS" SET "RDB$NULL_FLAG" = ' + .($field[$i]['null'] === TRUE ? 'NULL' : '1') + .' WHERE "RDB$FIELD_NAME" = '.$this->db->escape($field[$i]['name']) + .' AND "RDB$RELATION_NAME" = '.$this->db->escape($table); + } - $sql .= ",\n\tUNIQUE (".implode(', ', $key).')'; + if ( ! empty($field[$i]['new_name'])) + { + $sqls[] = $sql.' ALTER '.$this->db->escape_identifiers($field[$i]['name']) + .' TO '.$this->db->escape_identifiers($field[$i]['new_name']); } } - return $sql."\n)"; + return $sqls; + } + + // -------------------------------------------------------------------- + + /** + * Process column + * + * @param array $field + * @return string + */ + protected function _process_column($field) + { + return $this->db->escape_identifiers($field['name']) + .' '.$field['type'].$field['length'] + .$field['null'] + .$field['unique'] + .$field['default']; } // -------------------------------------------------------------------- /** - * Alter table query + * Field attribute TYPE * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), + * Performs a data type mapping between different databases. * - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param string the table name - * @param string the column definition - * @param string the default value - * @param bool should 'NOT NULL' be added - * @param string the field after which we should add the new field - * @return string + * @param array &$attributes + * @return void + */ + protected function _attr_type(&$attributes) + { + switch (strtoupper($attributes['TYPE'])) + { + case 'TINYINT': + $attributes['TYPE'] = 'SMALLINT'; + $attributes['UNSIGNED'] = FALSE; + return; + case 'MEDIUMINT': + $attributes['TYPE'] = 'INTEGER'; + $attributes['UNSIGNED'] = FALSE; + return; + case 'INT': + $attributes['TYPE'] = 'INTEGER'; + return; + case 'BIGINT': + $attributes['TYPE'] = 'INT64'; + return; + default: return; + } + } + + // -------------------------------------------------------------------- + + /** + * Field attribute AUTO_INCREMENT + * + * @param array &$attributes + * @param array &$field + * @return void */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _attr_auto_increment(&$attributes, &$field) { - return 'ALTER TABLE '.$this->db->escape_identifiers($table).' '.$alter_type.' '.$this->db->escape_identifiers($column_name) - .' '.$column_definition - .($default_value !== '' ? ' DEFAULT "'.$default_value.'"' : '') - .($null === NULL ? ' NULL' : ' NOT NULL') - .($after_field !== '' ? ' AFTER '.$this->db->escape_identifiers($after_field) : ''); + // Not supported } } -- cgit v1.2.3-24-g4f1b From 98e46cf96447a2a6448d8dc984948a8694dbf747 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 13 Nov 2012 03:01:42 +0200 Subject: Add seed values support for Query Builder order_by (feature request #1987) --- system/database/drivers/ibase/ibase_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index fc1c28f31..02ec354e3 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -53,9 +53,9 @@ class CI_DB_ibase_driver extends CI_DB { /** * ORDER BY random keyword * - * @var string + * @var array */ - protected $_random_keyword = ' Random()'; + protected $_random_keyword = array('RAND()', 'RAND()'); /** * IBase Transaction status flag -- cgit v1.2.3-24-g4f1b From 02e7a9d6509092315dd31183762616860ebb9621 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 16 Nov 2012 01:49:46 +0200 Subject: Improve DB field_data() for Interbase / Firebird --- system/database/drivers/ibase/ibase_driver.php | 45 ++++++++++++++++++++------ system/database/drivers/ibase/ibase_result.php | 2 -- 2 files changed, 36 insertions(+), 11 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 02ec354e3..15c2a4630 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -289,19 +289,46 @@ class CI_DB_ibase_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved + * Returns an object with field data * * @param string $table - * @return string + * @return array */ - protected function _field_data($table) + public function field_data($table = '') { - $this->qb_limit = 1; - $sql = $this->_limit('SELECT * FROM '.$this->protect_identifiers($table)); - $this->qb_limit = 0; - return $sql; + if ($table === '') + { + return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE; + } + + $sql = 'SELECT "rfields"."RDB$FIELD_NAME" AS "name", + CASE "fields"."RDB$FIELD_TYPE" + WHEN 7 THEN \'SMALLINT\' + WHEN 8 THEN \'INTEGER\' + WHEN 9 THEN \'QUAD\' + WHEN 10 THEN \'FLOAT\' + WHEN 11 THEN \'DFLOAT\' + WHEN 12 THEN \'DATE\' + WHEN 13 THEN \'TIME\' + WHEN 14 THEN \'CHAR\' + WHEN 16 THEN \'INT64\' + WHEN 27 THEN \'DOUBLE\' + WHEN 35 THEN \'TIMESTAMP\' + WHEN 37 THEN \'VARCHAR\' + WHEN 40 THEN \'CSTRING\' + WHEN 261 THEN \'BLOB\' + ELSE NULL + END AS "type", + "fields"."RDB$FIELD_LENGTH" AS "max_length", + "rfields"."RDB$DEFAULT_VALUE" AS "default" + FROM "RDB$RELATION_FIELDS" "rfields" + JOIN "RDB$FIELDS" "fields" ON "rfields"."RDB$FIELD_SOURCE" = "fields"."RDB$FIELD_NAME" + WHERE "rfields"."RDB$RELATION_NAME" = '.$this->escape($table).' + ORDER BY "rfields"."RDB$FIELD_POSITION"'; + + return (($query = $this->query($sql)) !== FALSE) + ? $query->result_object() + : FALSE; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index bbad9d895..4f5637a72 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -89,8 +89,6 @@ class CI_DB_ibase_result extends CI_DB_result { $retval[$i]->name = $info['name']; $retval[$i]->type = $info['type']; $retval[$i]->max_length = $info['length']; - $retval[$i]->primary_key = 0; - $retval[$i]->default = ''; } return $retval; -- 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/ibase/ibase_forge.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index a0c4e6563..39c782816 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -137,7 +137,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table); $sqls = array(); - for ($i = 0, $c = count($field), $sql .= $alter_type.' '; $i < $c; $i++) + for ($i = 0, $c = count($field); $i < $c; $i++) { if ($field[$i]['_literal'] !== FALSE) { @@ -146,13 +146,14 @@ class CI_DB_ibase_forge extends CI_DB_forge { if (isset($field[$i]['type'])) { - $sqls[] = $sql.' TYPE '.$field[$i]['type'].$field[$i]['length']; + $sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identififers($field[$i]['name']) + .' TYPE '.$field[$i]['type'].$field[$i]['length']; } if ( ! empty($field[$i]['default'])) { - $sqls[] = $sql.' ALTER '.$this->db->escape_identifiers($field[$i]['name']) - .' SET '.$field[$i]['default']; + $sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name']) + .' SET DEFAULT '.$field[$i]['default']; } if (isset($field[$i]['null'])) @@ -165,7 +166,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { if ( ! empty($field[$i]['new_name'])) { - $sqls[] = $sql.' ALTER '.$this->db->escape_identifiers($field[$i]['name']) + $sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name']) .' TO '.$this->db->escape_identifiers($field[$i]['new_name']); } } -- 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/ibase/ibase_driver.php | 2 +- system/database/drivers/ibase/ibase_forge.php | 2 +- system/database/drivers/ibase/ibase_result.php | 2 +- system/database/drivers/ibase/ibase_utility.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 15c2a4630..87faf3d08 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.0 diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 39c782816..e3f714688 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.0 diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 4f5637a72..1ab1e2ada 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 5eb209ae1..4f9b1d19e 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.0 -- cgit v1.2.3-24-g4f1b From a541087a6fb44b24f8d7044277391f282a326220 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Wed, 9 Jan 2013 10:44:14 -0500 Subject: Fix interbase limit issue for subqueries --- system/database/drivers/ibase/ibase_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 87faf3d08..875f148a1 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -421,7 +421,7 @@ class CI_DB_ibase_driver extends CI_DB { .($this->qb_offset ? $this->qb_offset.' TO '.($this->qb_limit + $this->qb_offset) : $this->qb_limit); } - return preg_replace('`SELECT`i', 'SELECT '.$select, $sql); + return preg_replace('`SELECT`i', 'SELECT '.$select, $sql, 1); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 0b6a492ce1092172b9e3445e674ff9a344d33650 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 10 Jan 2013 16:53:44 +0200 Subject: Unify escape_str() array input and LIKE logic Added protected method _escape_str() to deal with quote escaping. --- system/database/drivers/ibase/ibase_driver.php | 32 -------------------------- 1 file changed, 32 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 875f148a1..745011056 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -191,38 +191,6 @@ class CI_DB_ibase_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * Escape String - * - * @param string $str - * @param bool $like Whether or not the string will be used in a LIKE condition - * @return string - */ - public function escape_str($str, $like = FALSE) - { - if (is_array($str)) - { - foreach ($str as $key => $val) - { - $str[$key] = $this->escape_str($val, $like); - } - - return $str; - } - - // escape LIKE condition wildcards - if ($like === TRUE) - { - return str_replace(array($this->_like_escape_chr, '%', '_'), - array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), - $str); - } - - return $str; - } - - // -------------------------------------------------------------------- - /** * Affected Rows * -- 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/ibase/ibase_driver.php | 2 +- system/database/drivers/ibase/ibase_forge.php | 2 +- system/database/drivers/ibase/ibase_result.php | 2 +- system/database/drivers/ibase/ibase_utility.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 745011056..4cff5f448 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.0 diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index e3f714688..19ac86c37 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.0 diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 1ab1e2ada..1f89db65d 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 4f9b1d19e..a17b19ea8 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.0 -- cgit v1.2.3-24-g4f1b From 2e171023bae38735ec08bbd9cb160cee75edbc62 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 25 Feb 2014 15:21:41 +0200 Subject: Make db_pconnect an alias for db_connect(TRUE) and reduce code repetition --- system/database/drivers/ibase/ibase_driver.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 4cff5f448..c85b19955 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -69,23 +69,14 @@ class CI_DB_ibase_driver extends CI_DB { /** * Non-persistent database connection * + * @param bool $persistent * @return resource */ - public function db_connect() + public function db_connect($persistent = FALSE) { - return @ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @return resource - */ - public function db_pconnect() - { - return @ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); + return ($persistent === TRUE) + ? @ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set) + : @ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From f2818bd9b9be242a1c53ee839a95962a682a2e93 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 25 Feb 2014 15:26:20 +0200 Subject: Remove error suppression usage from db_connect() --- system/database/drivers/ibase/ibase_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index c85b19955..b9eabd00e 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -75,8 +75,8 @@ class CI_DB_ibase_driver extends CI_DB { public function db_connect($persistent = FALSE) { return ($persistent === TRUE) - ? @ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set) - : @ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); + ? ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set) + : ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 2bbbd1a13ead097fd3f4b00bfb275f0b0f836f93 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 May 2014 10:24:14 +0300 Subject: Remove (most of) error suppression from database drivers (issue #3036) --- system/database/drivers/ibase/ibase_driver.php | 12 ++++++------ system/database/drivers/ibase/ibase_result.php | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index b9eabd00e..b19985c37 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -115,7 +115,7 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _execute($sql) { - return @ibase_query($this->conn_id, $sql); + return ibase_query($this->conn_id, $sql); } // -------------------------------------------------------------------- @@ -139,7 +139,7 @@ class CI_DB_ibase_driver extends CI_DB { // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE); - $this->_ibase_trans = @ibase_trans($this->conn_id); + $this->_ibase_trans = ibase_trans($this->conn_id); return TRUE; } @@ -159,7 +159,7 @@ class CI_DB_ibase_driver extends CI_DB { return TRUE; } - return @ibase_commit($this->_ibase_trans); + return ibase_commit($this->_ibase_trans); } // -------------------------------------------------------------------- @@ -177,7 +177,7 @@ class CI_DB_ibase_driver extends CI_DB { return TRUE; } - return @ibase_rollback($this->_ibase_trans); + return ibase_rollback($this->_ibase_trans); } // -------------------------------------------------------------------- @@ -189,7 +189,7 @@ class CI_DB_ibase_driver extends CI_DB { */ public function affected_rows() { - return @ibase_affected_rows($this->conn_id); + return ibase_affected_rows($this->conn_id); } // -------------------------------------------------------------------- @@ -392,7 +392,7 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _close() { - @ibase_close($this->conn_id); + ibase_close($this->conn_id); } } diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 1f89db65d..cb2c7f4a6 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -45,7 +45,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ public function num_fields() { - return @ibase_num_fields($this->result_id); + return ibase_num_fields($this->result_id); } // -------------------------------------------------------------------- @@ -103,7 +103,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ public function free_result() { - @ibase_free_result($this->result_id); + ibase_free_result($this->result_id); } // -------------------------------------------------------------------- @@ -117,7 +117,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ protected function _fetch_assoc() { - return @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS); + return ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS); } // -------------------------------------------------------------------- @@ -132,7 +132,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ protected function _fetch_object($class_name = 'stdClass') { - $row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS); + $row = ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS); if ($class_name === 'stdClass' OR ! $row) { -- cgit v1.2.3-24-g4f1b From d07daa54d991e38ccdcf41c4f9d90f307c5ecbc1 Mon Sep 17 00:00:00 2001 From: hArpanet Date: Thu, 21 Aug 2014 11:26:42 +0100 Subject: ibase_driver returning whitespace in table/column names Currently all Table and Field names are returned padded with whitespace up to string(124). --- system/database/drivers/ibase/ibase_driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index b19985c37..8f10c1f1d 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -219,11 +219,11 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _list_tables($prefix_limit = FALSE) { - $sql = 'SELECT "RDB$RELATION_NAME" FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; + $sql = 'SELECT TRIM("RDB$RELATION_NAME") FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { - return $sql.' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + return $sql.' AND TRIM("RDB$RELATION_NAME") LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } @@ -242,7 +242,7 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _list_columns($table = '') { - return 'SELECT "RDB$FIELD_NAME" FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); + return 'SELECT TRIM("RDB$FIELD_NAME") FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 516f59c855c969cfcdbc83bb1a2f4180e8cf9271 Mon Sep 17 00:00:00 2001 From: hArpanet Date: Tue, 26 Aug 2014 09:46:52 +0100 Subject: ibase_driver add table/column aliases to satisfy DB_driver expectations --- system/database/drivers/ibase/ibase_driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 8f10c1f1d..f4e5aef7c 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -219,11 +219,11 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _list_tables($prefix_limit = FALSE) { - $sql = 'SELECT TRIM("RDB$RELATION_NAME") FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; + $sql = 'SELECT TRIM("RDB$RELATION_NAME") AS TABLE_NAME FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { - return $sql.' AND TRIM("RDB$RELATION_NAME") LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + return $sql.' AND TRIM("RDB$RELATION_NAME") AS TABLE_NAME LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } @@ -242,7 +242,7 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _list_columns($table = '') { - return 'SELECT TRIM("RDB$FIELD_NAME") FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); + return 'SELECT TRIM("RDB$FIELD_NAME") AS COLUMN_NAME FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); } // -------------------------------------------------------------------- -- 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/ibase/ibase_driver.php | 39 +++++++++++++++--------- system/database/drivers/ibase/ibase_forge.php | 39 +++++++++++++++--------- system/database/drivers/ibase/ibase_result.php | 40 +++++++++++++++---------- system/database/drivers/ibase/ibase_utility.php | 39 +++++++++++++++--------- 4 files changed, 100 insertions(+), 57 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index f4e5aef7c..d6e0032d4 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.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 3.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 19ac86c37..73968bd03 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.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 3.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index cb2c7f4a6..8a9edea9d 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 3.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); @@ -34,7 +45,6 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @category Database * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ - * @since 3.0 */ class CI_DB_ibase_result extends CI_DB_result { diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index a17b19ea8..ee4bc7b26 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.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 3.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/ibase/ibase_driver.php | 6 +++--- system/database/drivers/ibase/ibase_forge.php | 6 +++--- system/database/drivers/ibase/ibase_result.php | 6 +++--- system/database/drivers/ibase/ibase_utility.php | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index d6e0032d4..aac606886 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 73968bd03..828739fb5 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 8a9edea9d..1b6bbd72a 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index ee4bc7b26..9dca599a8 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.0.0 -- cgit v1.2.3-24-g4f1b From 5350f056698168061ffde1ba62e8db1715101446 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Jan 2015 12:33:37 +0200 Subject: Change CI_DB_driver::field_data() signature The parameter is mandatory, it doesn't make sense to have a default empty string value only to check for it. --- system/database/drivers/ibase/ibase_driver.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index aac606886..20c5d9c57 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -264,13 +264,8 @@ class CI_DB_ibase_driver extends CI_DB { * @param string $table * @return array */ - public function field_data($table = '') + public function field_data($table) { - if ($table === '') - { - return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE; - } - $sql = 'SELECT "rfields"."RDB$FIELD_NAME" AS "name", CASE "fields"."RDB$FIELD_TYPE" WHEN 7 THEN \'SMALLINT\' -- 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/ibase/ibase_driver.php | 3 --- system/database/drivers/ibase/ibase_forge.php | 3 --- system/database/drivers/ibase/ibase_result.php | 3 --- system/database/drivers/ibase/ibase_utility.php | 3 --- 4 files changed, 12 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 20c5d9c57..529c320cd 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -402,6 +402,3 @@ class CI_DB_ibase_driver extends CI_DB { } } - -/* End of file ibase_driver.php */ -/* Location: ./system/database/drivers/ibase/ibase_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 828739fb5..0e748c710 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -249,6 +249,3 @@ class CI_DB_ibase_forge extends CI_DB_forge { } } - -/* End of file ibase_forge.php */ -/* Location: ./system/database/drivers/ibase/ibase_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 1b6bbd72a..991146f45 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -159,6 +159,3 @@ class CI_DB_ibase_result extends CI_DB_result { } } - -/* End of file ibase_result.php */ -/* Location: ./system/database/drivers/ibase/ibase_result.php */ \ No newline at end of file diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 9dca599a8..79d2788e5 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_utility.php @@ -67,6 +67,3 @@ class CI_DB_ibase_utility extends CI_DB_utility { } } - -/* End of file ibase_utility.php */ -/* Location: ./system/database/drivers/ibase/ibase_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From b68a811f1a09b8d6012b6782b36a988daf68a82e Mon Sep 17 00:00:00 2001 From: Tjoosten Date: Sun, 15 Feb 2015 22:44:24 +0100 Subject: add --- system/database/drivers/ibase/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/index.html b/system/database/drivers/ibase/index.html index c942a79ce..b702fbc39 100644 --- a/system/database/drivers/ibase/index.html +++ b/system/database/drivers/ibase/index.html @@ -1,3 +1,4 @@ + 403 Forbidden @@ -7,4 +8,4 @@

Directory access is forbidden.

- \ No newline at end of file + -- cgit v1.2.3-24-g4f1b From a7d4abaedc27497d570ae06ddc9cdde05930ec15 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Oct 2015 14:39:44 +0300 Subject: Fix #4171 and a number of other transaction bugs --- system/database/drivers/ibase/ibase_driver.php | 32 ++++++++++---------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 529c320cd..82550d51b 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -134,24 +134,16 @@ class CI_DB_ibase_driver extends CI_DB { /** * Begin Transaction * - * @param bool $test_mode * @return bool */ - public function trans_begin($test_mode = FALSE) + protected function _trans_begin() { - // When transactions are nested we only begin/commit/rollback the outermost ones - if ( ! $this->trans_enabled OR $this->_trans_depth > 0) + if (($trans_handle = ibase_trans($this->conn_id)) === FALSE) { - return TRUE; + return FALSE; } - // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. - $this->_trans_failure = ($test_mode === TRUE); - - $this->_ibase_trans = ibase_trans($this->conn_id); - + $this->_ibase_trans = $trans_handle; return TRUE; } @@ -162,15 +154,15 @@ class CI_DB_ibase_driver extends CI_DB { * * @return bool */ - public function trans_commit() + protected function _trans_commit() { - // When transactions are nested we only begin/commit/rollback the outermost ones - if ( ! $this->trans_enabled OR $this->_trans->depth > 0) + if (ibase_commit($this->_ibase_trans)) { + $this->_ibase_trans = NULL; return TRUE; } - return ibase_commit($this->_ibase_trans); + return FALSE; } // -------------------------------------------------------------------- @@ -180,15 +172,15 @@ class CI_DB_ibase_driver extends CI_DB { * * @return bool */ - public function trans_rollback() + protected function _trans_rollback() { - // When transactions are nested we only begin/commit/rollback the outermost ones - if ( ! $this->trans_enabled OR $this->_trans_depth > 0) + if (ibase_rollback($this->_ibase_trans)) { + $this->_ibase_trans = NULL; return TRUE; } - return ibase_rollback($this->_ibase_trans); + return FALSE; } // -------------------------------------------------------------------- -- 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/ibase/ibase_driver.php | 4 ++-- system/database/drivers/ibase/ibase_forge.php | 4 ++-- system/database/drivers/ibase/ibase_result.php | 4 ++-- system/database/drivers/ibase/ibase_utility.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 82550d51b..6b1c77b7f 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 0e748c710..02e7a3798 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 991146f45..c907e35ca 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 79d2788e5..0672113a3 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.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/ibase/ibase_driver.php | 4 ++-- system/database/drivers/ibase/ibase_forge.php | 4 ++-- system/database/drivers/ibase/ibase_result.php | 4 ++-- system/database/drivers/ibase/ibase_utility.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 6b1c77b7f..f1b89b748 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.0.0 * @filesource */ @@ -48,7 +48,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_ibase_driver extends CI_DB { diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 02e7a3798..44be2ed00 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.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_ibase_forge extends CI_DB_forge { diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index c907e35ca..a2c0d1d80 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 3.0.0 * @filesource */ @@ -44,7 +44,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_ibase_result extends CI_DB_result { diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 0672113a3..4b8790eee 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.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_ibase_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/ibase/ibase_driver.php | 2 +- system/database/drivers/ibase/ibase_forge.php | 2 +- system/database/drivers/ibase/ibase_result.php | 2 +- system/database/drivers/ibase/ibase_utility.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index f1b89b748..cbc1022ff 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 44be2ed00..9c358c365 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index a2c0d1d80..f3c21fcec 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 4b8790eee..619ebad01 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 8108b612fb80327215ae66b53c75c158d6f07e62 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 7 Mar 2016 10:10:17 +0200 Subject: [ci skip] Fix transactions for the ibase driver Reported via the forums: http://forum.codeigniter.com/thread-64559.html --- system/database/drivers/ibase/ibase_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index cbc1022ff..c1055c1e6 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -126,7 +126,7 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _execute($sql) { - return ibase_query($this->conn_id, $sql); + return ibase_query(isset($this->_ibase_trans) ? $this->_ibase_trans : $this->conn_id, $sql); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 0a4dd844b8a3d6edb7712d3bb4edf1b4f0e9dc4c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 16 Sep 2016 12:06:40 +0300 Subject: [ci skip] Don't try to insert_batch() when we know it's not supported on Firebird --- system/database/drivers/ibase/ibase_driver.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index c1055c1e6..671a353bc 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -383,6 +383,23 @@ class CI_DB_ibase_driver extends CI_DB { // -------------------------------------------------------------------- + /** + * Insert batch statement + * + * Generates a platform-specific insert string from the supplied data. + * + * @param string $table Table name + * @param array $keys INSERT keys + * @param array $values INSERT values + * @return string|bool + */ + protected function _insert_batch($table, $keys, $values) + { + return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; + } + + // -------------------------------------------------------------------- + /** * Close DB Connection * -- cgit v1.2.3-24-g4f1b From da270b26d7cb9c55385150659ecfb7d2d97b4c63 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 17 Oct 2016 18:22:43 +0300 Subject: Fix #4851 --- system/database/drivers/ibase/ibase_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 9c358c365..b35cc3749 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -111,7 +111,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { * @param string $db_name (ignored) * @return bool */ - public function drop_database($db_name = '') + public function drop_database($db_name) { if ( ! ibase_drop_db($this->conn_id)) { -- 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/ibase/ibase_driver.php | 4 ++-- system/database/drivers/ibase/ibase_forge.php | 4 ++-- system/database/drivers/ibase/ibase_result.php | 4 ++-- system/database/drivers/ibase/ibase_utility.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 671a353bc..106d5efac 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index b35cc3749..44bb24e68 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index f3c21fcec..7d7dd79ac 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.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 3.0.0 diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php index 619ebad01..3c152101a 100644 --- a/system/database/drivers/ibase/ibase_utility.php +++ b/system/database/drivers/ibase/ibase_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 3.0.0 -- cgit v1.2.3-24-g4f1b From 71d8f72ffc48a7f46747b3b6b1a554533cc1cbc5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 17 Jan 2017 12:01:00 +0200 Subject: [ci skip] Merge pull request #4986 from ka7/feature/spelling Spelling fixes in comment blocks and docs --- system/database/drivers/ibase/ibase_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 106d5efac..fea3bfe52 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -294,7 +294,7 @@ class CI_DB_ibase_driver extends CI_DB { * Error * * Returns an array containing code and message of the last - * database error that has occured. + * database error that has occurred. * * @return array */ -- cgit v1.2.3-24-g4f1b From ea0735264dfebd64858933e03a3b33323b14178e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 14 Mar 2017 18:42:12 +0200 Subject: Fix #5050 --- system/database/drivers/ibase/ibase_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index fea3bfe52..3069d6699 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -395,7 +395,7 @@ class CI_DB_ibase_driver extends CI_DB { */ protected function _insert_batch($table, $keys, $values) { - return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; + return ($this->db_debug) ? $this->display_error('db_unsupported_feature') : FALSE; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From ee9d428171dc201f51eaffdb62616312915681ff Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Jun 2017 10:44:37 +0300 Subject: [ci skip] Merge pull request #5143 from TysonAndre/misc-phpdoc-nits Fix misc inconsistencies between code and doc comments --- system/database/drivers/ibase/ibase_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 44bb24e68..31352f128 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -91,7 +91,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { * Create database * * @param string $db_name - * @return string + * @return bool */ public function create_database($db_name) { -- cgit v1.2.3-24-g4f1b