From d09c51afac9df77a52380dc2ac6581a104faa2ff Mon Sep 17 00:00:00 2001 From: "anaxamaxan@blackdog.local" Date: Wed, 2 Feb 2011 23:00:16 -0800 Subject: Made config->base_url() accept parameters. config->base_url($uri). Updated base_url() in url_helper accordingly. --- system/core/Config.php | 58 ++++++++++++++++++++++++++++++++++--------- system/helpers/url_helper.php | 11 +++++--- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/system/core/Config.php b/system/core/Config.php index da22222dc..554b7360a 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -194,10 +194,7 @@ class CI_Config { // -------------------------------------------------------------------- /** - * Fetch a config file item - adds slash after item - * - * The second parameter allows a slash to be added to the end of - * the item, in the case of a path. + * Fetch a config file item - adds slash after item (if item is not empty) * * @access public * @param string the config item name @@ -210,6 +207,10 @@ class CI_Config { { return FALSE; } + if( trim($this->config[$item]) == '') + { + return ''; + } return rtrim($this->config[$item], '/').'/'; } @@ -218,6 +219,7 @@ class CI_Config { /** * Site URL + * Returns base_url . index_page [. uri_string] * * @access public * @param string the URI string @@ -230,16 +232,50 @@ class CI_Config { return $this->slash_item('base_url').$this->item('index_page'); } + if ($this->item('enable_query_strings') == FALSE) + { + $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); + return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix; + } + else + { + return $this->slash_item('base_url').$this->item('index_page').'?'.$this->_uri_string($uri); + } + } + + // ------------------------------------------------------------- + + /** + * Base URL + * Returns base_url [. uri_string] + * + * @access public + * @param string $uri + * @return string + */ + function base_url($uri = '') + { + return $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/'); + } + + // ------------------------------------------------------------- + + /** + * Build URI string for use in Config::site_url() and Config::base_url() + * + * @access protected + * @param $uri + * @return string + */ + protected function _uri_string($uri) + { if ($this->item('enable_query_strings') == FALSE) { if (is_array($uri)) { $uri = implode('/', $uri); } - - $index = $this->item('index_page') == '' ? '' : $this->slash_item('index_page'); - $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); - return $this->slash_item('base_url').$index.trim($uri, '/').$suffix; + $uri = trim($uri, '/'); } else { @@ -253,16 +289,14 @@ class CI_Config { $str .= $prefix.$key.'='.$val; $i++; } - $uri = $str; } - - return $this->slash_item('base_url').$this->item('index_page').'?'.$uri; } + return $uri; } // -------------------------------------------------------------------- - + /** * System URL * diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index d0516cee6..9f4b85248 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -50,18 +50,21 @@ if ( ! function_exists('site_url')) /** * Base URL - * - * Returns the "base_url" item from your config file + * + * Create a local URL based on your basepath. + * Segments can be passed in as a string or an array, same as site_url + * or a URL to a file can be passed in, e.g. to an image file. * * @access public + * @param string * @return string */ if ( ! function_exists('base_url')) { - function base_url() + function base_url($uri = '') { $CI =& get_instance(); - return $CI->config->slash_item('base_url'); + return $CI->config->base_url($uri); } } -- cgit v1.2.3-24-g4f1b From 76696d76e137e98f0597547b71b40a991d8b025b Mon Sep 17 00:00:00 2001 From: "anaxamaxan@blackdog.local" Date: Wed, 2 Feb 2011 23:09:54 -0800 Subject: Added docs for config->base_url() changes. --- user_guide/helpers/url_helper.html | 16 +++++++++++++++- user_guide/libraries/config.html | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 6d8bdc240..de28a6f56 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -70,7 +70,7 @@ URL Helper

site_url()

Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your -site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.

+site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function, and the url_suffix as set in your config file.

You are encouraged to use this function any time you need to generate a local URL so that your pages become more portable in the event your URL changes.

@@ -93,6 +93,20 @@ echo site_url($segments);

Returns your site base URL, as specified in your config file. Example:

echo base_url(); +

This function returns the same thing as site_url, without the index_page or url_suffix being appended.

+ +

Also like site_url, you can supply segments as a string or an array. Here is a string example:

+ +echo base_url("blog/post/123"); + +

The above example would return something like: http://example.com/blog/post/123

+ +

This is useful because unlike site_url(), you can supply a string to a file, such as an image or stylesheet. For example:

+ +echo base_url("images/icons/edit.png"); + +

This would give you something like: http://example.com/images/icons/edit.png

+

current_url()

Returns the full URL (including segments) of the page being currently viewed.

diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 98b6052a9..103161f5d 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -175,6 +175,11 @@ define('ENVIRONMENT', 'development');

$this->config->site_url();

This function retrieves the URL to your site, along with the "index" value you've specified in the config file.

+

$this->config->base_url();

+

This function retrieves the URL to your site, plus an optional path such as to a stylesheet or image.

+ +

The two functions above are normally accessed via the corresponding functions in the URL Helper.

+

$this->config->system_url();

This function retrieves the URL to your system folder.

-- cgit v1.2.3-24-g4f1b From 84445d08e31c4d538d5a25023b8e5861804a8f14 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 10 Mar 2011 16:43:39 +0000 Subject: Added sqlsrv folder, added necessary files, started altering queries in sqlsrv_driver.php --- system/database/drivers/sqlsrv/index.html | 10 + system/database/drivers/sqlsrv/sqlsrv_driver.php | 664 ++++++++++++++++++++++ system/database/drivers/sqlsrv/sqlsrv_forge.php | 248 ++++++++ system/database/drivers/sqlsrv/sqlsrv_result.php | 169 ++++++ system/database/drivers/sqlsrv/sqlsrv_utility.php | 88 +++ 5 files changed, 1179 insertions(+) create mode 100644 system/database/drivers/sqlsrv/index.html create mode 100644 system/database/drivers/sqlsrv/sqlsrv_driver.php create mode 100644 system/database/drivers/sqlsrv/sqlsrv_forge.php create mode 100644 system/database/drivers/sqlsrv/sqlsrv_result.php create mode 100644 system/database/drivers/sqlsrv/sqlsrv_utility.php diff --git a/system/database/drivers/sqlsrv/index.html b/system/database/drivers/sqlsrv/index.html new file mode 100644 index 000000000..c942a79ce --- /dev/null +++ b/system/database/drivers/sqlsrv/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php new file mode 100644 index 000000000..d64e98108 --- /dev/null +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -0,0 +1,664 @@ +port != '') + { + $this->hostname .= ','.$this->port; + } + + return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 0)); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + if ($this->port != '') + { + $this->hostname .= ','.$this->port; + } + + return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 1)); + } + + // -------------------------------------------------------------------- + + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + // not implemented in MSSQL + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Note: The brackets are required in the event that the DB name + // contains reserved characters + return @mssql_select_db('['.$this->database.']', $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // @todo - add support if needed + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @sqlsrv_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($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) ? TRUE : FALSE; + + $this->simple_query('BEGIN TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @param bool whether or not the string will be used in a LIKE condition + * @return string + */ + 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 single quotes + $str = str_replace("'", "''", remove_invisible_characters($str)); + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = 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 + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mssql_rows_affected($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * Returns the last id created in the Identity column. + * + * @access public + * @return integer + */ + function insert_id() + { + $ver = self::_parse_major_version($this->version()); + $sql = ($ver >= 8 ? "SELECT SCOPE_IDENTITY() AS last_id" : "SELECT @@IDENTITY AS last_id"); + $query = $this->query($sql); + $row = $query->row(); + return $row->last_id; + } + + // -------------------------------------------------------------------- + + /** + * Parse major version + * + * Grabs the major version number from the + * database server version string passed in. + * + * @access private + * @param string $version + * @return int16 major version number + */ + function _parse_major_version($version) + { + preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); + return $ver_info[1]; // return the major version b/c that's all we're interested in. + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT @@VERSION AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + { + return 0; + } + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + { + return 0; + } + + $row = $query->row(); + return (int) $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; + + // for future compatibility + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr); + return FALSE; // not currently supported + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * List column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access private + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT TOP 1 * FROM ".$table; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return sqlsrv_errors(); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + // Are error numbers supported? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return implode(', ', $tables); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * Generates a platform-specific insert string from the supplied data + * + * @access public + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @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 + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach ($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @param string the limit clause + * @return string + */ + function _delete($table, $where = array(), $like = array(), $limit = FALSE) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @param string the sql query string + * @param integer the number of rows to limit the query to + * @param integer the offset value + * @return string + */ + function _limit($sql, $limit, $offset) + { + $i = $limit + $offset; + + return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @sqlsrv_close($conn_id); + } + +} + + + +/* End of file mssql_driver.php */ +/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php new file mode 100644 index 000000000..70b20ecf8 --- /dev/null +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -0,0 +1,248 @@ +db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param array the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + if ($if_not_exists === TRUE) + { + $sql .= 'IF NOT EXISTS '; + } + + $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->_protect_identifiers($field); + + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // 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->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n)"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param boolean should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql; + } + + $sql .= " $column_definition"; + + if ($default_value != '') + { + $sql .= " DEFAULT \"$default_value\""; + } + + if ($null === NULL) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + // I think this syntax will work, but can find little documentation on renaming tables in MSSQL + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + +} + +/* End of file mssql_forge.php */ +/* Location: ./system/database/drivers/mssql/mssql_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php new file mode 100644 index 000000000..2897ca5a5 --- /dev/null +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -0,0 +1,169 @@ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mssql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->max_length = $field->max_length; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + mssql_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mssql_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mssql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mssql_fetch_object($this->result_id); + } + +} + + +/* End of file mssql_result.php */ +/* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php new file mode 100644 index 000000000..48ecbc72a --- /dev/null +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -0,0 +1,88 @@ +db->display_error('db_unsuported_feature'); + } + +} + +/* End of file mssql_utility.php */ +/* Location: ./system/database/drivers/mssql/mssql_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From d8cd2d42f0ba8a93c0a0c049f82d89fe624262a2 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 10 Mar 2011 16:53:59 +0000 Subject: Added README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..8d587fb3c --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +CodeIgniter SQL Server Driver +============================= + +PHP 5.3+ for Windows no longer supports the mssql functions because Microsoft are no longer supporting the underlying libraries used. + +Microsoft have developed a new set of drivers for SQL Server which they have committed to actively develop and support. These drivers can be downloaded here [http://sqlsrvphp.codeplex.com/](http://sqlsrvphp.codeplex.com/ "http://sqlsrvphp.codeplex.com/"). + +This CodeIgniter fork will add support for these new drivers into the framework. -- cgit v1.2.3-24-g4f1b From 7e5127173c61752d827fc0c5bed1166ce040fabf Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 10 Mar 2011 16:55:31 +0000 Subject: Renamed README --- README | 8 ++++++++ README.md | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 README delete mode 100644 README.md diff --git a/README b/README new file mode 100644 index 000000000..8d587fb3c --- /dev/null +++ b/README @@ -0,0 +1,8 @@ +CodeIgniter SQL Server Driver +============================= + +PHP 5.3+ for Windows no longer supports the mssql functions because Microsoft are no longer supporting the underlying libraries used. + +Microsoft have developed a new set of drivers for SQL Server which they have committed to actively develop and support. These drivers can be downloaded here [http://sqlsrvphp.codeplex.com/](http://sqlsrvphp.codeplex.com/ "http://sqlsrvphp.codeplex.com/"). + +This CodeIgniter fork will add support for these new drivers into the framework. diff --git a/README.md b/README.md deleted file mode 100644 index 8d587fb3c..000000000 --- a/README.md +++ /dev/null @@ -1,8 +0,0 @@ -CodeIgniter SQL Server Driver -============================= - -PHP 5.3+ for Windows no longer supports the mssql functions because Microsoft are no longer supporting the underlying libraries used. - -Microsoft have developed a new set of drivers for SQL Server which they have committed to actively develop and support. These drivers can be downloaded here [http://sqlsrvphp.codeplex.com/](http://sqlsrvphp.codeplex.com/ "http://sqlsrvphp.codeplex.com/"). - -This CodeIgniter fork will add support for these new drivers into the framework. -- cgit v1.2.3-24-g4f1b From 079069c2fa70b142fb4313f12f1fdf3f11713ff5 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 10 Mar 2011 19:36:58 +0000 Subject: Think I've finished converting mssql commands to sqlsrv where appropriate --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 4 +--- system/database/drivers/sqlsrv/sqlsrv_result.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index d64e98108..53d974837 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -107,9 +107,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function db_select() { - // Note: The brackets are required in the event that the DB name - // contains reserved characters - return @mssql_select_db('['.$this->database.']', $this->conn_id); + // not implemented in sqlsrv } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 2897ca5a5..058c6f478 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -34,7 +34,7 @@ class CI_DB_mssql_result extends CI_DB_result { */ function num_rows() { - return @mssql_num_rows($this->result_id); + return @sqlsrv_num_rows($this->result_id); } // -------------------------------------------------------------------- @@ -47,7 +47,7 @@ class CI_DB_mssql_result extends CI_DB_result { */ function num_fields() { - return @mssql_num_fields($this->result_id); + return @sqlsrv_num_fields($this->result_id); } // -------------------------------------------------------------------- @@ -63,7 +63,7 @@ class CI_DB_mssql_result extends CI_DB_result { function list_fields() { $field_names = array(); - while ($field = mssql_fetch_field($this->result_id)) + while ($field = sqlsrv_get_field($this->result_id)) { $field_names[] = $field->name; } @@ -84,7 +84,7 @@ class CI_DB_mssql_result extends CI_DB_result { function field_data() { $retval = array(); - while ($field = mssql_fetch_field($this->result_id)) + while ($field = sqlsrv_get_field($this->result_id)) { $F = new stdClass(); $F->name = $field->name; @@ -110,7 +110,7 @@ class CI_DB_mssql_result extends CI_DB_result { { if (is_resource($this->result_id)) { - mssql_free_result($this->result_id); + sqlsrv_free_stmt($this->result_id); $this->result_id = FALSE; } } @@ -129,7 +129,7 @@ class CI_DB_mssql_result extends CI_DB_result { */ function _data_seek($n = 0) { - return mssql_data_seek($this->result_id, $n); + // Not implemented } // -------------------------------------------------------------------- @@ -144,7 +144,7 @@ class CI_DB_mssql_result extends CI_DB_result { */ function _fetch_assoc() { - return mssql_fetch_assoc($this->result_id); + return sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC); } // -------------------------------------------------------------------- @@ -159,7 +159,7 @@ class CI_DB_mssql_result extends CI_DB_result { */ function _fetch_object() { - return mssql_fetch_object($this->result_id); + return sqlsrv_fetch_object($this->result_id); } } -- cgit v1.2.3-24-g4f1b From 5336ee283c764a8f3ef9baa746324d7f6a26499f Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 12 Mar 2011 23:35:29 +0000 Subject: Added flag to return dates as strings instead of PHP date objects. Updated db_select --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 53d974837..25cc628df 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -60,7 +60,7 @@ class CI_DB_mssql_driver extends CI_DB { $this->hostname .= ','.$this->port; } - return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 0)); + return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 0, 'ReturnDatesAsStrings' => 1)); } // -------------------------------------------------------------------- @@ -78,7 +78,7 @@ class CI_DB_mssql_driver extends CI_DB { $this->hostname .= ','.$this->port; } - return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 1)); + return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 1, 'ReturnDatesAsStrings' => 1)); } // -------------------------------------------------------------------- @@ -107,7 +107,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function db_select() { - // not implemented in sqlsrv + return $this->_execute('USE ' . $this->database); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 56e204079b8b3951abca5165ca815b75d37bf03d Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 12 Mar 2011 23:43:54 +0000 Subject: Updated affected_rows --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 25cc628df..e9c391786 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -283,7 +283,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function affected_rows() { - return @mssql_rows_affected($this->conn_id); + return @sqlrv_rows_affected($this->conn_id); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 01ab00469c80a26c22c61f896f0514dfcedccb67 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 18 Mar 2011 19:24:30 +0000 Subject: Renamed some classes in the driver --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 4 ++-- system/database/drivers/sqlsrv/sqlsrv_forge.php | 4 ++-- system/database/drivers/sqlsrv/sqlsrv_result.php | 4 ++-- system/database/drivers/sqlsrv/sqlsrv_utility.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index e9c391786..116907123 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ /** - * MS SQL Database Adapter Class + * SQLSRV Database Adapter Class * * Note: _DB is an extender class that the app controller * creates dynamically based on whether the active record @@ -28,7 +28,7 @@ * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_mssql_driver extends CI_DB { +class CI_DB_sqlsrv_driver extends CI_DB { var $dbdriver = 'sqlsrv'; diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index 70b20ecf8..cc88ec5ca 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -16,13 +16,13 @@ // ------------------------------------------------------------------------ /** - * MS SQL Forge Class + * SQLSRV Forge Class * * @category Database * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_mssql_forge extends CI_DB_forge { +class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Create database diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 058c6f478..458200383 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ /** - * MS SQL Result Class + * SQLSRV Result Class * * This class extends the parent result class: CI_DB_result * @@ -24,7 +24,7 @@ * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_mssql_result extends CI_DB_result { +class CI_DB_sqlsrv_result extends CI_DB_result { /** * Number of rows in the result set diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 48ecbc72a..13a1850c4 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -16,13 +16,13 @@ // ------------------------------------------------------------------------ /** - * MS SQL Utility Class + * SQLSRV Utility Class * * @category Database * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_mssql_utility extends CI_DB_utility { +class CI_DB_sqlsrv_utility extends CI_DB_utility { /** * List databases -- cgit v1.2.3-24-g4f1b From 3a43c7adae7737d68a0eeca663cc2dd3fc5b0cf3 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 18 Mar 2011 19:48:04 +0000 Subject: Updates --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 206 ++++++++--------------- system/database/drivers/sqlsrv/sqlsrv_result.php | 20 +-- 2 files changed, 81 insertions(+), 145 deletions(-) diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 116907123..1d32792ce 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -53,14 +53,27 @@ class CI_DB_sqlsrv_driver extends CI_DB { * @access private called by the base class * @return resource */ - function db_connect() + function db_connect($pooling = false) { - if ($this->port != '') - { - $this->hostname .= ','.$this->port; + // Check for a UTF-8 charset being passed as CI's default 'utf8'. + $character_set = (0 === strcasecmp('utf8', $this->char_set)) ? 'UTF-8' : $this->char_set; + + $connection = array( + 'UID' => empty($this->username) ? '' : $this->username, + 'PWD' => empty($this->password) ? '' : $this->password, + 'Database' => $this->database, + 'ConnectionPooling' => $pooling ? 1 : 0, + 'CharacterSet' => $character_set, + 'ReturnDatesAsStrings' => 1 + ); + + // If the username and password are both empty, assume this is a + // 'Windows Authentication Mode' connection. + if(empty($connection['UID']) && empty($connection['PWD'])) { + unset($connection['UID'], $connection['PWD']); } - return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 0, 'ReturnDatesAsStrings' => 1)); + return sqlsrv_connect($this->hostname, $connection); } // -------------------------------------------------------------------- @@ -73,12 +86,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function db_pconnect() { - if ($this->port != '') - { - $this->hostname .= ','.$this->port; - } - - return @sqlsrv_connect($this->hostname, array('UID' => $this->username, 'PWD' => $this->password, 'Database' => $this->database, 'ConnectionPooling' => 1, 'ReturnDatesAsStrings' => 1)); + $this->db_connect(TRUE); } // -------------------------------------------------------------------- @@ -138,7 +146,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { function _execute($sql) { $sql = $this->_prep_query($sql); - return @sqlsrv_query($this->conn_id, $sql); + return sqlsrv_query($this->conn_id, $sql, null, array( + 'Scrollable' => SQLSRV_CURSOR_STATIC, + 'SendStreamParamsAtExec' => true + )); } // -------------------------------------------------------------------- @@ -183,8 +194,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; - $this->simple_query('BEGIN TRAN'); - return TRUE; + return sqlsrv_begin_transaction($this->conn_id); } // -------------------------------------------------------------------- @@ -208,8 +218,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { return TRUE; } - $this->simple_query('COMMIT TRAN'); - return TRUE; + return sqlsrv_commit($this->conn_id); } // -------------------------------------------------------------------- @@ -233,8 +242,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { return TRUE; } - $this->simple_query('ROLLBACK TRAN'); - return TRUE; + return sqlsrv_rollback($this->conn_id); } // -------------------------------------------------------------------- @@ -249,28 +257,8 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ 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 single quotes - $str = str_replace("'", "''", remove_invisible_characters($str)); - - // escape LIKE condition wildcards - if ($like === TRUE) - { - $str = 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; + return str_replace("'", "''", $str); } // -------------------------------------------------------------------- @@ -298,11 +286,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function insert_id() { - $ver = self::_parse_major_version($this->version()); - $sql = ($ver >= 8 ? "SELECT SCOPE_IDENTITY() AS last_id" : "SELECT @@IDENTITY AS last_id"); - $query = $this->query($sql); - $row = $query->row(); - return $row->last_id; + return $this->query('select @@IDENTITY as insert_id')->row('insert_id'); } // -------------------------------------------------------------------- @@ -333,7 +317,8 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _version() { - return "SELECT @@VERSION AS ver"; + $info = sqlsrv_server_info($this->conn_id); + return sprintf("select '%s' as ver", $info['SQLServerVersion']); } // -------------------------------------------------------------------- @@ -351,19 +336,15 @@ class CI_DB_sqlsrv_driver extends CI_DB { function count_all($table = '') { if ($table == '') - { - return 0; - } - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM " . $this->dbprefix . $table); + if ($query->num_rows() == 0) - { - return 0; - } + return '0'; $row = $query->row(); - return (int) $row->numrows; + return $row->numrows; } // -------------------------------------------------------------------- @@ -379,16 +360,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _list_tables($prefix_limit = FALSE) { - $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; - - // for future compatibility - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr); - return FALSE; // not currently supported - } - - return $sql; + return "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; } // -------------------------------------------------------------------- @@ -404,7 +376,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _list_columns($table = '') { - return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; + return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->_escape_table($table)."'"; } // -------------------------------------------------------------------- @@ -420,7 +392,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _field_data($table) { - return "SELECT TOP 1 * FROM ".$table; + return "SELECT TOP 1 * FROM " . $this->_escape_table($table); } // -------------------------------------------------------------------- @@ -433,7 +405,8 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _error_message() { - return sqlsrv_errors(); + $error = array_shift(sqlsrv_errors()); + return !empty($error['message']) ? $error['message'] : null; } // -------------------------------------------------------------------- @@ -446,12 +419,28 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _error_number() { - // Are error numbers supported? - return ''; + $error = array_shift(sqlsrv_errors()); + return isset($error['SQLSTATE']) ? $error['SQLSTATE'] : null; } // -------------------------------------------------------------------- + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + return $table; + } + + /** * Escape the SQL Identifiers * @@ -463,33 +452,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _escape_identifiers($item) { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + return $item; } // -------------------------------------------------------------------- @@ -528,8 +491,8 @@ class CI_DB_sqlsrv_driver extends CI_DB { * @return string */ function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -547,27 +510,16 @@ class CI_DB_sqlsrv_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + function _update($table, $values, $where) { - foreach ($values as $key => $val) + foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); } - - + // -------------------------------------------------------------------- /** @@ -599,25 +551,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { * @param string the limit clause * @return string */ - function _delete($table, $where = array(), $like = array(), $limit = FALSE) + function _delete($table, $where) { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); } // -------------------------------------------------------------------- @@ -636,8 +572,8 @@ class CI_DB_sqlsrv_driver extends CI_DB { function _limit($sql, $limit, $offset) { $i = $limit + $offset; - - return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); + + return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 458200383..bf0abd1c6 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -63,11 +63,11 @@ class CI_DB_sqlsrv_result extends CI_DB_result { function list_fields() { $field_names = array(); - while ($field = sqlsrv_get_field($this->result_id)) + foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) { - $field_names[] = $field->name; + $field_names[] = $field['Name']; } - + return $field_names; } @@ -84,18 +84,18 @@ class CI_DB_sqlsrv_result extends CI_DB_result { function field_data() { $retval = array(); - while ($field = sqlsrv_get_field($this->result_id)) + foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->max_length = $field->max_length; + $F = new stdClass(); + $F->name = $field['Name']; + $F->type = $field['Type']; + $F->max_length = $field['Size']; $F->primary_key = 0; $F->default = ''; - + $retval[] = $F; } - + return $retval; } -- cgit v1.2.3-24-g4f1b From 1f6f0abf0d17046a99fd9c9b3c60fb459b4531b1 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 7 Apr 2011 18:24:53 -0500 Subject: Fixing a bug in the form_helper where csrf_token_name and csrf_hash were referencing class properties in the Security class that were moved. --- system/helpers/form_helper.php | 2 +- user_guide/installation/upgrade_202.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8aa788c6c..acd75c239 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -67,7 +67,7 @@ if ( ! function_exists('form_open')) // CSRF if ($CI->config->item('csrf_protection') === TRUE) { - $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash; + $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } if (is_array($hidden) AND count($hidden) > 0) diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html index e6273f53c..d457d8bbb 100644 --- a/user_guide/installation/upgrade_202.html +++ b/user_guide/installation/upgrade_202.html @@ -76,6 +76,8 @@ Upgrading from 2.0.1 to 2.0.2

If you are overriding or extending the Security library, you will need to move it to application/core.

+

csrf_token_name and csrf_hash have changed to protected class properties. Please use security->get_csrf_hash() and security->get_csrf_token_name() to access those values.

+ -- cgit v1.2.3-24-g4f1b From bfbcf74c94a47c643420efaa342cc525bce2ad2c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 7 Apr 2011 18:33:29 -0500 Subject: Fix: #192 CI version constant incorrect in core/CodeIgniter --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f3e1439ff..e022e1b46 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -32,7 +32,7 @@ * Define the CodeIgniter Version * ------------------------------------------------------ */ - define('CI_VERSION', '2.0.1'); + define('CI_VERSION', '2.0.2'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From a439fb57decf98b5b630479e7ef5dc4e7f3360c9 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 8 Apr 2011 12:42:56 +0100 Subject: Updated Changelog to reflect "CLI usage" documentation being added. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d34f5c8f0..32f9ec84f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -73,6 +73,7 @@ Hg Tag: n/a

  • Made Environment Support optional. Comment out or delete the constant to stop environment checks.
  • Added Environment Support for Hooks.
  • Added CI_ Prefix to the Cache driver.
  • +
  • Added CLI usage documentation.
  • Helpers -- cgit v1.2.3-24-g4f1b From b70e32ffae21c6a7ae4d21f2991a47f28531676f Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 8 Apr 2011 12:44:17 +0100 Subject: Fixed bug with form_helper calling now protected variables. --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8aa788c6c..acd75c239 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -67,7 +67,7 @@ if ( ! function_exists('form_open')) // CSRF if ($CI->config->item('csrf_protection') === TRUE) { - $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash; + $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } if (is_array($hidden) AND count($hidden) > 0) -- cgit v1.2.3-24-g4f1b From 48bac74ea9fcb8eecdf97597647f1ed492d97b43 Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 13:46:47 +0200 Subject: Fix: codeigniter-reactor/193 incorrect driver filepaths --- system/libraries/Driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index d1838f2c1..b942f539f 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -45,7 +45,7 @@ class CI_Driver_Library { $child_class = $this->lib_name.'_'.$child; // Remove the CI_ prefix and lowercase - $lib_name = strtolower(preg_replace('/^CI_/', '', $this->lib_name)); + $lib_name = ucfirst(strtolower(preg_replace('/^CI_/', '', $this->lib_name))); $driver_name = strtolower(preg_replace('/^CI_/', '', $child_class)); if (in_array($driver_name, array_map('strtolower', $this->valid_drivers))) @@ -226,4 +226,4 @@ class CI_Driver { // END CI_Driver CLASS /* End of file Driver.php */ -/* Location: ./system/libraries/Driver.php */ \ No newline at end of file +/* Location: ./system/libraries/Driver.php */ -- cgit v1.2.3-24-g4f1b From b07079827b084213463bdf576894faab172213f2 Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 15:10:05 +0200 Subject: Deals with language errors after codeigniter-reactor commit r2307:c43c6dea56fb --- system/libraries/Email.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 6c21f114d..cd89f8f3d 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -722,7 +722,7 @@ class CI_Email { { if ( ! is_array($email)) { - $this->_set_error_message('email_must_be_array'); + $this->_set_error_message('lang:email_must_be_array'); return FALSE; } @@ -730,7 +730,7 @@ class CI_Email { { if ( ! $this->valid_email($val)) { - $this->_set_error_message('email_invalid_address', $val); + $this->_set_error_message('lang:email_invalid_address', $val); return FALSE; } } @@ -1131,7 +1131,7 @@ class CI_Email { if ( ! file_exists($filename)) { - $this->_set_error_message('email_attachment_missing', $filename); + $this->_set_error_message('lang:email_attachment_missing', $filename); return FALSE; } @@ -1146,7 +1146,7 @@ class CI_Email { if ( ! $fp = fopen($filename, FOPEN_READ)) { - $this->_set_error_message('email_attachment_unreadable', $filename); + $this->_set_error_message('lang:email_attachment_unreadable', $filename); return FALSE; } @@ -1353,7 +1353,7 @@ class CI_Email { ( ! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND ( ! isset($this->_headers['Cc']))) { - $this->_set_error_message('email_no_recipients'); + $this->_set_error_message('lang:email_no_recipients'); return FALSE; } @@ -1484,7 +1484,7 @@ class CI_Email { if ( ! $this->_send_with_mail()) { - $this->_set_error_message('email_send_failure_phpmail'); + $this->_set_error_message('lang:email_send_failure_phpmail'); return FALSE; } break; @@ -1492,7 +1492,7 @@ class CI_Email { if ( ! $this->_send_with_sendmail()) { - $this->_set_error_message('email_send_failure_sendmail'); + $this->_set_error_message('lang:email_send_failure_sendmail'); return FALSE; } break; @@ -1500,14 +1500,14 @@ class CI_Email { if ( ! $this->_send_with_smtp()) { - $this->_set_error_message('email_send_failure_smtp'); + $this->_set_error_message('lang:email_send_failure_smtp'); return FALSE; } break; } - $this->_set_error_message('email_sent', $this->_get_protocol()); + $this->_set_error_message('lang:email_sent', $this->_get_protocol()); return TRUE; } @@ -1578,8 +1578,8 @@ class CI_Email { if ($status != 0) { - $this->_set_error_message('email_exit_status', $status); - $this->_set_error_message('email_no_socket'); + $this->_set_error_message('lang:email_exit_status', $status); + $this->_set_error_message('lang:email_no_socket'); return FALSE; } @@ -1598,7 +1598,7 @@ class CI_Email { { if ($this->smtp_host == '') { - $this->_set_error_message('email_no_hostname'); + $this->_set_error_message('lang:email_no_hostname'); return FALSE; } @@ -1647,7 +1647,7 @@ class CI_Email { if (strncmp($reply, '250', 3) != 0) { - $this->_set_error_message('email_smtp_error', $reply); + $this->_set_error_message('lang:email_smtp_error', $reply); return FALSE; } @@ -1674,7 +1674,7 @@ class CI_Email { if ( ! is_resource($this->_smtp_connect)) { - $this->_set_error_message('email_smtp_error', $errno." ".$errstr); + $this->_set_error_message('lang:email_smtp_error', $errno." ".$errstr); return FALSE; } @@ -1737,7 +1737,7 @@ class CI_Email { if (substr($reply, 0, 3) != $resp) { - $this->_set_error_message('email_smtp_error', $reply); + $this->_set_error_message('lang:email_smtp_error', $reply); return FALSE; } @@ -1766,7 +1766,7 @@ class CI_Email { if ($this->smtp_user == "" AND $this->smtp_pass == "") { - $this->_set_error_message('email_no_smtp_unpw'); + $this->_set_error_message('lang:email_no_smtp_unpw'); return FALSE; } @@ -1776,7 +1776,7 @@ class CI_Email { if (strncmp($reply, '334', 3) != 0) { - $this->_set_error_message('email_failed_smtp_login', $reply); + $this->_set_error_message('lang:email_failed_smtp_login', $reply); return FALSE; } @@ -1786,7 +1786,7 @@ class CI_Email { if (strncmp($reply, '334', 3) != 0) { - $this->_set_error_message('email_smtp_auth_un', $reply); + $this->_set_error_message('lang:email_smtp_auth_un', $reply); return FALSE; } @@ -1796,7 +1796,7 @@ class CI_Email { if (strncmp($reply, '235', 3) != 0) { - $this->_set_error_message('email_smtp_auth_pw', $reply); + $this->_set_error_message('lang:email_smtp_auth_pw', $reply); return FALSE; } @@ -1815,7 +1815,7 @@ class CI_Email { { if ( ! fwrite($this->_smtp_connect, $data . $this->newline)) { - $this->_set_error_message('email_smtp_data_failure', $data); + $this->_set_error_message('lang:email_smtp_data_failure', $data); return FALSE; } else @@ -1942,7 +1942,7 @@ class CI_Email { $CI =& get_instance(); $CI->lang->load('email'); - if (FALSE === ($line = $CI->lang->line($msg))) + if (substr($msg, 0, 5) != 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5)))) { $this->_debug_msg[] = str_replace('%s', $val, $msg)."
    "; } @@ -2059,4 +2059,4 @@ class CI_Email { // END CI_Email class /* End of file Email.php */ -/* Location: ./system/libraries/Email.php */ \ No newline at end of file +/* Location: ./system/libraries/Email.php */ -- cgit v1.2.3-24-g4f1b From 64e35cdcb9fd24787798c0f6ca3c0af45b0b904d Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 15:25:31 +0200 Subject: There is absolutely no need to specify class name (it will validate anyway). --- system/helpers/form_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index acd75c239..bca0ff0c9 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -72,7 +72,7 @@ if ( ! function_exists('form_open')) if (is_array($hidden) AND count($hidden) > 0) { - $form .= sprintf("\n
    %s
    ", form_hidden($hidden)); + $form .= sprintf("\n
    %s
    ", form_hidden($hidden)); } return $form; @@ -1053,4 +1053,4 @@ if ( ! function_exists('_get_validation_object')) /* End of file form_helper.php */ -/* Location: ./system/helpers/form_helper.php */ \ No newline at end of file +/* Location: ./system/helpers/form_helper.php */ -- cgit v1.2.3-24-g4f1b From 02404a1f59e4f3ae8231d87d8be5b23488ea86d2 Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 15:45:46 +0200 Subject: Fix: codeigniter-reactor/127 Form_validation rule error logging --- system/libraries/Form_validation.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index cfc02eda9..6f79a554a 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -628,6 +628,10 @@ class CI_Form_validation { $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; } } + else + { + log_message('debug', "Unable to find validation rule: ".$rule); + } continue; } @@ -1357,4 +1361,4 @@ class CI_Form_validation { // END Form Validation Class /* End of file Form_validation.php */ -/* Location: ./system/libraries/Form_validation.php */ \ No newline at end of file +/* Location: ./system/libraries/Form_validation.php */ -- cgit v1.2.3-24-g4f1b From ef1a55ad2875af3b2286a5b6eb9b65e997949f4d Mon Sep 17 00:00:00 2001 From: patwork Date: Sat, 9 Apr 2011 13:04:06 +0200 Subject: Fix: codeigniter-reactor/199 CSRF config in Security class is no longer ignored --- system/core/Security.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/system/core/Security.php b/system/core/Security.php index ceef9779c..73a3cfb31 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -58,6 +58,15 @@ class CI_Security { */ public function __construct() { + // CSRF config + foreach(array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key) + { + if (FALSE !== ($val = config_item($key))) + { + $this->{'_'.$key} = $val; + } + } + // Append application specific cookie prefix to token name $this->_csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->_csrf_token_name : $this->_csrf_token_name; @@ -817,4 +826,4 @@ class CI_Security { // END Security Class /* End of file Security.php */ -/* Location: ./system/libraries/Security.php */ \ No newline at end of file +/* Location: ./system/libraries/Security.php */ -- cgit v1.2.3-24-g4f1b From 571023b24f705d9c0bbaecf2e3cbbc06752390b4 Mon Sep 17 00:00:00 2001 From: patwork Date: Mon, 11 Apr 2011 11:56:41 +0200 Subject: Fix: codeigniter-reactor/32 unicorns are no longer mute --- system/core/Lang.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/core/Lang.php b/system/core/Lang.php index 0b926a303..cdadc7f41 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -129,19 +129,19 @@ class CI_Lang { */ function line($line = '') { - $line = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; + $value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; // Because killer robots like unicorns! - if ($line === FALSE) + if ($value === FALSE) { log_message('error', 'Could not find the language line "'.$line.'"'); } - return $line; + return $value; } } // END Language Class /* End of file Lang.php */ -/* Location: ./system/core/Lang.php */ \ No newline at end of file +/* Location: ./system/core/Lang.php */ -- cgit v1.2.3-24-g4f1b From 9e2679849611ce050f5636c44b6c3279328d00f9 Mon Sep 17 00:00:00 2001 From: patwork Date: Mon, 11 Apr 2011 13:02:32 +0200 Subject: Fix: codeigniter-reactor/199 cookie name was overwritten with token name --- system/core/Security.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/core/Security.php b/system/core/Security.php index 73a3cfb31..4f91572ed 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -67,8 +67,10 @@ class CI_Security { } } - // Append application specific cookie prefix to token name - $this->_csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->_csrf_token_name : $this->_csrf_token_name; + // Append application specific cookie prefix + if (config_item('cookie_prefix')) { + $this->_csrf_cookie_name = config_item('cookie_prefix').$this->_csrf_cookie_name; + } // Set the CSRF hash $this->_csrf_set_hash(); -- cgit v1.2.3-24-g4f1b From e70e92bab1de57a0749a31f2889b55cafb46d58e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 25 Apr 2011 10:50:53 -0500 Subject: Fixing up a tabs vs spaces inconsistency in DB_Result --- system/database/DB_result.php | 83 +++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 06eec5124..e83228386 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -32,7 +32,7 @@ class CI_DB_result { var $result_id = NULL; var $result_array = array(); var $result_object = array(); - var $custom_result_object = array(); + var $custom_result_object = array(); var $current_row = 0; var $num_rows = 0; var $row_data = NULL; @@ -47,47 +47,52 @@ class CI_DB_result { */ function result($type = 'object') { - if ($type == 'array') return $this->result_array(); - else if ($type == 'object') return $this->result_object(); - else return $this->custom_result_object($type); + if ($type == 'array') return $this->result_array(); + else if ($type == 'object') return $this->result_object(); + else return $this->custom_result_object($type); } // -------------------------------------------------------------------- - /** - * Custom query result. - * - * @param class_name A string that represents the type of object you want back - * @return array of objects - */ - function custom_result_object($class_name) - { - if (array_key_exists($class_name, $this->custom_result_object)) - { - return $this->custom_result_object[$class_name]; - } - - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - // add the data to the object - $this->_data_seek(0); - $result_object = array(); + /** + * Custom query result. + * + * @param class_name A string that represents the type of object you want back + * @return array of objects + */ + function custom_result_object($class_name) + { + if (array_key_exists($class_name, $this->custom_result_object)) + { + return $this->custom_result_object[$class_name]; + } + + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + // add the data to the object + $this->_data_seek(0); + $result_object = array(); + while ($row = $this->_fetch_object()) - { - $object = new $class_name(); - foreach ($row as $key => $value) - { - $object->$key = $value; - } + { + $object = new $class_name(); + + foreach ($row as $key => $value) + { + $object->$key = $value; + } + $result_object[] = $object; } - // return the array - return $this->custom_result_object[$class_name] = $result_object; - } + // return the array + return $this->custom_result_object[$class_name] = $result_object; + } + + // -------------------------------------------------------------------- /** * Query result. "object" version. @@ -180,9 +185,9 @@ class CI_DB_result { $n = 0; } - if ($type == 'object') return $this->row_object($n); - else if ($type == 'array') return $this->row_array($n); - else return $this->custom_row_object($n, $type); + if ($type == 'object') return $this->row_object($n); + else if ($type == 'array') return $this->row_array($n); + else return $this->custom_row_object($n, $type); } // -------------------------------------------------------------------- @@ -219,7 +224,7 @@ class CI_DB_result { // -------------------------------------------------------------------- - /** + /** * Returns a single result row - custom object version * * @access public @@ -242,7 +247,7 @@ class CI_DB_result { return $result[$this->current_row]; } - /** + /** * Returns a single result row - object version * * @access public -- cgit v1.2.3-24-g4f1b From db60d240226468b19d656c4ba026bc992e4c3034 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:31:30 +0900 Subject: add "Using CodeIgniter Drivers" and "Creating Your Own Driver" in TOC --- user_guide/nav/nav.js | 2 ++ user_guide/toc.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index ce783fc27..b44994d4d 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -50,6 +50,8 @@ function create_menu(basepath) '
  • Helpers
  • ' + '
  • Using CodeIgniter Libraries
  • ' + '
  • Creating Your Own Libraries
  • ' + + '
  • Using CodeIgniter Drivers
  • ' + + '
  • Creating Your Own Drivers
  • ' + '
  • Creating Core Classes
  • ' + '
  • Hooks - Extending the Core
  • ' + '
  • Auto-loading Resources
  • ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 4b4ab1001..f6a5fe0ec 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -103,6 +103,8 @@ Table of Contents
  • Helpers
  • Using CodeIgniter Libraries
  • Creating Your Own Libraries
  • +
  • Using CodeIgniter Drivers
  • +
  • Creating Your Own Drivers
  • Creating Core Classes
  • Hooks - Extending the Core
  • Auto-loading Resources
  • -- cgit v1.2.3-24-g4f1b From e7bdd2260e6be61d3ed37e517f35ba017beee5f3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:33:53 +0900 Subject: update Prev/Next Topic link on user_guide/database/index.html --- user_guide/database/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 594de80dd..1f0a1da7d 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -86,7 +86,7 @@ structures and Active Record patterns. The database functions offer clear, simpl -- cgit v1.2.3-24-g4f1b From 4c6ceb067ca15228c547770354023f826f552036 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:35:43 +0900 Subject: update Prev/Next Topic link on user_guide/helpers/array_helper.html --- user_guide/helpers/array_helper.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 88e8384d5..139bbe2b5 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -159,10 +159,10 @@ $this->post_model->update(elements(array('id', 'title', 'content'), $_POST)); -- cgit v1.2.3-24-g4f1b From 33095c29a638c127928faa5b0360abd3ac5254f9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:36:10 +0900 Subject: update Prev/Next Topic link on user_guide/helpers/captcha_helper.html --- user_guide/helpers/captcha_helper.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 3c6fa1188..c80c2fbe5 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -183,11 +183,11 @@ if ($row->count == 0)
    -- cgit v1.2.3-24-g4f1b From 49e31258bc85245b087d6b7b5ac02edb1b680bc6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:37:15 +0900 Subject: update Prev/Next Topic link on user_guide/helpers/cookie_helper.html --- user_guide/helpers/cookie_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 9879653c1..889c3346e 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -95,7 +95,7 @@ of values in the first parameter or you can set discrete parameters.

    -- cgit v1.2.3-24-g4f1b From 26eebddda5438c3967bad74a05c3e990528e1182 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 17 Apr 2011 23:45:41 -0400 Subject: Changed server check to ensure SCRIPT_NAME is defined. Fixes #57 --- system/core/URI.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/core/URI.php b/system/core/URI.php index 80dc62e58..d56548654 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -120,7 +120,7 @@ class CI_URI { $path = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); $this->_set_uri_string($path); } - + // -------------------------------------------------------------------- /** @@ -133,7 +133,7 @@ class CI_URI { { // Filter out control characters $str = remove_invisible_characters($str, FALSE); - + // If the URI contains only a slash we'll kill it $this->uri_string = ($str == '/') ? '' : $str; } @@ -151,7 +151,7 @@ class CI_URI { */ private function _detect_uri() { - if ( ! isset($_SERVER['REQUEST_URI'])) + if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME'])) { return ''; } @@ -184,12 +184,12 @@ class CI_URI { $_SERVER['QUERY_STRING'] = ''; $_GET = array(); } - + if ($uri == '/' || empty($uri)) { return '/'; } - + $uri = parse_url($uri, PHP_URL_PATH); // Do some final cleaning of the URI and return it -- cgit v1.2.3-24-g4f1b From c31b3729da50eaade365451f49dac7d462684702 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 17 Apr 2011 23:58:40 -0400 Subject: Added ENVIRONMENT to reserved constants. Fixes #196 --- user_guide/changelog.html | 17 +++++++++++++++++ user_guide/general/reserved_names.html | 1 + 2 files changed, 18 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f24d8110c..0ebe74ae6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -59,6 +59,23 @@ Change Log

    The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

    +

    Version 2.0.3

    +

    Release Date: Not Released

    + +
      +
    • General Changes +
        +
      • +
      +
    • +
    + +

    Bug fixes for 2.0.3

    +
      +
    • Added ENVIRONMENT to reserved constants. (Reactor #196)
    • +
    • Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
    • +
    +

    Version 2.0.2

    Release Date: April 7, 2011
    Hg Tag: v2.0.2

    diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index d1ee2955b..00bebff61 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -90,6 +90,7 @@ is a list of reserved names. Do not name your controller any of these:

    Constants

      +
    • ENVIRONMENT
    • EXT
    • FCPATH
    • SELF
    • -- cgit v1.2.3-24-g4f1b From bffb7769c6f31b7a47355d4eb66f5ac1d85c2a2e Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Mon, 18 Apr 2011 00:03:31 -0400 Subject: Changed path in footer comment of cache dummy. --- system/libraries/Cache/drivers/Cache_dummy.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index de47acb43..f96a68e27 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -10,29 +10,29 @@ * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 - * @filesource + * @filesource */ // ------------------------------------------------------------------------ /** - * CodeIgniter Dummy Caching Class + * CodeIgniter Dummy Caching Class * * @package CodeIgniter * @subpackage Libraries * @category Core * @author ExpressionEngine Dev Team - * @link + * @link */ class CI_Cache_dummy extends CI_Driver { /** - * Get + * Get * * Since this is the dummy class, it's always going to return FALSE. * - * @param string + * @param string * @return Boolean FALSE */ public function get($id) @@ -40,8 +40,8 @@ class CI_Cache_dummy extends CI_Driver { return FALSE; } - // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ + /** * Cache Save * @@ -55,7 +55,7 @@ class CI_Cache_dummy extends CI_Driver { { return TRUE; } - + // ------------------------------------------------------------------------ /** @@ -112,7 +112,7 @@ class CI_Cache_dummy extends CI_Driver { /** * Is this caching driver supported on the system? * Of course this one is. - * + * * @return TRUE; */ public function is_supported() @@ -121,9 +121,9 @@ class CI_Cache_dummy extends CI_Driver { } // ------------------------------------------------------------------------ - + } // End Class -/* End of file Cache_apc.php */ -/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ \ No newline at end of file +/* End of file Cache_dummy.php */ +/* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 826429cf40a9624788b92d2e6e4b7659e1b0d8a1 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 09:40:19 -0500 Subject: Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag. --- system/helpers/html_helper.php | 5 +++-- user_guide/changelog.html | 5 +++++ user_guide/helpers/html_helper.html | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index c6103ab6f..a29204391 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -40,9 +40,10 @@ */ if ( ! function_exists('heading')) { - function heading($data = '', $h = '1') + function heading($data = '', $h = '1', $attributes = '') { - return "".$data.""; + $attributes = ($attributes != '') ? ' '.$attributes : $attributes; + return "".$data.""; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0ebe74ae6..0afc5b822 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,11 @@ Change Log
    +
  • Helpers +
      +
    • Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
    • +
    +
  • Bug fixes for 2.0.3

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 1a0529f7b..308013d51 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -89,6 +89,11 @@ second the size of the heading. Example:

    echo heading('Welcome!', 3);

    The above would produce: <h3>Welcome!</h3>

    +

    Additionally, in order to add attributes to the heading tag such as HTML classes, ids or inline styles, a third parameter is available.

    +echo heading('Welcome!', 3, 'class="pink"') +

    The above code produces: <h3 class="pink">Welcome!<<h3>

    + +

    img()

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    echo img('images/picture.jpg');
    -- cgit v1.2.3-24-g4f1b From 62df13125bd9ab22ff0c7f2565a42a6de13ed7e4 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 11:18:02 -0500 Subject: Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables. --- system/language/english/profiler_lang.php | 3 +++ system/libraries/Profiler.php | 45 ++++++++++++++++++++++++++----- user_guide/changelog.html | 2 +- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php index b6460fb83..1111158c8 100644 --- a/system/language/english/profiler_lang.php +++ b/system/language/english/profiler_lang.php @@ -9,6 +9,7 @@ $lang['profiler_post_data'] = 'POST DATA'; $lang['profiler_uri_string'] = 'URI STRING'; $lang['profiler_memory_usage'] = 'MEMORY USAGE'; $lang['profiler_config'] = 'CONFIG VARIABLES'; +$lang['profiler_session_data'] = 'SESSION DATA'; $lang['profiler_headers'] = 'HTTP HEADERS'; $lang['profiler_no_db'] = 'Database driver is not currently loaded'; $lang['profiler_no_queries'] = 'No queries were run'; @@ -17,6 +18,8 @@ $lang['profiler_no_get'] = 'No GET data exists'; $lang['profiler_no_uri'] = 'No URI data exists'; $lang['profiler_no_memory'] = 'Memory Usage Unavailable'; $lang['profiler_no_profiles'] = 'No Profile data - all Profiler sections have been disabled.'; +$lang['profiler_section_hide'] = 'Hide'; +$lang['profiler_section_show'] = 'Show'; /* End of file profiler_lang.php */ /* Location: ./system/language/english/profiler_lang.php */ \ No newline at end of file diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 8a1f18ced..d1828b984 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -32,7 +32,7 @@ */ class CI_Profiler { - var $CI; + private $CI; protected $_available_sections = array( 'benchmarks', @@ -43,6 +43,7 @@ class CI_Profiler { 'controller_info', 'queries', 'http_headers', + 'session_data', 'config' ); @@ -410,10 +411,10 @@ class CI_Profiler { $output = "\n\n"; $output .= '
    '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_headers').'  '; + $output .= '  '.$this->CI->lang->line('profiler_headers').'  ('.$this->CI->lang->line('profiler_section_show').')'; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
    \n"; foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { @@ -441,10 +442,10 @@ class CI_Profiler { $output = "\n\n"; $output .= '
    '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_config').'  '; + $output .= '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')'; $output .= "\n"; - $output .= "\n\n
    \n"; + $output .= "\n\n
    \n"; foreach ($this->CI->config->config as $config=>$val) { @@ -464,6 +465,39 @@ class CI_Profiler { // -------------------------------------------------------------------- + /** + * Compile session userdata + * + * @return string + */ + private function _compile_session_data() + { + if ( ! isset($this->CI->session)) + { + return; + } + + $output = '
    '; + $output .= '  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')'; + $output .= "
    "; + + foreach ($this->CI->session->all_userdata() as $key => $val) + { + if (is_array($val)) + { + $val = print_r($val, TRUE); + } + + $output .= "\n"; + } + + $output .= ''; + $output .= "
    "; + return $output; + } + + // -------------------------------------------------------------------- + /** * Run the Profiler * @@ -493,7 +527,6 @@ class CI_Profiler { return $output; } - } // END CI_Profiler class diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0afc5b822..9890f602c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,7 +65,7 @@ Change Log
    • General Changes
        -
      • +
      • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
    • Helpers -- cgit v1.2.3-24-g4f1b From 3403366d0f457c1dd449076b4177d1aff5cb176c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 11:18:09 -0500 Subject: changeset: 2202:06a75a1bd622 tag: tip user: Greg Aker date: Mon Apr 18 11:10:37 2011 -0500 summary: Tweak to session class all_userdata() to just return the userdata array. Also documented previously undocumented all_userdata() method. --- system/libraries/Session.php | 4 ++-- user_guide/libraries/sessions.html | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 182294059..32317c2e6 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -435,11 +435,11 @@ class CI_Session { * Fetch all session data * * @access public - * @return mixed + * @return array */ function all_userdata() { - return ( ! isset($this->userdata)) ? FALSE : $this->userdata; + return $this->userdata; } // -------------------------------------------------------------------- diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 600d301c9..8d9c14eb6 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -170,6 +170,23 @@ having to run a database query when you need it.

      Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

      +

      Retrieving All Session Data

      +

      An array of all userdata can be retrieved as follows:

      +$this->session->all_userdata() + +

      And returns an associative array like the following:

      + +
      +Array
      +(
      +    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
      +    [ip_address] => 127.0.0.1
      +    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
      +    [last_activity] => 1303142623
      +)
      +
      + +

      Removing Session Data

      Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

      $this->session->unset_userdata('some_name');

      -- cgit v1.2.3-24-g4f1b From e6e6e64ab078205153513af24dd4163157efb148 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 15:54:13 -0500 Subject: changeset: 2204:37301a84c8be tag: tip user: Greg Aker date: Mon Apr 18 15:51:28 2011 -0500 summary: Adding toggle show/hide on database queries in the output profiler. Added a profiler config item to set a threshold of when to hide the queries by default. Additionally, fixed a bug I created earlier today by marking the $CI class var in CI_Profiler as private. --- system/libraries/Profiler.php | 35 ++++++++++--- user_guide/general/profiling.html | 103 ++++++++++++++++++++------------------ 2 files changed, 83 insertions(+), 55 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index d1828b984..b73ddaf0d 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -32,8 +32,6 @@ */ class CI_Profiler { - private $CI; - protected $_available_sections = array( 'benchmarks', 'get', @@ -46,12 +44,24 @@ class CI_Profiler { 'session_data', 'config' ); + + protected $_query_toggle_count = 25; + + protected $CI; + // -------------------------------------------------------------------- + public function __construct($config = array()) { $this->CI =& get_instance(); $this->CI->load->language('profiler'); + if (isset($config['query_toggle_count'])) + { + $this->_query_toggle_count = (int) $config['query_toggle_count']; + unset($config['query_toggle_count']); + } + // default all sections to display foreach ($this->_available_sections as $section) { @@ -163,7 +173,7 @@ class CI_Profiler { $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
      \n"; $output .="\n"; $output .= "
      ".$this->CI->lang->line('profiler_no_db')."
      \n"; $output .= ""; @@ -178,14 +188,27 @@ class CI_Profiler { $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); $output = "\n\n"; - + + $count = 0; + foreach ($dbs as $db) { + $count++; + + $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; + + $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; + + if ($hide_queries != '') + { + $show_hide_js = '('.$this->CI->lang->line('profiler_section_show').')'; + } + $output .= '
      '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'   '; + $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'  '.$show_hide_js.''; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
      \n"; if (count($db->queries) == 0) { diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index f3ea0c6fd..78ece7dcd 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -105,55 +105,60 @@ This information can be useful during development in order to help with debuggin
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionDefault
      benchmarksElapsed time of Benchmark points and total execution timeTRUE
      configCodeIgniter Config variablesTRUE
      controller_infoThe Controller class and method requestedTRUE
      getAny GET data passed in the requestTRUE
      http_headersThe HTTP headers for the current requestTRUE
      memory_usageAmount of memory consumed by the current request, in bytesTRUE
      postAny POST data passed in the requestTRUE
      queriesListing of all database queries executed, including execution timeTRUE
      uri_stringThe URI of the current requestTRUE
      KeyDescriptionDefault
      benchmarksElapsed time of Benchmark points and total execution timeTRUE
      configCodeIgniter Config variablesTRUE
      controller_infoThe Controller class and method requestedTRUE
      getAny GET data passed in the requestTRUE
      http_headersThe HTTP headers for the current requestTRUE
      memory_usageAmount of memory consumed by the current request, in bytesTRUE
      postAny POST data passed in the requestTRUE
      queriesListing of all database queries executed, including execution timeTRUE
      uri_stringThe URI of the current requestTRUE
      query_toggle_countThe number of queries after which the query block will default to hidden.25
      -- cgit v1.2.3-24-g4f1b From 3a746655e92ec59ee7e731c3535673a9aedc5d3e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 10:59:47 -0500 Subject: Removing internal references to the EXT constant. Additionally, marked the constant as deprecated. Use ".php" instead. Also adding upgrade notes from 2.0.2 to 2.0.3. --- index.php | 3 +- system/core/CodeIgniter.php | 22 +++---- system/core/Common.php | 14 ++--- system/core/Config.php | 6 +- system/core/Exceptions.php | 4 +- system/core/Hooks.php | 8 +-- system/core/Lang.php | 4 +- system/core/Loader.php | 64 +++++++++---------- system/core/Output.php | 6 +- system/core/Router.php | 14 ++--- system/database/DB.php | 12 ++-- system/database/DB_driver.php | 6 +- system/helpers/download_helper.php | 8 +-- system/helpers/file_helper.php | 8 +-- system/helpers/html_helper.php | 8 +-- system/helpers/smiley_helper.php | 8 +-- system/helpers/text_helper.php | 8 +-- system/libraries/Calendar.php | 2 +- system/libraries/Driver.php | 2 +- system/libraries/Encrypt.php | 2 +- system/libraries/Log.php | 2 +- system/libraries/Upload.php | 8 +-- system/libraries/User_agent.php | 8 +-- user_guide/changelog.html | 1 + user_guide/installation/upgrade_203.html | 102 +++++++++++++++++++++++++++++++ user_guide/installation/upgrading.html | 1 + 26 files changed, 218 insertions(+), 113 deletions(-) create mode 100644 user_guide/installation/upgrade_203.html diff --git a/index.php b/index.php index 6e67c2db5..a8d58b2d9 100644 --- a/index.php +++ b/index.php @@ -163,6 +163,7 @@ if (defined('ENVIRONMENT')) define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); // The PHP file extension + // this global constant is deprecated. define('EXT', '.php'); // Path to the system folder @@ -198,7 +199,7 @@ if (defined('ENVIRONMENT')) * And away we go... * */ -require_once BASEPATH.'core/CodeIgniter'.EXT; +require_once BASEPATH.'core/CodeIgniter.php'; /* End of file index.php */ /* Location: ./index.php */ \ No newline at end of file diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index e022e1b46..03b25ab9e 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -46,20 +46,20 @@ * Load the global functions * ------------------------------------------------------ */ - require(BASEPATH.'core/Common'.EXT); + require(BASEPATH.'core/Common.php'); /* * ------------------------------------------------------ * Load the framework constants * ------------------------------------------------------ */ - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) { - require(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT); + require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } else { - require(APPPATH.'config/constants'.EXT); + require(APPPATH.'config/constants.php'); } /* @@ -224,7 +224,7 @@ * */ // Load the base controller class - require BASEPATH.'core/Controller'.EXT; + require BASEPATH.'core/Controller.php'; function &get_instance() { @@ -232,20 +232,20 @@ } - if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT)) + if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php')) { - require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT; + require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'; } // Load the local application controller // Note: The Router class automatically validates the controller path using the router->_validate_request(). // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. - if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php')) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } - include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); + include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php'); // Set a mark point for benchmarking $BM->mark('loading_time:_base_classes_end'); @@ -318,12 +318,12 @@ $method = (isset($x[1]) ? $x[1] : 'index'); if ( ! class_exists($class)) { - if ( ! file_exists(APPPATH.'controllers/'.$class.EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { show_404("{$class}/{$method}"); } - include_once(APPPATH.'controllers/'.$class.EXT); + include_once(APPPATH.'controllers/'.$class.'.php'); unset($CI); $CI = new $class(); } diff --git a/system/core/Common.php b/system/core/Common.php index 1aca809ab..d1e8e77e9 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -128,13 +128,13 @@ // thenin the local application/libraries folder foreach (array(BASEPATH, APPPATH) as $path) { - if (file_exists($path.$directory.'/'.$class.EXT)) + if (file_exists($path.$directory.'/'.$class.'.php')) { $name = $prefix.$class; if (class_exists($name) === FALSE) { - require($path.$directory.'/'.$class.EXT); + require($path.$directory.'/'.$class.'.php'); } break; @@ -142,13 +142,13 @@ } // Is the request a class extension? If so we load it too - if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT)) + if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php')) { $name = config_item('subclass_prefix').$class; if (class_exists($name) === FALSE) { - require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT); + require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php'); } } @@ -157,7 +157,7 @@ { // Note: We use exit() rather then show_error() in order to avoid a // self-referencing loop with the Excptions class - exit('Unable to locate the specified class: '.$class.EXT); + exit('Unable to locate the specified class: '.$class.'.php'); } // Keep track of what we just loaded @@ -209,9 +209,9 @@ } // Is the config file in the environment folder? - if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config'.EXT)) + if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php')) { - $file_path = APPPATH.'config/config'.EXT; + $file_path = APPPATH.'config/config.php'; } // Fetch the config file diff --git a/system/core/Config.php b/system/core/Config.php index 863c5ef4b..4493ff266 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -80,7 +80,7 @@ class CI_Config { */ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { - $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); + $file = ($file == '') ? 'config' : str_replace('.php', '', $file); $found = FALSE; $loaded = FALSE; @@ -92,7 +92,7 @@ class CI_Config { foreach ($check_locations as $location) { - $file_path = $path.'config/'.$location.EXT; + $file_path = $path.'config/'.$location.'.php'; if (in_array($file_path, $this->is_loaded, TRUE)) { @@ -152,7 +152,7 @@ class CI_Config { { return FALSE; } - show_error('The configuration file '.$file.EXT.' does not exist.'); + show_error('The configuration file '.$file.'.php'.' does not exist.'); } return TRUE; diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index f5659561c..bff86a92f 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -128,7 +128,7 @@ class CI_Exceptions { ob_end_flush(); } ob_start(); - include(APPPATH.'errors/'.$template.EXT); + include(APPPATH.'errors/'.$template.'.php'); $buffer = ob_get_contents(); ob_end_clean(); return $buffer; @@ -164,7 +164,7 @@ class CI_Exceptions { ob_end_flush(); } ob_start(); - include(APPPATH.'errors/error_php'.EXT); + include(APPPATH.'errors/error_php.php'); $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 24fa1055b..fd6380f0a 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -65,13 +65,13 @@ class CI_Hooks { // Grab the "hooks" definition file. // If there are no hooks, we're done. - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); } - elseif (is_file(APPPATH.'config/hooks'.EXT)) + elseif (is_file(APPPATH.'config/hooks.php')) { - include(APPPATH.'config/hooks'.EXT); + include(APPPATH.'config/hooks.php'); } diff --git a/system/core/Lang.php b/system/core/Lang.php index cdadc7f41..170e6c725 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -51,14 +51,14 @@ class CI_Lang { */ function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') { - $langfile = str_replace(EXT, '', $langfile); + $langfile = str_replace('.php', '', $langfile); if ($add_suffix == TRUE) { $langfile = str_replace('_lang.', '', $langfile).'_lang'; } - $langfile .= EXT; + $langfile .= '.php'; if (in_array($langfile, $this->is_loaded, TRUE)) { diff --git a/system/core/Loader.php b/system/core/Loader.php index e75805d0e..59415b72a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -161,7 +161,7 @@ class CI_Loader { foreach ($this->_ci_model_paths as $mod_path) { - if ( ! file_exists($mod_path.'models/'.$path.$model.EXT)) + if ( ! file_exists($mod_path.'models/'.$path.$model.'.php')) { continue; } @@ -181,7 +181,7 @@ class CI_Loader { load_class('Model', 'core'); } - require_once($mod_path.'models/'.$path.$model.EXT); + require_once($mod_path.'models/'.$path.$model.'.php'); $model = ucfirst($model); @@ -217,7 +217,7 @@ class CI_Loader { return FALSE; } - require_once(BASEPATH.'database/DB'.EXT); + require_once(BASEPATH.'database/DB.php'); if ($return === TRUE) { @@ -253,8 +253,8 @@ class CI_Loader { // this use is deprecated and strongly discouraged $CI->load->dbforge(); - require_once(BASEPATH.'database/DB_utility'.EXT); - require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); + require_once(BASEPATH.'database/DB_utility.php'); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility.php'); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; $CI->dbutil = new $class(); @@ -277,8 +277,8 @@ class CI_Loader { $CI =& get_instance(); - require_once(BASEPATH.'database/DB_forge'.EXT); - require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge'.EXT); + require_once(BASEPATH.'database/DB_forge.php'); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge.php'); $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; $CI->dbforge = new $class(); @@ -375,16 +375,16 @@ class CI_Loader { continue; } - $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.EXT; + $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; // Is this a helper extension request? if (file_exists($ext_helper)) { - $base_helper = BASEPATH.'helpers/'.$helper.EXT; + $base_helper = BASEPATH.'helpers/'.$helper.'.php'; if ( ! file_exists($base_helper)) { - show_error('Unable to load the requested file: helpers/'.$helper.EXT); + show_error('Unable to load the requested file: helpers/'.$helper.'.php'); } include_once($ext_helper); @@ -398,9 +398,9 @@ class CI_Loader { // Try to load the helper foreach ($this->_ci_helper_paths as $path) { - if (file_exists($path.'helpers/'.$helper.EXT)) + if (file_exists($path.'helpers/'.$helper.'.php')) { - include_once($path.'helpers/'.$helper.EXT); + include_once($path.'helpers/'.$helper.'.php'); $this->_ci_helpers[$helper] = TRUE; log_message('debug', 'Helper loaded: '.$helper); @@ -411,7 +411,7 @@ class CI_Loader { // unable to load the helper if ( ! isset($this->_ci_helpers[$helper])) { - show_error('Unable to load the requested file: helpers/'.$helper.EXT); + show_error('Unable to load the requested file: helpers/'.$helper.'.php'); } } } @@ -490,7 +490,7 @@ class CI_Loader { if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself - require BASEPATH.'libraries/Driver'.EXT; + require BASEPATH.'libraries/Driver.php'; } // We can save the loader some time since Drivers will *always* be in a subfolder, @@ -616,7 +616,7 @@ class CI_Loader { if ($_ci_path == '') { $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); - $_ci_file = ($_ci_ext == '') ? $_ci_view.EXT : $_ci_view; + $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; $_ci_path = $this->_ci_view_path.$_ci_file; } else @@ -732,7 +732,7 @@ class CI_Loader { // Get the class name, and while we're at it trim any slashes. // The directory path can be included as part of the class name, // but we don't want a leading slash - $class = str_replace(EXT, '', trim($class, '/')); + $class = str_replace('.php', '', trim($class, '/')); // Was the path included with the class name? // We look for a slash to determine this @@ -749,12 +749,12 @@ class CI_Loader { // We'll test for both lowercase and capitalized versions of the file name foreach (array(ucfirst($class), strtolower($class)) as $class) { - $subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.EXT; + $subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.'.php'; // Is this a class extension request? if (file_exists($subclass)) { - $baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT; + $baseclass = BASEPATH.'libraries/'.ucfirst($class).'.php'; if ( ! file_exists($baseclass)) { @@ -793,7 +793,7 @@ class CI_Loader { $is_duplicate = FALSE; foreach ($this->_ci_library_paths as $path) { - $filepath = $path.'libraries/'.$subdir.$class.EXT; + $filepath = $path.'libraries/'.$subdir.$class.'.php'; // Does the file exist? No? Bummer... if ( ! file_exists($filepath)) @@ -872,24 +872,24 @@ class CI_Loader { // We test for both uppercase and lowercase, for servers that // are case-sensitive with regard to file names. Check for environment // first, global next - if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT)) + if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) { - include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT); + include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); break; } - elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT)) + elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) { - include_once($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT); + include_once($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); break; } - elseif (file_exists($path .'config/'.strtolower($class).EXT)) + elseif (file_exists($path .'config/'.strtolower($class).'.php')) { - include_once($path .'config/'.strtolower($class).EXT); + include_once($path .'config/'.strtolower($class).'.php'); break; } - elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).EXT)) + elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).'.php')) { - include_once($path .'config/'.ucfirst(strtolower($class)).EXT); + include_once($path .'config/'.ucfirst(strtolower($class)).'.php'); break; } } @@ -965,13 +965,13 @@ class CI_Loader { */ function _ci_autoloader() { - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { - include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT); + include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); } else { - include_once(APPPATH.'config/autoload'.EXT); + include_once(APPPATH.'config/autoload.php'); } @@ -1084,13 +1084,13 @@ class CI_Loader { { if ( ! is_array($filename)) { - return array(strtolower(str_replace(EXT, '', str_replace($extension, '', $filename)).$extension)); + return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension)); } else { foreach ($filename as $key => $val) { - $filename[$key] = strtolower(str_replace(EXT, '', str_replace($extension, '', $val)).$extension); + $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension); } return $filename; diff --git a/system/core/Output.php b/system/core/Output.php index 45a82f3cb..05ace919c 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -42,13 +42,13 @@ class CI_Output { $this->_zlib_oc = @ini_get('zlib.output_compression'); // Get mime types for later - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT; + include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; } else { - include APPPATH.'config/mimes'.EXT; + include APPPATH.'config/mimes.php'; } diff --git a/system/core/Router.php b/system/core/Router.php index d451aab68..5e92a04b1 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -87,13 +87,13 @@ class CI_Router { } // Load the routes.php file. - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/routes.php'); } - elseif (is_file(APPPATH.'config/routes'.EXT)) + elseif (is_file(APPPATH.'config/routes.php')) { - include(APPPATH.'config/routes'.EXT); + include(APPPATH.'config/routes.php'); } $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; @@ -227,7 +227,7 @@ class CI_Router { } // Does the requested controller exist in the root folder? - if (file_exists(APPPATH.'controllers/'.$segments[0].EXT)) + if (file_exists(APPPATH.'controllers/'.$segments[0].'.php')) { return $segments; } @@ -242,7 +242,7 @@ class CI_Router { if (count($segments) > 0) { // Does the requested controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php')) { show_404($this->fetch_directory().$segments[0]); } @@ -264,7 +264,7 @@ class CI_Router { } // Does the default controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.'.php')) { $this->directory = ''; return array(); diff --git a/system/database/DB.php b/system/database/DB.php index 8bf1ba8ba..33207d885 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -28,11 +28,11 @@ function &DB($params = '', $active_record_override = NULL) if (is_string($params) AND strpos($params, '://') === FALSE) { // Is the config file in the environment folder? - if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database'.EXT)) + if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database.php')) { - if ( ! file_exists($file_path = APPPATH.'config/database'.EXT)) + if ( ! file_exists($file_path = APPPATH.'config/database.php')) { - show_error('The configuration file database'.EXT.' does not exist.'); + show_error('The configuration file database.php does not exist.'); } } @@ -116,11 +116,11 @@ function &DB($params = '', $active_record_override = NULL) $active_record = $active_record_override; } - require_once(BASEPATH.'database/DB_driver'.EXT); + require_once(BASEPATH.'database/DB_driver.php'); if ( ! isset($active_record) OR $active_record == TRUE) { - require_once(BASEPATH.'database/DB_active_rec'.EXT); + require_once(BASEPATH.'database/DB_active_rec.php'); if ( ! class_exists('CI_DB')) { @@ -135,7 +135,7 @@ function &DB($params = '', $active_record_override = NULL) } } - require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver'.EXT); + require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php'); // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index e7a9de475..10e8ed0c0 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -424,8 +424,8 @@ class CI_DB_driver { if ( ! class_exists($driver)) { - include_once(BASEPATH.'database/DB_result'.EXT); - include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); + include_once(BASEPATH.'database/DB_result.php'); + include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result.php'); } return $driver; @@ -1115,7 +1115,7 @@ class CI_DB_driver { if ( ! class_exists('CI_DB_Cache')) { - if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) + if ( ! @include(BASEPATH.'database/DB_cache.php')) { return $this->cache_off(); } diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index f8073d238..1145688ae 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -58,13 +58,13 @@ if ( ! function_exists('force_download')) $extension = end($x); // Load the mime types - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config/mimes'.EXT); + include(APPPATH.'config/mimes.php'); } // Set a default mime if we can't find it diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 44344947e..3931667fd 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -352,13 +352,13 @@ if ( ! function_exists('get_mime_by_extension')) if ( ! is_array($mimes)) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config/mimes'.EXT); + include(APPPATH.'config/mimes.php'); } if ( ! is_array($mimes)) diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index a29204391..080f622dd 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -259,13 +259,13 @@ if ( ! function_exists('doctype')) if ( ! is_array($_doctypes)) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'); } - elseif (is_file(APPPATH.'config/doctypes'.EXT)) + elseif (is_file(APPPATH.'config/doctypes.php')) { - include(APPPATH.'config/doctypes'.EXT); + include(APPPATH.'config/doctypes.php'); } if ( ! is_array($_doctypes)) diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index a2d1031b3..6d8889354 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -229,13 +229,13 @@ if ( ! function_exists('_get_smiley_array')) { function _get_smiley_array() { - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } - elseif (file_exists(APPPATH.'config/smileys'.EXT)) + elseif (file_exists(APPPATH.'config/smileys.php')) { - include(APPPATH.'config/smileys'.EXT); + include(APPPATH.'config/smileys.php'); } if (isset($smileys) AND is_array($smileys)) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index cca093976..33d7fa2fd 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -366,13 +366,13 @@ if ( ! function_exists('convert_accented_characters')) { function convert_accented_characters($str) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php'); } - elseif (is_file(APPPATH.'config/foreign_chars'.EXT)) + elseif (is_file(APPPATH.'config/foreign_chars.php')) { - include(APPPATH.'config/foreign_chars'.EXT); + include(APPPATH.'config/foreign_chars.php'); } if ( ! isset($foreign_characters)) diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 72d228e73..df0fd6eeb 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -47,7 +47,7 @@ class CI_Calendar { { $this->CI =& get_instance(); - if ( ! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE)) + if ( ! in_array('calendar_lang.php', $this->CI->lang->is_loaded, TRUE)) { $this->CI->lang->load('calendar'); } diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index b942f539f..d1925c0ec 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -59,7 +59,7 @@ class CI_Driver_Library { // loves me some nesting! foreach (array(ucfirst($driver_name), $driver_name) as $class) { - $filepath = $path.'libraries/'.$lib_name.'/drivers/'.$class.EXT; + $filepath = $path.'libraries/'.$lib_name.'/drivers/'.$class.'.php'; if (file_exists($filepath)) { diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index e5f65878a..b30a8cf0b 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -524,7 +524,7 @@ class CI_Encrypt { { if ( ! function_exists('mhash')) { - require_once(BASEPATH.'libraries/Sha1'.EXT); + require_once(BASEPATH.'libraries/Sha1.php'); $SH = new CI_SHA; return $SH->generate($str); } diff --git a/system/libraries/Log.php b/system/libraries/Log.php index fb2c5a49b..9f1db76ba 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -83,7 +83,7 @@ class CI_Log { return FALSE; } - $filepath = $this->_log_path.'log-'.date('Y-m-d').EXT; + $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; $message = ''; if ( ! file_exists($filepath)) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index e80049fa4..3177424c4 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -945,13 +945,13 @@ class CI_Upload { if (count($this->mimes) == 0) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config//mimes'.EXT); + include(APPPATH.'config//mimes.php'); } else { diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 04cda7312..016102a2a 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -84,13 +84,13 @@ class CI_User_agent { */ private function _load_agent_file() { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'); } - elseif (is_file(APPPATH.'config/user_agents'.EXT)) + elseif (is_file(APPPATH.'config/user_agents.php')) { - include(APPPATH.'config/user_agents'.EXT); + include(APPPATH.'config/user_agents.php'); } else { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9890f602c..945b10497 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@ Change Log
    • General Changes
      • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
      • +
      • Removed internal usage of the EXT constant.
    • Helpers diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html new file mode 100644 index 000000000..4937cf257 --- /dev/null +++ b/user_guide/installation/upgrade_203.html @@ -0,0 +1,102 @@ + + + + + +Upgrading from 2.0.2 to 2.0.3 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +

      CodeIgniter User Guide Version 2.0.3

      +
      + + + + + + + + + +
      + + +
      + + + +
      + +

      Upgrading from 2.0.2 to 2.0.3

      + +

      Before performing an update you should take your site offline by replacing the index.php file with a static one.

      + + +

      Step 1: Update your CodeIgniter files

      + +

      Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one.

      + +

      Note: If you have any custom developed files in these folders please make copies of them first.

      + +

      Step 2: Update CodeIgniter files

      + +

      Replace the files and directories in your "system" folder with the new versions:

      + +

      Step 3: Update your main index.php file

      + +

      If you are running a stock index.php file simply replace your version with the new one.

      + +

      If your index.php file has internal modifications, please add your modifications to the new file and use it.

      + +

      Step 4: Replace config/user_agents.php

      + +

      This config file has been updated to contain more user agent types, please copy it to application/config/user_agents.php.

      + +

      Step 5: Change references of the EXT constant to ".php"

      +

      Note: The EXT Constant has been marked as deprecated, but has not been removed from the application. You are encouraged to make the changes sooner rather than later.

      + +
      + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 1c4eb882d..014ffa3f3 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -60,6 +60,7 @@ Upgrading from a Previous Version

      Please read the upgrade notes corresponding to the version you are upgrading from.

        +
      • Upgrading from 2.0.2 to 2.0.3
      • Upgrading from 2.0.1 to 2.0.2
      • Upgrading from 2.0 to 2.0.1
      • Upgrading from 1.7.2 to 2.0
      • -- cgit v1.2.3-24-g4f1b From 9ce4385cfc976e309ee12c53726abfd4f066ac3f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 12:58:52 -0500 Subject: 1/2 reverting a previous change to the form_helper. Wrapping hidden form elements in
        instead of an empty div. If a user is styling form div {} they can run into display issues, so something is needed. --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index bca0ff0c9..a5cd97b82 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -72,7 +72,7 @@ if ( ! function_exists('form_open')) if (is_array($hidden) AND count($hidden) > 0) { - $form .= sprintf("\n
        %s
        ", form_hidden($hidden)); + $form .= sprintf("
        %s
        ", form_hidden($hidden)); } return $form; -- cgit v1.2.3-24-g4f1b From 4488538665d37b07a08d7fe4ce6f4156a9899211 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 15:28:40 -0500 Subject: Removed APPPATH.'third_party' from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default. --- application/config/autoload.php | 2 +- user_guide/changelog.html | 1 + user_guide/installation/upgrade_203.html | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/application/config/autoload.php b/application/config/autoload.php index 90b1a808f..53129c9c6 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -37,7 +37,7 @@ | */ -$autoload['packages'] = array(APPPATH.'third_party'); +$autoload['packages'] = array(); /* diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 945b10497..3a17edd90 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@ Change Log
        • Added ENVIRONMENT to reserved constants. (Reactor #196)
        • Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
        • +
        • Removed APPPATH.'third_party' from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default.

        Version 2.0.2

        diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index 4937cf257..38cfb72c9 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -83,6 +83,18 @@ Upgrading from 2.0.2 to 2.0.3

        Step 5: Change references of the EXT constant to ".php"

        Note: The EXT Constant has been marked as deprecated, but has not been removed from the application. You are encouraged to make the changes sooner rather than later.

        +

        Step 6: Remove APPPATH.'third_party' from autoload.php

        + +

        Open application/autoload.php, and look for the following:

        + +$autoload['packages'] = array(APPPATH.'third_party'); + +

        If you have not chosen to load any additional packages, that line can be changed to:

        +$autoload['packages'] = array(); + +

        Which should provide for nominal performance gains if not autoloading packages.

        + + -- cgit v1.2.3-24-g4f1b From 6ae70cc8499499b5d77d77ec8974f95873edb861 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 19 Apr 2011 16:13:48 -0500 Subject: modified MySQL and MySQLi drivers to address a potential SQL injection attack vector when multi-byte character set connections are employed. (Does not impact Latin-1, UTF-8, etc. encodings) --- application/config/database.php | 6 ++++++ system/database/drivers/mysql/mysql_driver.php | 17 ++++++++++++++++- system/database/drivers/mysqli/mysqli_driver.php | 17 ++++++++++++++++- user_guide/changelog.html | 4 ++++ user_guide/database/configuration.html | 2 +- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/application/config/database.php b/application/config/database.php index 24d611ac5..fa541a734 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -26,6 +26,12 @@ | ['cachedir'] The path to the folder where cache files should be stored | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database +| NOTE: For MySQL and MySQLi databases, this setting is only used +| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. +| There is an incompatibility in PHP with mysql_real_escape_string() which +| can make your site vulnerable to SQL injection if you are using a +| multi-byte character set and are running versions lower than these. +| Sites using Latin-1 or UTF-8 database character set and collation are unaffected. | ['swap_pre'] A default table prefix that should be swapped with the dbprefix | ['autoinit'] Whether or not to automatically initialize the database. | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 4ff9b0a11..b7d547cc0 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -132,7 +132,22 @@ class CI_DB_mysql_driver extends CI_DB { */ function db_set_charset($charset, $collation) { - return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); + static $use_set_names; + + if ( ! isset($use_set_names)) + { + // mysql_set_charset() requires PHP >= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback + $use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE; + } + + if ($use_set_names) + { + return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); + } + else + { + return @mysql_set_charset($charset, $this->conn_id); + } } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index ccdabce1a..1949acb6e 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -132,7 +132,22 @@ class CI_DB_mysqli_driver extends CI_DB { */ function _db_set_charset($charset, $collation) { - return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + static $use_set_names; + + if ( ! isset($use_set_names)) + { + // mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback + $use_set_names = (version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE; + } + + if ($use_set_names) + { + return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + } + else + { + return @mysqli_set_charset($this->conn_id, $charset); + } } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 945b10497..6eb80b38e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,6 +63,10 @@ Change Log

        Release Date: Not Released

          +
        • Security +
            +
          • An improvement was made to the MySQL and MySQLi drivers to prevent exposing a potential vector for SQL injection on sites using multi-byte character sets in the database client connection.

            An incompatibility in PHP versions < 5.2.3 and MySQL < 5.0.7 with mysql_set_charset() creates a situation where using multi-byte character sets on these environments may potentially expose a SQL injection attack vector. Latin-1, UTF-8, and other "low ASCII" character sets are unaffected on all environments.

            If you are running or considering running a multi-byte character set for your database connection, please pay close attention to the server environment you are deploying on to ensure you are not vulnerable.

          • +
        • General Changes
          • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
          • diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index fdeae0ee2..51d11c9f2 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -132,7 +132,7 @@ for the primary connection, but it too can be renamed to something more relevant
          • cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
          • cachedir - The absolute server path to your database query cache directory.
          • char_set - The character set used in communicating with the database.
          • -
          • dbcollat - The character collation used in communicating with the database.
          • +
          • dbcollat - The character collation used in communicating with the database.

            Note: For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. There is an incompatibility in PHP with mysql_real_escape_string() which can make your site vulnerable to SQL injection if you are using a multi-byte character set and are running versions lower than these. Sites using Latin-1 or UTF-8 database character set and collation are unaffected.

          • swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
          • autoinit - Whether or not to automatically connect to the database when the library loads. If set to false, the connection will take place prior to executing the first query.
          • stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
          • -- cgit v1.2.3-24-g4f1b From f5c840241084e03d49e521bfcb62d2adbe9fce7d Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 17:13:03 -0500 Subject: Altering the loader to be able to load views from packages when adding the package path with add_package_path(). --- system/core/Controller.php | 2 +- system/core/Loader.php | 110 ++++++++++++++++++++++++--------------------- 2 files changed, 59 insertions(+), 53 deletions(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index 469663f09..fd9c8b580 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -50,7 +50,7 @@ class CI_Controller { $this->load->_base_classes =& is_loaded(); - $this->load->_ci_autoloader(); + $this->load->ci_autoloader(); log_message('debug', "Controller Class Initialized"); diff --git a/system/core/Loader.php b/system/core/Loader.php index 59415b72a..8146cd563 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -30,8 +30,8 @@ class CI_Loader { // All these are set automatically. Don't mess with them. var $_ci_ob_level; - var $_ci_view_path = ''; - var $_ci_library_paths = array(); + var $_ci_view_paths = array(); + protected $_ci_library_paths = array(); var $_ci_model_paths = array(); var $_ci_helper_paths = array(); var $_base_classes = array(); // Set by the controller class @@ -47,17 +47,15 @@ class CI_Loader { * Constructor * * Sets the path to the view files and gets the initial output buffering level - * - * @access public */ - function __construct() + public function __construct() { - $this->_ci_view_path = APPPATH.'views/'; $this->_ci_ob_level = ob_get_level(); $this->_ci_library_paths = array(APPPATH, BASEPATH); $this->_ci_helper_paths = array(APPPATH, BASEPATH); $this->_ci_model_paths = array(APPPATH); - + $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); + log_message('debug', "Loader Class Initialized"); } @@ -107,13 +105,12 @@ class CI_Loader { * * This function lets users load and instantiate models. * - * @access public * @param string the name of the class * @param string name for the model * @param bool database connection * @return void */ - function model($model, $name = '', $db_conn = FALSE) + public function model($model, $name = '', $db_conn = FALSE) { if (is_array($model)) { @@ -200,13 +197,12 @@ class CI_Loader { /** * Database Loader * - * @access public * @param string the DB credentials * @param bool whether to return the DB object * @param bool whether to enable active record (this allows us to override the config setting) * @return object */ - function database($params = '', $return = FALSE, $active_record = NULL) + public function database($params = '', $return = FALSE, $active_record = NULL) { // Grab the super object $CI =& get_instance(); @@ -237,10 +233,9 @@ class CI_Loader { /** * Load the Utilities Class * - * @access public * @return string */ - function dbutil() + public function dbutil() { if ( ! class_exists('CI_DB')) { @@ -265,10 +260,9 @@ class CI_Loader { /** * Load the Database Forge Class * - * @access public * @return string */ - function dbforge() + public function dbforge() { if ( ! class_exists('CI_DB')) { @@ -297,13 +291,12 @@ class CI_Loader { * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * - * @access public * @param string * @param array * @param bool * @return void */ - function view($view, $vars = array(), $return = FALSE) + public function view($view, $vars = array(), $return = FALSE) { return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); } @@ -315,12 +308,11 @@ class CI_Loader { * * This is a generic file loader * - * @access public * @param string * @param bool * @return string */ - function file($path, $return = FALSE) + public function file($path, $return = FALSE) { return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return)); } @@ -333,11 +325,10 @@ class CI_Loader { * Once variables are set they become available within * the controller class and its "view" files. * - * @access public * @param array * @return void */ - function vars($vars = array(), $val = '') + public function vars($vars = array(), $val = '') { if ($val != '' AND is_string($vars)) { @@ -362,11 +353,10 @@ class CI_Loader { * * This function loads the specified helper file. * - * @access public * @param mixed * @return void */ - function helper($helpers = array()) + public function helper($helpers = array()) { foreach ($this->_ci_prep_filename($helpers, '_helper') as $helper) { @@ -424,11 +414,10 @@ class CI_Loader { * This is simply an alias to the above function in case the * user has written the plural form of this function. * - * @access public * @param array * @return void */ - function helpers($helpers = array()) + public function helpers($helpers = array()) { $this->helper($helpers); } @@ -438,12 +427,11 @@ class CI_Loader { /** * Loads a language file * - * @access public * @param array * @param string * @return void */ - function language($file = array(), $lang = '') + public function language($file = array(), $lang = '') { $CI =& get_instance(); @@ -463,11 +451,10 @@ class CI_Loader { /** * Loads a config file * - * @access public * @param string * @return void */ - function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { $CI =& get_instance(); $CI->config->load($file, $use_sections, $fail_gracefully); @@ -485,7 +472,7 @@ class CI_Loader { * @param string an optional object name * @return void */ - function driver($library = '', $params = NULL, $object_name = NULL) + public function driver($library = '', $params = NULL, $object_name = NULL) { if ( ! class_exists('CI_Driver_Library')) { @@ -510,18 +497,20 @@ class CI_Loader { * * Prepends a parent path to the library, model, helper, and config path arrays * - * @access public * @param string + * @param boolean * @return void */ - function add_package_path($path) + public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; - + array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); + $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; + // Add config file path $config =& $this->_ci_get_component('config'); array_unshift($config->_config_paths, $path); @@ -534,11 +523,10 @@ class CI_Loader { * * Return a list of all package paths, by default it will ignore BASEPATH. * - * @access public * @param string * @return void */ - function get_package_paths($include_base = FALSE) + public function get_package_paths($include_base = FALSE) { return $include_base === TRUE ? $this->_ci_library_paths : $this->_ci_model_paths; } @@ -551,11 +539,10 @@ class CI_Loader { * Remove a path from the library, model, and helper path arrays if it exists * If no path is provided, the most recently added path is removed. * - * @access public * @param type * @return type */ - function remove_package_path($path = '', $remove_config_path = TRUE) + public function remove_package_path($path = '', $remove_config_path = TRUE) { $config =& $this->_ci_get_component('config'); @@ -564,12 +551,12 @@ class CI_Loader { $void = array_shift($this->_ci_library_paths); $void = array_shift($this->_ci_model_paths); $void = array_shift($this->_ci_helper_paths); + $void = array_shift($this->_ci_view_paths); $void = array_shift($config->_config_paths); } else { $path = rtrim($path, '/').'/'; - foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) { if (($key = array_search($path, $this->{$var})) !== FALSE) @@ -577,6 +564,11 @@ class CI_Loader { unset($this->{$var}[$key]); } } + + if (isset($this->_ci_view_paths[$path.'views/'])) + { + unset($this->_ci_view_paths[$path.'views/']); + } if (($key = array_search($path, $config->_config_paths)) !== FALSE) { @@ -588,6 +580,7 @@ class CI_Loader { $this->_ci_library_paths = array_unique(array_merge($this->_ci_library_paths, array(APPPATH, BASEPATH))); $this->_ci_helper_paths = array_unique(array_merge($this->_ci_helper_paths, array(APPPATH, BASEPATH))); $this->_ci_model_paths = array_unique(array_merge($this->_ci_model_paths, array(APPPATH))); + $this->_ci_view_paths = array_merge($this->_ci_view_paths, array(APPPATH.'views/' => TRUE)); $config->_config_paths = array_unique(array_merge($config->_config_paths, array(APPPATH))); } @@ -600,24 +593,39 @@ class CI_Loader { * Variables are prefixed with _ci_ to avoid symbol collision with * variables made available to view files * - * @access private * @param array * @return void */ - function _ci_load($_ci_data) + protected function _ci_load($_ci_data) { // Set the default data variables foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val) { $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; } + + $file_exists = FALSE; // Set the path to the requested file if ($_ci_path == '') { $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; - $_ci_path = $this->_ci_view_path.$_ci_file; + + foreach ($this->_ci_view_paths as $view_file => $cascade) + { + if (file_exists($view_file.$_ci_file)) + { + $_ci_path = $view_file.$_ci_file; + $file_exists = TRUE; + break; + } + + if ( ! $cascade) + { + break; + } + } } else { @@ -625,7 +633,7 @@ class CI_Loader { $_ci_file = end($_ci_x); } - if ( ! file_exists($_ci_path)) + if ( ! $file_exists && ! file_exists($_ci_path)) { show_error('Unable to load the requested file: '.$_ci_file); } @@ -721,13 +729,12 @@ class CI_Loader { * * This function loads the requested class. * - * @access private * @param string the item that is being loaded * @param mixed any additional parameters * @param string an optional object name * @return void */ - function _ci_load_class($class, $params = NULL, $object_name = NULL) + protected function _ci_load_class($class, $params = NULL, $object_name = NULL) { // Get the class name, and while we're at it trim any slashes. // The directory path can be included as part of the class name, @@ -959,11 +966,13 @@ class CI_Loader { * The config/autoload.php file contains an array that permits sub-systems, * libraries, and helpers to be loaded automatically. * - * @access private + * This function is public, as it's used in the CI_Controller class. + * However, there is no reason you should ever needs to use it. + * * @param array * @return void */ - function _ci_autoloader() + public function ci_autoloader() { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { @@ -1046,11 +1055,10 @@ class CI_Loader { * * Takes an object as input and converts the class variables to array key/vals * - * @access private * @param object * @return array */ - function _ci_object_to_array($object) + protected function _ci_object_to_array($object) { return (is_object($object)) ? get_object_vars($object) : $object; } @@ -1060,10 +1068,9 @@ class CI_Loader { /** * Get a reference to a specific library or model * - * @access private * @return bool */ - function &_ci_get_component($component) + protected function &_ci_get_component($component) { $CI =& get_instance(); return $CI->$component; @@ -1076,11 +1083,10 @@ class CI_Loader { * * This function preps the name of various items to make loading them more reliable. * - * @access private * @param mixed * @return array */ - function _ci_prep_filename($filename, $extension) + protected function _ci_prep_filename($filename, $extension) { if ( ! is_array($filename)) { -- cgit v1.2.3-24-g4f1b From b3e614d8b2293c079bcfb9cfdf071c041cbc4722 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 20:19:17 -0500 Subject: Change in core/Security.php to match coding standards. --- system/core/Security.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/core/Security.php b/system/core/Security.php index 4f91572ed..3617cadcc 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -68,7 +68,8 @@ class CI_Security { } // Append application specific cookie prefix - if (config_item('cookie_prefix')) { + if (config_item('cookie_prefix')) + { $this->_csrf_cookie_name = config_item('cookie_prefix').$this->_csrf_cookie_name; } -- cgit v1.2.3-24-g4f1b From 0c9ee4a348a9e0c9ee6d6c0085e463e098e453f4 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 09:40:17 -0500 Subject: Refactoring the loader to set protected class variables. Moved _ci_autoload(), which is used in CI_Controller to be a public method. Also added CI_Loader::set_base_classes() to be called in the controller so we're not setting protected vars in another class. Also refactored in the form_helper so it's not trying to access protected vars in CI_Loader. Added the is_loaded() method to the loader to take care of the checks that were being done there. --- system/core/Controller.php | 7 ++-- system/core/Loader.php | 75 +++++++++++++++++++++++++++++++----------- system/helpers/form_helper.php | 24 +++++++------- 3 files changed, 69 insertions(+), 37 deletions(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index fd9c8b580..ec86b7920 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -48,12 +48,9 @@ class CI_Controller { $this->load =& load_class('Loader', 'core'); - $this->load->_base_classes =& is_loaded(); - - $this->load->ci_autoloader(); - + $this->load->set_base_classes()->ci_autoloader(); + log_message('debug', "Controller Class Initialized"); - } public static function &get_instance() diff --git a/system/core/Loader.php b/system/core/Loader.php index 8146cd563..a52ef288a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -29,19 +29,19 @@ class CI_Loader { // All these are set automatically. Don't mess with them. - var $_ci_ob_level; - var $_ci_view_paths = array(); + protected $_ci_ob_level; + protected $_ci_view_paths = array(); protected $_ci_library_paths = array(); - var $_ci_model_paths = array(); - var $_ci_helper_paths = array(); - var $_base_classes = array(); // Set by the controller class - var $_ci_cached_vars = array(); - var $_ci_classes = array(); - var $_ci_loaded_files = array(); - var $_ci_models = array(); - var $_ci_helpers = array(); - var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); - + protected $_ci_model_paths = array(); + protected $_ci_helper_paths = array(); + protected $_base_classes = array(); // Set by the controller class + protected $_ci_cached_vars = array(); + protected $_ci_classes = array(); + protected $_ci_loaded_files = array(); + protected $_ci_models = array(); + protected $_ci_helpers = array(); + protected $_ci_varmap = array('unit_test' => 'unit', + 'user_agent' => 'agent'); /** * Constructor @@ -59,6 +59,47 @@ class CI_Loader { log_message('debug', "Loader Class Initialized"); } + // -------------------------------------------------------------------- + + /** + * Set _base_classes variable + * + * This method is called once in CI_Controller. + * + * @param array + * @return object + */ + public function set_base_classes() + { + $this->_base_classes =& is_loaded(); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Is Loaded + * + * A utility function to test if a class is in the self::$_ci_classes array. + * This function returns the object name if the class tested for is loaded, + * and returns FALSE if it isn't. + * + * It is mainly used in the form_helper -> _get_validation_object() + * + * @param string class being checked for + * @return mixed class object name on the CI SuperObject or FALSE + */ + public function is_loaded($class) + { + if (isset($this->_ci_classes[$class])) + { + return $this->_ci_classes[$class]; + } + + return FALSE; + } + // -------------------------------------------------------------------- /** @@ -67,13 +108,12 @@ class CI_Loader { * This function lets users load and instantiate classes. * It is designed to be called from a user's app controllers. * - * @access public * @param string the name of the class * @param mixed the optional parameters * @param string an optional object name * @return void */ - function library($library = '', $params = NULL, $object_name = NULL) + public function library($library = '', $params = NULL, $object_name = NULL) { if (is_array($library)) { @@ -856,13 +896,12 @@ class CI_Loader { /** * Instantiates a class * - * @access private * @param string * @param string * @param string an optional object name * @return null */ - function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) + protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { // Is there an associated config file for this class? Note: these should always be lowercase if ($config === NULL) @@ -1102,9 +1141,7 @@ class CI_Loader { return $filename; } } - - } /* End of file Loader.php */ -/* Location: ./system/core/Loader.php */ +/* Location: ./system/core/Loader.php */ \ No newline at end of file diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index a5cd97b82..51a9c6ca3 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1032,22 +1032,20 @@ if ( ! function_exists('_get_validation_object')) { $CI =& get_instance(); - // We set this as a variable since we're returning by reference + // We set this as a variable since we're returning by reference. $return = FALSE; - - if ( ! isset($CI->load->_ci_classes) OR ! isset($CI->load->_ci_classes['form_validation'])) - { - return $return; - } - - $object = $CI->load->_ci_classes['form_validation']; - - if ( ! isset($CI->$object) OR ! is_object($CI->$object)) + + if ( ! ($object = $CI->load->is_loaded('form_validation'))) { - return $return; + if ( ! isset($CI->$object) OR ! is_object($CI->$object)) + { + return $return; + } + + return $CI->$object; } - - return $CI->$object; + + return $return; } } -- cgit v1.2.3-24-g4f1b From e08c527aa0a8a05836b05763d859eb3d2970f62f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 09:54:47 -0500 Subject: Updating Documentation on package view loading --- user_guide/libraries/loader.html | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 42f8cf94f..1d93af5ed 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -231,17 +231,22 @@ $this->load->library('foo_bar');

            Package view files

            -

            @todo - package view file interface is not complete. It can be experimentally used by first saving the Loader's original view path, setting the view path to the package's view path, and when finished, setting back to the original view path.

            - -// ... save the original view path, and set to our Foo Bar package view folder
            -$orig_view_path = $this->load->_ci_view_path;
            -$this->load->_ci_view_path = APPPATH.'third_party/foo_bar/views/';
            -
            -// ... code using the package's view files
            -
            -// ... then return the view path to the application's original view path
            -$this->load->_ci_view_path = $orig_view_path;
            +

            By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

            +

            In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

            + +$this->load->add_package_path(APPPATH.'my_app', TRUE);
            +$this->load->view('my_app_index'); // Loads
            +$this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is TRUE
            +
            +// Reset things
            +$this->load->remove_package_path(APPPATH.'my_app');
            +
            +// Again without the second parameter:
            +$this->load->add_package_path(APPPATH.'my_app', TRUE);
            +$this->load->view('my_app_index'); // Loads
            +$this->load->view('welcome_message'); // Loads
            +
            -- cgit v1.2.3-24-g4f1b From 1cdb0fd21e0c5ac38a75712806ed10b08f0909cc Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:11:47 -0500 Subject: Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request. --- application/errors/error_404.php | 58 +++++++++++++----- application/errors/error_db.php | 58 +++++++++++++----- application/errors/error_general.php | 58 +++++++++++++----- application/views/welcome_message.php | 108 +++++++++++++++++++++------------- user_guide/changelog.html | 1 + 5 files changed, 196 insertions(+), 87 deletions(-) diff --git a/application/errors/error_404.php b/application/errors/error_404.php index a304f4561..792726a67 100644 --- a/application/errors/error_404.php +++ b/application/errors/error_404.php @@ -1,32 +1,60 @@ - + + 404 Page Not Found -
            +

            diff --git a/application/errors/error_db.php b/application/errors/error_db.php index 181de960b..b396cda9f 100644 --- a/application/errors/error_db.php +++ b/application/errors/error_db.php @@ -1,32 +1,60 @@ - + + Database Error -
            +

            diff --git a/application/errors/error_general.php b/application/errors/error_general.php index 7734d34c7..fd63ce2c5 100644 --- a/application/errors/error_general.php +++ b/application/errors/error_general.php @@ -1,32 +1,60 @@ - + + Error -
            +

            diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php index ca68fc101..0bf5a8d2e 100644 --- a/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -4,61 +4,85 @@ Welcome to CodeIgniter - + code { + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; + } + + #body{ + margin: 0 15px 0 15px; + } + + p.footer{ + text-align: right; + font-size: 11px; + border-top: 1px solid #D0D0D0; + line-height: 32px; + padding: 0 10px 0 10px; + margin: 20px 0 0 0; + } + + #container{ + margin: 10px; + border: 1px solid #D0D0D0; + -webkit-box-shadow: 0 0 8px #D0D0D0; + } + -

            Welcome to CodeIgniter!

            - -

            The page you are looking at is being generated dynamically by CodeIgniter.

            +
            +

            Welcome to CodeIgniter!

            -

            If you would like to edit this page you'll find it located at:

            -application/views/welcome_message.php +
            +

            The page you are looking at is being generated dynamically by CodeIgniter.

            -

            The corresponding controller for this page is found at:

            -application/controllers/welcome.php +

            If you would like to edit this page you'll find it located at:

            + application/views/welcome_message.php -

            If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

            +

            The corresponding controller for this page is found at:

            + application/controllers/welcome.php +

            If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

            +
            -


            Page rendered in {elapsed_time} seconds

            + +
            \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b889152ad..bbdbbbd19 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@ Change Log
            • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
            • Removed internal usage of the EXT constant.
            • +
            • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
          • Helpers -- cgit v1.2.3-24-g4f1b From 882b76bda8b701a8718960b8d639f060ae79e998 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:22:09 -0500 Subject: Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See Upgrade Notes Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL. --- user_guide/changelog.html | 4 +++- user_guide/installation/upgrade_203.html | 10 ++++++++++ user_guide/libraries/sessions.html | 18 ++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bbdbbbd19..70db33d48 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -78,7 +78,7 @@ Change Log
            • Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
            -
          • +

          Bug fixes for 2.0.3

          @@ -86,6 +86,8 @@ Change Log
        • Added ENVIRONMENT to reserved constants. (Reactor #196)
        • Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
        • Removed APPPATH.'third_party' from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default.
        • +
        • Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See Upgrade Notes.
        • +
        • Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.

        Version 2.0.2

        diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index 38cfb72c9..d7c0fae3a 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -94,6 +94,16 @@ Upgrading from 2.0.2 to 2.0.3

        Which should provide for nominal performance gains if not autoloading packages.

        +

        Update Sessions Database Tables

        + +

        If you are using database sessions with the CI Session Library, please update your ci_sessions database table as follows:

        + + + CREATE INDEX last_activity_idx ON ci_sessions(last_activity); + + + + diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 8d9c14eb6..6048f4809 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -218,15 +218,17 @@ be updated, they can only be generated when a new session is created.

        In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

        - + session_id varchar(40) DEFAULT '0' NOT NULL, + ip_address varchar(16) DEFAULT '0' NOT NULL, + user_agent varchar(50) NOT NULL, + last_activity int(10) unsigned DEFAULT 0 NOT NULL, + user_data text NOT NULL, + PRIMARY KEY (session_id), + KEY `last_activity_idx` (`last_activity`) +); +

        Note: By default the table is called ci_sessions, but you can name it anything you want as long as you update the application/config/config.php file so that it contains the name you have chosen. -- cgit v1.2.3-24-g4f1b From 50671cf8d67c805692fec49eda33d21227a21ec2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:36:45 -0500 Subject: Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) + if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120))) { $this->sess_destroy(); return FALSE; @@ -316,7 +316,7 @@ class CI_Session { $this->userdata = array( 'session_id' => md5(uniqid($sessid, TRUE)), 'ip_address' => $this->CI->input->ip_address(), - 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), + 'user_agent' => substr($this->CI->input->user_agent(), 0, 120), 'last_activity' => $this->now ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 70db33d48..7ff71d07a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,11 @@ Change Log

      • Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
    • +
    • Libraries +
        +
      • Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
      • +
      +

    Bug fixes for 2.0.3

    diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index d7c0fae3a..7dbc907ea 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -98,8 +98,9 @@ Upgrading from 2.0.2 to 2.0.3

    If you are using database sessions with the CI Session Library, please update your ci_sessions database table as follows:

    - + CREATE INDEX last_activity_idx ON ci_sessions(last_activity); + ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 6048f4809..a6f3c601c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -222,7 +222,7 @@ prototype (for MySQL) required by the session class:

    CREATE TABLE IF NOT EXISTS `ci_sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(16) DEFAULT '0' NOT NULL, - user_agent varchar(50) NOT NULL, + user_agent varchar(120) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text NOT NULL, PRIMARY KEY (session_id), -- cgit v1.2.3-24-g4f1b From fc779cef54a5cefc3f0d7f404a408a935d717966 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 12:25:17 -0500 Subject: Fix #224 Error in primary index.php $routing instructions --- index.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a8d58b2d9..f4ac11a72 100644 --- a/index.php +++ b/index.php @@ -98,7 +98,7 @@ if (defined('ENVIRONMENT')) // if your controller is not in a sub-folder within the "controllers" folder // $routing['directory'] = ''; - // The controller class file name. Example: Mycontroller.php + // The controller class file name. Example: Mycontroller // $routing['controller'] = ''; // The controller function you wish to be called. diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7ff71d07a..7ad566733 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@ Change Log
  • General Changes -

    All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

    +

    All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

    Note: Watermarking is only available using the GD/GD2 library. In addition, even though other libraries are supported, GD is required in -order for the script to calculate the image properties. The image processing, however, will be performed with the +order for the script to calculate the image properties. The image processing, however, will be performed with the library you specify.

    @@ -82,14 +82,14 @@ library you specify.

    using the $this->load->library function:

    $this->load->library('image_lib'); -

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    +

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    Processing an Image

    Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is identical. You will set some preferences corresponding to the action you intend to perform, then -call one of four available processing functions. For example, to create an image thumbnail you'll do this:

    +call one of four available processing functions. For example, to create an image thumbnail you'll do this:

    $config['image_library'] = 'gd2';
    $config['source_image'] = '/path/to/image/mypic.jpg';
    @@ -106,7 +106,7 @@ $this->image_lib->resize();

    The above code tells the image_resize function to look for an image called mypic.jpg located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. Since the maintain_ratio option is enabled, the thumb will be as close to the target width and -height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg +height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg

    Note: In order for the image class to be allowed to do any processing, the @@ -126,7 +126,7 @@ folder containing the image files must have write permissions.

  • $this->image_lib->clear()
  • -

    These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the +

    These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the error message using this function:

    echo $this->image_lib->display_errors(); @@ -138,7 +138,7 @@ error message using this function:

        echo $this->image_lib->display_errors();
    }
    -

    Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing +

    Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing tags in the function, like this:

    $this->image_lib->display_errors('<p>', '</p>'); @@ -146,11 +146,11 @@ tags in the function, like this:

    Preferences

    -

    The preferences described below allow you to tailor the image processing to suit your needs.

    +

    The preferences described below allow you to tailor the image processing to suit your needs.

    Note that not all preferences are available for every -function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height -preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

    +function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height +preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

    Availability Legend:

    @@ -187,7 +187,7 @@ preferences have no effect on cropping. The "availability" column indicates whi library_path None None -Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. +Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. R, C, X @@ -195,7 +195,7 @@ preferences have no effect on cropping. The "availability" column indicates whi source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. R, C, S, W @@ -203,7 +203,7 @@ preferences have no effect on cropping. The "availability" column indicates whi dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. R, C, X, W @@ -221,7 +221,7 @@ preferences have no effect on cropping. The "availability" column indicates whi new_image None None -Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. +Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. R, C, X, W @@ -253,7 +253,7 @@ preferences have no effect on cropping. The "availability" column indicates whi thumb_marker _thumb None -Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg +Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg R @@ -281,7 +281,7 @@ preferences have no effect on cropping. The "availability" column indicates whi rotation_angle None 90, 180, 270, vrt, hor -Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. +Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. X @@ -306,7 +306,7 @@ preferences have no effect on cropping. The "availability" column indicates whi

    Setting preferences in a config file

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called image_lib.php, add the $config +Simply create a new file called image_lib.php, add the $config array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

    @@ -319,7 +319,7 @@ or create a thumbnail image.

    For practical purposes there is no difference between creating a copy and creating a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

    -

    All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

    +

    All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

    Creating a Thumbnail

    @@ -358,7 +358,7 @@ preferences for the X and Y axis (in pixels) specifying where to crop, like this $config['x_axis'] = '100';
    $config['y_axis'] = '40';
    -

    All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

    +

    All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

    Here's an example showing how you might crop an image:

    @@ -378,8 +378,8 @@ if ( ! $this->image_lib->crop())

    Note: Without a visual interface it is difficult to crop images, so this function is not very useful -unless you intend to build such an interface. That's exactly what we did using for the photo -gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping +unless you intend to build such an interface. That's exactly what we did using for the photo +gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping area be selected.

    $this->image_lib->rotate()

    @@ -443,7 +443,7 @@ containing your watermark over the source image.

    Just as with the other functions (resizing, cropping, and rotating) the general process for watermarking involves setting the preferences corresponding to the action you intend to perform, then -calling the watermark function. Here is an example:

    +calling the watermark function. Here is an example:

    $config['source_image'] = '/path/to/image/mypic.jpg';
    @@ -452,9 +452,9 @@ $config['wm_type'] = 'text';
    $config['wm_font_path'] = './system/fonts/texb.ttf';
    $config['wm_font_size'] = '16';
    $config['wm_font_color'] = 'ffffff';
    -$config['wm_vrt_alignment'] = 'bottom';
    -$config['wm_hor_alignment'] = 'center';
    -$config['wm_padding'] = '20';
    +$config['wm_vrt_alignment'] = 'bottom';
    +$config['wm_hor_alignment'] = 'center';
    +$config['wm_padding'] = '20';

    $this->image_lib->initialize($config);
    @@ -462,7 +462,7 @@ $this->image_lib->initialize($config); $this->image_lib->watermark();
    -

    The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark +

    The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

    Note: In order for the image class to be allowed to do any processing, the image file must have "write" file permissions. For example, 777.

    @@ -491,14 +491,14 @@ will be positioned at the bottom/center of the image, 20 pixels from the bottom source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. @@ -563,28 +563,28 @@ will be positioned at the bottom/center of the image, 20 pixels from the bottom wm_text None None -The text you would like shown as the watermark. Typically this will be a copyright notice. +The text you would like shown as the watermark. Typically this will be a copyright notice. wm_font_path None None -The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. +The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. wm_font_size 16 None -The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. +The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. wm_font_color ffffff None -The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). +The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 08b8ab0d3..6070b6c48 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -70,20 +70,20 @@ Input Class

    Security Filtering

    -

    The security filtering function is called automatically when a new controller is invoked. It does the following:

    +

    The security filtering function is called automatically when a new controller is invoked. It does the following:

      -
    • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
    • +
    • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
    • Destroys all global variables in the event register_globals is turned on.
    • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
    • -
    • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
    • +
    • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
    • Standardizes newline characters to \n

    XSS Filtering

    -

    The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +

    The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your application/config/config.php file and setting this:

    $config['global_xss_filtering'] = TRUE; @@ -93,9 +93,9 @@ Input Class

    Using POST, COOKIE, or SERVER Data

    -

    CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided +

    CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and -return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. +return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:

    @@ -128,7 +128,7 @@ else

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    -

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    +

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    $this->input->post('some_data', TRUE); @@ -179,7 +179,7 @@ else

    $this->input->set_cookie()

    -

    Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: +

    Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: Array Method, and Discrete Parameters:

    Array Method

    @@ -203,10 +203,10 @@ $this->input->set_cookie($cookie);

    Only the name and value are required. To delete a cookie set it with the expiration blank.

    -

    The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to +

    The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to zero the cookie will only last as long as the browser is open.

    -

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    +

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    The path is usually not needed since the function sets a root path.

    The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

    The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.

    @@ -219,25 +219,25 @@ zero the cookie will only last as long as the browser is open.

    $this->input->cookie()

    -

    Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

    +

    Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

    cookie('some_cookie');

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    -

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    +

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    cookie('some_cookie', TRUE);

    $this->input->ip_address()

    -

    Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

    +

    Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

    echo $this->input->ip_address();

    $this->input->valid_ip($ip)

    -

    Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above +

    Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above validates the IP automatically.

    if ( ! $this->input->valid_ip($ip))
    @@ -256,7 +256,7 @@ else

    See the User Agent Class for methods which extract information from the user agent string.

    $this->input->request_headers()

    -

    Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

    +

    Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

    $headers = $this->input->request_headers(); diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 4e262279d..cd3adf1d2 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -65,11 +65,11 @@ JavaScript Driver $this->load->library('javascript'); -

    The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

    +

    The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

    $this->load->library('javascript', array('js_library_driver' => 'scripto', 'autoload' => FALSE)); -

    Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

    +

    Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

    Once loaded, the jQuery library object will be available using: $this->javascript

    Setup and Configuration

    @@ -93,7 +93,7 @@ JavaScript Driver $this->load->library('jquery'); -

    You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

    +

    You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

    $this->load->library('jquery', FALSE); @@ -115,7 +115,7 @@ JavaScript Driver

    Effects

    -

    The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

    +

    The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

    $this->jquery->effect([optional path] plugin name); // for example @@ -125,8 +125,8 @@ $this->jquery->effect('bounce');

    hide() / show()

    Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

    -

    $this->jquery->hide(target, optional speed, optional extra information);
    - $this->jquery->show(target, optional speed, optional extra information);

    +

    $this->jquery->hide(target, optional speed, optional extra information);
    + $this->jquery->show(target, optional speed, optional extra information);

    -- cgit v1.2.3-24-g4f1b From c5961e7d778d5a9361df4cfbc7da5fc4370d883f Mon Sep 17 00:00:00 2001 From: Adam Jackett Date: Sat, 23 Jul 2011 09:50:34 -0400 Subject: Fixed mysql and mysqli drivers to set NOT NULL as default for creating fields. All other drivers were correct. --- system/database/drivers/mysql/mysql_forge.php | 8 ++++++-- system/database/drivers/mysqli/mysqli_forge.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 529ec980d..c1cae136c 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -119,9 +119,13 @@ class CI_DB_mysql_forge extends CI_DB_forge { $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index d5097335e..260549457 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -104,9 +104,13 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) -- cgit v1.2.3-24-g4f1b From 090eb6075eac3a16974f6baed236875ee1dc8a90 Mon Sep 17 00:00:00 2001 From: Adam Jackett Date: Sat, 23 Jul 2011 11:53:02 -0400 Subject: Merge changelog. --- user_guide/changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7779a690d..f5eb53aa3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -102,6 +102,8 @@ Change Log
  • Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.
  • Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.
  • Fixed issue #199 - Attributes passed as string does not include a space between it and the opening tag.
  • +
  • Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
  • +
  • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
  • Version 2.0.2

    -- cgit v1.2.3-24-g4f1b From 76e621786007907192c3e84cbde3e1a12dbf83fb Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 9 Aug 2011 16:03:49 -0600 Subject: Fixed conflict in changelog. --- system/database/DB_active_rec.php | 3 ++- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 0a25b3cb5..2af3553ed 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1694,7 +1694,8 @@ class CI_DB_active_record extends CI_DB_driver { // is because until the user calls the from() function we don't know if there are aliases foreach ($this->ar_select as $key => $val) { - $this->ar_select[$key] = $this->_protect_identifiers($val, FALSE, $this->ar_no_escape[$key]); + $no_escape = isset($this->ar_no_escape[$key]) ? $this->ar_no_escape[$key] : NULL; + $this->ar_select[$key] = $this->_protect_identifiers($val, FALSE, $no_escape); } $sql .= implode(', ', $this->ar_select); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f5eb53aa3..e6c1425af 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -104,6 +104,7 @@ Change Log
  • Fixed issue #199 - Attributes passed as string does not include a space between it and the opening tag.
  • Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
  • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
  • +
  • Fixed a bug where using $this->db->select_max(), $this->db->select_min(), etc could throw notices. Thanks to w43l for the patch.
  • Version 2.0.2

    -- cgit v1.2.3-24-g4f1b From 99f6c8c4d71714e62a86cee5d2f7fbfa496a3c5a Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sat, 13 Aug 2011 10:26:04 -0600 Subject: Improved logic for plural() and singular() as words like "tax" would become "taxs" and it was tough to code in new rules. --- system/helpers/inflector_helper.php | 115 +++++++++++++++++++++--------------- 1 file changed, 67 insertions(+), 48 deletions(-) diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index c7c113b8a..7b99bc5b4 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -41,30 +41,48 @@ if ( ! function_exists('singular')) { function singular($str) { - $str = trim($str); - $end = substr($str, -3); - - $str = preg_replace('/(.*)?([s|c]h)es/i','$1$2',$str); - - if (strtolower($end) == 'ies') + $result = strval($str); + + $singular_rules = array( + '/(matr)ices$/' => '\1ix', + '/(vert|ind)ices$/' => '\1ex', + '/^(ox)en/' => '\1', + '/(alias)es$/' => '\1', + '/([octop|vir])i$/' => '\1us', + '/(cris|ax|test)es$/' => '\1is', + '/(shoe)s$/' => '\1', + '/(o)es$/' => '\1', + '/(bus|campus)es$/' => '\1', + '/([m|l])ice$/' => '\1ouse', + '/(x|ch|ss|sh)es$/' => '\1', + '/(m)ovies$/' => '\1\2ovie', + '/(s)eries$/' => '\1\2eries', + '/([^aeiouy]|qu)ies$/' => '\1y', + '/([lr])ves$/' => '\1f', + '/(tive)s$/' => '\1', + '/(hive)s$/' => '\1', + '/([^f])ves$/' => '\1fe', + '/(^analy)ses$/' => '\1sis', + '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/' => '\1\2sis', + '/([ti])a$/' => '\1um', + '/(p)eople$/' => '\1\2erson', + '/(m)en$/' => '\1an', + '/(s)tatuses$/' => '\1\2tatus', + '/(c)hildren$/' => '\1\2hild', + '/(n)ews$/' => '\1\2ews', + '/([^u])s$/' => '\1', + ); + + foreach ($singular_rules as $rule => $replacement) { - $str = substr($str, 0, strlen($str)-3).(preg_match('/[a-z]/',$end) ? 'y' : 'Y'); - } - elseif (strtolower($end) == 'ses') - { - $str = substr($str, 0, strlen($str)-2); - } - else - { - $end = strtolower(substr($str, -1)); - - if ($end == 's') + if (preg_match($rule, $result)) { - $str = substr($str, 0, strlen($str)-1); + $result = preg_replace($rule, $replacement, $result); + break; } } - return $str; + return $result; } } @@ -83,40 +101,41 @@ if ( ! function_exists('singular')) if ( ! function_exists('plural')) { function plural($str, $force = FALSE) - { - $str = trim($str); - $end = substr($str, -1); - - if (preg_match('/y/i',$end)) - { - // Y preceded by vowel => regular plural - $vowels = array('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'); - $str = in_array(substr($str, -2, 1), $vowels) ? $str.'s' : substr($str, 0, -1).'ies'; - } - elseif (preg_match('/h/i',$end)) - { - if(preg_match('/^[c|s]h$/i',substr($str, -2))) - { - $str .= 'es'; - } - else - { - $str .= 's'; - } - } - elseif (preg_match('/s/i',$end)) + { + $result = strval($str); + + $plural_rules = array( + '/^(ox)$/' => '\1\2en', // ox + '/([m|l])ouse$/' => '\1ice', // mouse, louse + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency + '/(hive)$/' => '\1s', // archive, hive + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife + '/sis$/' => 'ses', // basis, diagnosis + '/([ti])um$/' => '\1a', // datum, medium + '/(p)erson$/' => '\1eople', // person, salesperson + '/(m)an$/' => '\1en', // man, woman, spokesman + '/(c)hild$/' => '\1hildren', // child + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato + '/(bu|campu)s$/' => '\1\2ses', // bus, campus + '/(alias|status|virus)/' => '\1es', // alias + '/(octop)us$/' => '\1i', // octopus + '/(ax|cris|test)is$/' => '\1es', // axis, crisis + '/s$/' => 's', // no change (compatibility) + '/$/' => 's', + ); + + foreach ($plural_rules as $rule => $replacement) { - if ($force == TRUE) + if (preg_match($rule, $result)) { - $str .= 'es'; + $result = preg_replace($rule, $replacement, $result); + break; } } - else - { - $str .= 's'; - } - return $str; + return $result; } } -- cgit v1.2.3-24-g4f1b From fe1d45a023b08753f4c5f1d908d54ae842277558 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sat, 13 Aug 2011 11:06:57 -0600 Subject: Fixed conflicts. --- system/core/Input.php | 2 +- system/core/URI.php | 2 +- user_guide/changelog.html | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index dc7612e64..cfbef942d 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -672,7 +672,7 @@ class CI_Input { */ public function is_cli_request() { - return (bool) defined('STDIN'); + return (php_sapi_name() == 'cli') or defined('STDIN'); } } diff --git a/system/core/URI.php b/system/core/URI.php index d56548654..20f0f006b 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -62,7 +62,7 @@ class CI_URI { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { // Is the request coming from the command line? - if (defined('STDIN')) + if (php_sapi_name() == 'cli' or defined('STDIN')) { $this->_set_uri_string($this->_parse_cli_args()); return; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e6c1425af..9bebb7044 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -105,6 +105,7 @@ Change Log
  • Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
  • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
  • Fixed a bug where using $this->db->select_max(), $this->db->select_min(), etc could throw notices. Thanks to w43l for the patch.
  • +
  • Replace checks for STDIN with php_sapi_name() == 'cli' which on the whole is more reliable. This should get parameters in crontab working.
  • Version 2.0.2

    -- cgit v1.2.3-24-g4f1b From dd9b763ef18808637680237d78d8698799ccf8fa Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 10 Aug 2011 09:00:13 -0600 Subject: Fixed conflicts. --- application/config/mimes.php | 2 +- user_guide/changelog.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/config/mimes.php b/application/config/mimes.php index 8065794ff..82767d7c8 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -10,7 +10,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', - 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), + 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), 'bin' => 'application/macbinary', 'dms' => 'application/octet-stream', 'lha' => 'application/octet-stream', diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9bebb7044..783c9d3d1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,8 @@ Change Log
  • Removed internal usage of the EXT constant.
  • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
  • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
  • +
  • Added "application/x-csv" to mimes.php.
  • +
  • Helpers -- cgit v1.2.3-24-g4f1b From 9d887b32a1fe998cbb0307a5e678ac3ba5076a1e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 10 Aug 2011 08:06:37 -0600 Subject: Fixed conflicts in changelog. --- system/libraries/Email.php | 2 +- user_guide/changelog.html | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index cd89f8f3d..03eccea09 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -395,7 +395,7 @@ class CI_Email { public function attach($filename, $disposition = 'attachment') { $this->_attach_name[] = $filename; - $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); + $this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION)); $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters return $this; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 783c9d3d1..5d5767b74 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,7 +75,7 @@ Change Log
  • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
  • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
  • Added "application/x-csv" to mimes.php.
  • - +
  • Fixed a bug where Email library attachments with a "." in the name would using invalid MIME-types.
  • Helpers @@ -105,9 +105,15 @@ Change Log
  • Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.
  • Fixed issue #199 - Attributes passed as string does not include a space between it and the opening tag.
  • Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
  • +<<<<<<< HEAD
  • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
  • Fixed a bug where using $this->db->select_max(), $this->db->select_min(), etc could throw notices. Thanks to w43l for the patch.
  • Replace checks for STDIN with php_sapi_name() == 'cli' which on the whole is more reliable. This should get parameters in crontab working.
  • +======= +
  • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
  • +
  • Fixed a bug where using $this->db->select_max(), $this->db->select_min(), etc could throw notices. Thanks to w43l for the patch.
  • +
  • Fixed a bug where Email library attachments with a "." in the name would using invalid MIME-types.
  • +>>>>>>> 0aaf42b... Fixed a bug where Email library attachments with a . in the name would using invalid MIME-types.

    Version 2.0.2

    -- cgit v1.2.3-24-g4f1b From 4c76272593d82f45761c24917e69b42983f26171 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sat, 13 Aug 2011 11:31:22 -0600 Subject: Bumped the version number. Can somebody with a working find and replace fix up the docs? --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 03b25ab9e..94fecb5c0 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -32,7 +32,7 @@ * Define the CodeIgniter Version * ------------------------------------------------------ */ - define('CI_VERSION', '2.0.2'); + define('CI_VERSION', '2.0.3'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From b8c038a3e7742f32915d7f1ab69627075e8d0c39 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 20 Aug 2011 08:57:14 -0500 Subject: updated version number in user guide, removed some stray merge markers found in the change log --- user_guide/changelog.html | 10 ++-------- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/cli.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_drivers.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/drivers.html | 2 +- user_guide/general/environments.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/styleguide.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/captcha_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_163.html | 2 +- user_guide/installation/upgrade_170.html | 2 +- user_guide/installation/upgrade_171.html | 2 +- user_guide/installation/upgrade_172.html | 2 +- user_guide/installation/upgrade_200.html | 2 +- user_guide/installation/upgrade_201.html | 2 +- user_guide/installation/upgrade_202.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/caching.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/form_validation.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/security.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/typography.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/cheatsheets.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/getting_started.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 130 files changed, 131 insertions(+), 137 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5d5767b74..c52a33e5a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    @@ -60,7 +60,7 @@ Change Log

    The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

    Version 2.0.3

    -

    Release Date: Not Released

    +

    Release Date: August 20, 2011

    • Security @@ -105,15 +105,9 @@ Change Log
    • Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.
    • Fixed issue #199 - Attributes passed as string does not include a space between it and the opening tag.
    • Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
    • -<<<<<<< HEAD
    • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
    • Fixed a bug where using $this->db->select_max(), $this->db->select_min(), etc could throw notices. Thanks to w43l for the patch.
    • Replace checks for STDIN with php_sapi_name() == 'cli' which on the whole is more reliable. This should get parameters in crontab working.
    • -======= -
    • Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
    • -
    • Fixed a bug where using $this->db->select_max(), $this->db->select_min(), etc could throw notices. Thanks to w43l for the patch.
    • -
    • Fixed a bug where Email library attachments with a "." in the name would using invalid MIME-types.
    • ->>>>>>> 0aaf42b... Fixed a bug where Email library attachments with a . in the name would using invalid MIME-types.

    Version 2.0.2

    diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 62833813c..3f44fcd5b 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 3f4ef2bc3..16d380f5f 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 3e0c78d3d..38cbd1b2c 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 51d11c9f2..bbdd0a3c0 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index bb1b401f9..309f2bc1a 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 535fa3177..1bdecb79e 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 04d8b8096..3a1ea0cf2 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index cad2cf26f..6b8709892 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 107d2ed85..6a8aba55b 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 9c67e3b79..c85e9bf4c 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 4c1ddfe7d..e7333efc2 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 8ad6a1986..ec5f97762 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index a2aaa99a8..14ff28d40 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 74945d434..1a25f1657 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 582ea2ce4..8231c7e78 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index f69846f2e..27a1756e7 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index abd5845ff..a4ce418e9 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index a7365e706..fb78edaeb 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index fae0b5fd9..b65674fda 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index c77f9a15d..b40e770a9 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html index ed6fc85a8..befc9994a 100644 --- a/user_guide/general/cli.html +++ b/user_guide/general/cli.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index bfac32685..65457759d 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index c90916472..2d525141c 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 51c2c7440..b8917864f 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html index a7594056b..367755452 100644 --- a/user_guide/general/creating_drivers.html +++ b/user_guide/general/creating_drivers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 8198c18fe..aeec871b2 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 9e0fbac04..2785e7f25 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html index 8dbeb93a8..d0e4a1f1b 100644 --- a/user_guide/general/drivers.html +++ b/user_guide/general/drivers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/environments.html b/user_guide/general/environments.html index 175a1531e..38ce862b4 100644 --- a/user_guide/general/environments.html +++ b/user_guide/general/environments.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 58eff6597..83725dcc5 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 339a0df02..3747eb7b9 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 11de40902..c0d616c50 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index ce367cdeb..40533e124 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index ea886d9cb..e716d1072 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 117c810b7..1696f424a 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 78ece7dcd..9895b0284 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 9273708f3..242e9afb8 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index ab0e28857..405798f04 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 00bebff61..91d93a03b 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index d1d8d1a8e..c6429628e 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 0609afc48..5685bfa89 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 1f7a8a048..25fab6547 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -34,7 +34,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 421f51301..580b5fc54 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index ad93f4bc7..a2273f862 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 51c7ab519..956c54e8f 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 95ed672fe..991c2d3f1 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 453863149..3fbaa8fa1 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 44096ff46..f930ea3ae 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 1a2f28d7d..5623d5098 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 335e97d3d..cabacf8fe 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 8a3868a73..10730d7e4 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index c37235424..1194498a2 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 87e3c28b0..dd935ebd9 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 308013d51..92bfdfb2e 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 221c05907..d7fa959e8 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 3b3b87da9..1102d7a3c 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 51a4521a6..1ee7cbbdf 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index 584a127f9..103690cc8 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index e0cace325..7343da152 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 408df17c9..6f1fa5915 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 169ee4ebb..a3dc16598 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index f71d87840..496eccb73 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 00686a340..e7bd473a9 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index ded9aaa35..0dbe5577c 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/index.html b/user_guide/index.html index 2681004e3..bb1d21621 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f452ba471..f36b2bc0f 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 87da5189f..5e8ab3883 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 2a50b8dbf..943e2d802 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 563c98c60..357f68bbb 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index f7ffac74e..7ad26bbfd 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 7541a83ec..bc624261a 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 4fcbb46b9..beef9b279 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index c63465955..4d61ac601 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 2049628a6..721d70695 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index c19143c64..7c81d0521 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 342d486df..f622ea310 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index f601a252e..d350aae78 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index fe6978aac..50c6970e3 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index e5086813d..90abaf30b 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index d06f58ec9..16c53eb46 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 2dc2de59e..b167f1da4 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index 0add80f8a..015b7da75 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 73441397e..a1c3c8ff9 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 01597a416..a0e12c678 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index baee208a8..052af69f7 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index dbf0fb019..971453297 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index 0b24079ef..9f9dce7d0 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html index fe99cc0ce..036ef7c05 100644 --- a/user_guide/installation/upgrade_201.html +++ b/user_guide/installation/upgrade_201.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html index d457d8bbb..b6c62b4d5 100644 --- a/user_guide/installation/upgrade_202.html +++ b/user_guide/installation/upgrade_202.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index add7228c8..7cf06cd9d 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 014ffa3f3..58a45ee9d 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index c29acb7b2..c7b7ec9a7 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index f94a3d1a2..9b503f6d1 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index e1af71cc9..724c08f8b 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index f084d5dcf..3471eeb7e 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index be75801e0..d522bbc5b 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 5a8814d59..d246254ab 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 60099312c..5c64127cb 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index e4e842e5f..a88c67220 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 8fdcd1446..7c544b69f 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 43b949a50..6c7ed5c65 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index dbf07768e..475f02a56 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 08b8ab0d3..311f76ee9 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 5b7ef437b..09530e246 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 75863c2ac..1f670ea4b 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index a472730ca..af27176ad 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 4d1f8d97a..7361d7961 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3c366a69f..196555441 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index cb2f100a2..b8a53452e 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 735187459..dd62a4386 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 75ea0e6d7..e09c31db3 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index eeb3b421f..1f34dd9e2 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 7f89b4f5e..a2912a594 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 895e76f7d..cd287933c 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 5e0c4c16b..5ebec0cbf 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index e4e0f9d3f..0e1c26f1e 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 24e8071f3..e1d3640d3 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 5ba851341..3635c221b 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 087b4adfb..21cf8017a 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/license.html b/user_guide/license.html index 8f53851a7..a0d694f2e 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index bcbc43ff8..c6bf857b4 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index b6b81d760..641c04b22 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index 1c58c584f..b7b10b90c 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index e20219e0f..5f71c5083 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index f120913f4..2b6b3f288 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 754ecaae0..6acaa65a2 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index bbe3e36f3..08e61e283 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 91cf64977..4721cbf67 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    diff --git a/user_guide/toc.html b/user_guide/toc.html index f6a5fe0ec..033114873 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -29,7 +29,7 @@
    - +

    CodeIgniter User Guide Version 2.0.2

    CodeIgniter User Guide Version 2.0.3

    -- cgit v1.2.3-24-g4f1b