From a58ecae8e149fe8e1fa9ee3cc9c9ad23a67ab8b6 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 10:32:10 +0000 Subject: Name can be omiitted from ->dbforge->modify_column()'s 2nd param if you aren't changing the name. --- system/database/DB_forge.php | 6 ++++++ user_guide/database/forge.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index f40eac82d..ce505f4ee 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -333,6 +333,12 @@ class CI_DB_forge { foreach ($field as $k => $v) { + // If no name provided, use the current name + if ( ! isset($field[$k]['name'])) + { + $field[$k]['name'] = $k; + } + $this->add_field(array($k => $field[$k])); if (count($this->fields) == 0) diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 28b32d96a..b9e04428c 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -205,7 +205,7 @@ $this->dbforge->add_column('table_name', $fields);

Used to remove a column from a table.

$this->dbforge->drop_column('table_name', 'column_to_drop');

$this->dbforge->modify_column()

-

The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

+

The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to change the name you can add a "name" key into the field defining array.

$fields = array(
                        'old_name' => array(
                                                         'name' => 'new_name',
-- cgit v1.2.3-24-g4f1b From 1e74da235f7739e3d9b5e1f84cda6313499cefa1 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 10:45:06 +0000 Subject: Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name. --- system/libraries/Upload.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 4ccbdde90..b0e1f4c6c 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -212,7 +212,18 @@ class CI_Upload { if ($this->_file_name_override != '') { $this->file_name = $this->_prep_filename($this->_file_name_override); - $this->file_ext = $this->get_extension($this->file_name); + + // If no extension was provided in the file_name config item, use the uploaded one + if(strpos($this->_file_name_override, '.') === FALSE) + { + $this->file_name .= $this->file_ext; + } + + // An extension was provided, lets have it! + else + { + $this->file_ext = $this->get_extension($this->_file_name_override); + } if ( ! $this->is_allowed_filetype(TRUE)) { -- cgit v1.2.3-24-g4f1b From 9a311fd3c45faadb7081a48b068f07c0f44b9e5e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 10:50:15 +0000 Subject: Package paths can now be auto-loaded in autoload.php. --- application/config/autoload.php | 25 +++++++++++++++++++------ system/core/Loader.php | 9 +++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/application/config/autoload.php b/application/config/autoload.php index 5e9740844..90b1a808f 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -18,14 +18,28 @@ | | These are the things you can load automatically: | -| 1. Libraries -| 2. Helper files -| 3. Custom config files -| 4. Language files -| 5. Models +| 1. Packages +| 2. Libraries +| 3. Helper files +| 4. Custom config files +| 5. Language files +| 6. Models | */ +/* +| ------------------------------------------------------------------- +| Auto-load Packges +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared'); +| +*/ + +$autoload['packages'] = array(APPPATH.'third_party'); + + /* | ------------------------------------------------------------------- | Auto-load Libraries @@ -98,6 +112,5 @@ $autoload['language'] = array(); $autoload['model'] = array(); - /* End of file autoload.php */ /* Location: ./application/config/autoload.php */ \ No newline at end of file diff --git a/system/core/Loader.php b/system/core/Loader.php index 4b6b19eea..afbae6175 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -942,6 +942,15 @@ class CI_Loader { return FALSE; } + // Autoload packages + if (isset($autoload['packages'])) + { + foreach ($autoload['packages'] as $package_path) + { + $this->add_package_path($package_path); + } + } + // Load any custom config file if (count($autoload['config']) > 0) { -- cgit v1.2.3-24-g4f1b From fd6948997faf5f064f76353da65bd1d0ec65ec51 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 10:52:37 +0000 Subject: Potential PHP 5.4 issue, get_magic_quotes_gpc() is being removed. This change will check the function exists before calling it in Input. --- system/core/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Input.php b/system/core/Input.php index 9d8811cdd..5a227332c 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -492,7 +492,7 @@ class CI_Input { } // We strip slashes if magic quotes is on to keep things consistent - if (get_magic_quotes_gpc()) + if (function_exists('get_magic_quotes_gpc') AND get_magic_quotes_gpc()) { $str = stripslashes($str); } -- cgit v1.2.3-24-g4f1b From 65d603e03d3befd6e4f13361c78ab454ea57ba70 Mon Sep 17 00:00:00 2001 From: Dan Horrigan Date: Wed, 15 Dec 2010 08:38:30 -0500 Subject: Added full Query String and $_GET array support. This is enabled by default. Added a seperate config option to enable/disable the $_GET array. --- application/config/config.php | 4 ++ system/core/Input.php | 4 +- system/core/URI.php | 100 +++++++++++++++++++++++++++++------------- 3 files changed, 75 insertions(+), 33 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 2a084ac22..477d7bfc4 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -134,6 +134,9 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; | By default CodeIgniter uses search-engine friendly segment based URLs: | example.com/who/what/where/ | +| By default CodeIgniter enables access to the $_GET array. If for some +| reason you would like to disable it, set 'allow_get_array' to FALSE. +| | You can optionally enable standard query string based URLs: | example.com?who=me&what=something&where=here | @@ -148,6 +151,7 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; | use segment based URLs. | */ +$config['allow_get_array'] = TRUE; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; diff --git a/system/core/Input.php b/system/core/Input.php index 9d8811cdd..4ddc402ee 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -30,7 +30,7 @@ class CI_Input { var $ip_address = FALSE; var $user_agent = FALSE; - var $_allow_get_array = FALSE; + var $_allow_get_array = TRUE; var $_standardize_newlines = TRUE; var $_enable_xss = FALSE; // Set automatically based on config setting var $_enable_csrf = FALSE; // Set automatically based on config setting @@ -49,7 +49,7 @@ class CI_Input { { log_message('debug', "Input Class Initialized"); - $this->_allow_get_array = (config_item('enable_query_strings') === TRUE) ? TRUE : FALSE; + $this->_allow_get_array = (config_item('allow_get_array') === TRUE) ? TRUE : FALSE; $this->_enable_xss = (config_item('global_xss_filtering') === TRUE) ? TRUE : FALSE; $this->_enable_csrf = (config_item('csrf_protection') === TRUE) ? TRUE : FALSE; diff --git a/system/core/URI.php b/system/core/URI.php index 5a5a37cc6..f6487d3f9 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -61,13 +61,10 @@ class CI_URI { { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { - // If the URL has a question mark then it's simplest to just - // build the URI string from the zero index of the $_GET array. - // This avoids having to deal with $_SERVER variables, which - // can be unreliable in some environments - if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') + // Let's try the REQUEST_URI first, this will work in most situations + if ($uri = $this->_get_request_uri()) { - $this->uri_string = key($_GET); + $this->uri_string = $this->_parse_request_uri($uri); return; } @@ -88,12 +85,10 @@ class CI_URI { return; } - // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? - $path = str_replace($_SERVER['SCRIPT_NAME'], '', (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO')); - if (trim($path, '/') != '' && $path != "/".SELF) + // As a last ditch effort lets try using the $_GET array + if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') { - // remove path and script information so we have good URI data - $this->uri_string = $path; + $this->uri_string = key($_GET); return; } @@ -106,7 +101,7 @@ class CI_URI { if ($uri == 'REQUEST_URI') { - $this->uri_string = $this->_parse_request_uri(); + $this->uri_string = $this->_parse_request_uri($this->_get_request_uri()); return; } @@ -123,36 +118,68 @@ class CI_URI { // -------------------------------------------------------------------- /** - * Parse the REQUEST_URI + * Get REQUEST_URI * - * Due to the way REQUEST_URI works it usually contains path info - * that makes it unusable as URI data. We'll trim off the unnecessary - * data, hopefully arriving at a valid URI that we can use. + * Retrieves the REQUEST_URI, or equivelent for IIS. * * @access private * @return string */ - function _parse_request_uri() + function _get_request_uri() { - if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') + $uri = FALSE; + + // Let's check for standard servers first + if (isset($_SERVER['REQUEST_URI'])) { - return ''; + $uri = $_SERVER['REQUEST_URI']; + if (strpos($uri, $_SERVER['HTTP_HOST']) !== FALSE) + { + $uri = preg_replace('/^\w+:\/\/[^\/]+/','',$uri); + } } - - $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - - if ($request_uri == '' OR $request_uri == SELF) + // Now lets check for IIS + elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { - return ''; + $uri = $_SERVER['HTTP_X_REWRITE_URL']; + } + // Last ditch effort (for older CGI servers, like IIS 5) + elseif (isset($_SERVER['ORIG_PATH_INFO'])) + { + $uri = $_SERVER['ORIG_PATH_INFO']; + if ( ! empty($_SERVER['QUERY_STRING'])) + { + $uri .= '?'.$_SERVER['QUERY_STRING']; + } } - $fc_path = FCPATH.SELF; - if (strpos($request_uri, '?') !== FALSE) + return $uri; + } + + // -------------------------------------------------------------------- + + /** + * Parse REQUEST_URI + * + * Due to the way REQUEST_URI works it usually contains path info + * that makes it unusable as URI data. We'll trim off the unnecessary + * data, hopefully arriving at a valid URI that we can use. + * + * @access private + * @param string + * @return string + */ + function _parse_request_uri($uri) + { + // Some server's require URL's like index.php?/whatever If that is the case, + // then we need to add that to our parsing. + $fc_path = ltrim(FCPATH.SELF, '/'); + if (strpos($uri, SELF.'?') !== FALSE) { $fc_path .= '?'; } - $parsed_uri = explode("/", $request_uri); + $parsed_uri = explode('/', ltrim($uri, '/')); $i = 0; foreach(explode("/", $fc_path) as $segment) @@ -163,14 +190,25 @@ class CI_URI { } } - $parsed_uri = implode("/", array_slice($parsed_uri, $i)); + $uri = implode("/", array_slice($parsed_uri, $i)); + + // Let's take off any query string and re-assign $_SERVER['QUERY_STRING'] and $_GET. + // This is only needed on some servers. However, we are forced to use it to accomodate + // them. + if (($qs_pos = strpos($uri, '?')) !== FALSE) + { + $_SERVER['QUERY_STRING'] = substr($uri, $qs_pos + 1); + parse_str($_SERVER['QUERY_STRING'], $_GET); + $uri = substr($uri, 0, $qs_pos); + } - if ($parsed_uri != '') + // If it is just a / or index.php then just empty it. + if ($uri == '/' || $uri == SELF) { - $parsed_uri = '/'.$parsed_uri; + $uri = ''; } - return $parsed_uri; + return $uri; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 4df8b2276bbcc7f025a41b0d09f2f8cd7927b51a Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 14:23:14 +0000 Subject: ['base_url'] is now empty by default and will guess what it should be. --- application/config/config.php | 37 ++++++++++++++++++---------------- system/core/Config.php | 46 +++++++++++++++++++++---------------------- user_guide/changelog.html | 4 ++++ 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 2a084ac22..251f1aa3f 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -10,8 +10,11 @@ | | http://example.com/ | +| If this is not set then CodeIgniter will guess the protocol, domain and +| path to your installation. +| */ -$config['base_url'] = "http://example.com/"; +$config['base_url'] = ''; /* |-------------------------------------------------------------------------- @@ -23,7 +26,7 @@ $config['base_url'] = "http://example.com/"; | variable so that it is blank. | */ -$config['index_page'] = "index.php"; +$config['index_page'] = 'index.php'; /* |-------------------------------------------------------------------------- @@ -31,7 +34,7 @@ $config['index_page'] = "index.php"; |-------------------------------------------------------------------------- | | This item determines which server global should be used to retrieve the -| URI string. The default setting of "AUTO" works for most servers. +| URI string. The default setting of 'AUTO' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | | 'AUTO' Default - auto detects @@ -41,7 +44,7 @@ $config['index_page'] = "index.php"; | 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO | */ -$config['uri_protocol'] = "AUTO"; +$config['uri_protocol'] = 'AUTO'; /* |-------------------------------------------------------------------------- @@ -54,7 +57,7 @@ $config['uri_protocol'] = "AUTO"; | http://codeigniter.com/user_guide/general/urls.html */ -$config['url_suffix'] = ""; +$config['url_suffix'] = ''; /* |-------------------------------------------------------------------------- @@ -66,7 +69,7 @@ $config['url_suffix'] = ""; | than english. | */ -$config['language'] = "english"; +$config['language'] = 'english'; /* |-------------------------------------------------------------------------- @@ -77,14 +80,14 @@ $config['language'] = "english"; | that require a character set to be provided. | */ -$config['charset'] = "UTF-8"; +$config['charset'] = 'UTF-8'; /* |-------------------------------------------------------------------------- | Enable/Disable System Hooks |-------------------------------------------------------------------------- | -| If you would like to use the "hooks" feature you must enable it by +| If you would like to use the 'hooks' feature you must enable it by | setting this variable to TRUE (boolean). See the user guide for details. | */ @@ -139,7 +142,7 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; | | Options are: TRUE or FALSE (boolean) | -| The other items let you set the query string "words" that will +| The other items let you set the query string 'words' that will | invoke your controllers and its functions: | example.com/index.php?c=controller&m=function | @@ -217,7 +220,7 @@ $config['cache_path'] = ''; | MUST set an encryption key. See the user guide for info. | */ -$config['encryption_key'] = ""; +$config['encryption_key'] = ''; /* |-------------------------------------------------------------------------- @@ -257,9 +260,9 @@ $config['sess_time_to_update'] = 300; | 'cookie_path' = Typically will be a forward slash | */ -$config['cookie_prefix'] = ""; -$config['cookie_domain'] = ""; -$config['cookie_path'] = "/"; +$config['cookie_prefix'] = ''; +$config['cookie_domain'] = ''; +$config['cookie_path'] = '/'; /* |-------------------------------------------------------------------------- @@ -297,7 +300,7 @@ $config['csrf_protection'] = FALSE; | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called -| by the output class. Do not "echo" any values with compression enabled. +| by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = FALSE; @@ -307,9 +310,9 @@ $config['compress_output'] = FALSE; | Master Time Reference |-------------------------------------------------------------------------- | -| Options are "local" or "gmt". This pref tells the system whether to use -| your server's local time as the master "now" reference, or convert it to -| GMT. See the "date helper" page of the user guide for information +| Options are 'local' or 'gmt'. This pref tells the system whether to use +| your server's local time as the master 'now' reference, or convert it to +| GMT. See the 'date helper' page of the user guide for information | regarding date handling. | */ diff --git a/system/core/Config.php b/system/core/Config.php index bdd1b8333..506af0d99 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -47,6 +47,25 @@ class CI_Config { { $this->config =& get_config(); log_message('debug', "Config Class Initialized"); + + // Set the base_url automatically if none was provided + if ($this->config['base_url'] == '') + { + // Base URL (keeps this crazy sh*t out of the config.php + if(isset($_SERVER['HTTP_HOST'])) + { + $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http'; + $base_url .= '://'. $_SERVER['HTTP_HOST']; + $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); + } + + else + { + $base_url = 'http://localhost/'; + } + + $this->set_item('base_url', $base_url); + } } // -------------------------------------------------------------------- @@ -185,14 +204,7 @@ class CI_Config { return FALSE; } - $pref = $this->config[$item]; - - if ($pref != '' && substr($pref, -1) != '/') - { - $pref .= '/'; - } - - return $pref; + return rtrim($this->config[$item], '/').'/'; } // -------------------------------------------------------------------- @@ -208,14 +220,7 @@ class CI_Config { { if ($uri == '') { - if ($this->item('base_url') == '') - { - return $this->item('index_page'); - } - else - { - return $this->slash_item('base_url').$this->item('index_page'); - } + return $this->slash_item('base_url').$this->item('index_page'); } if ($this->item('enable_query_strings') == FALSE) @@ -244,14 +249,7 @@ class CI_Config { $uri = $str; } - if ($this->item('base_url') == '') - { - return $this->item('index_page').'?'.$uri; - } - else - { - return $this->slash_item('base_url').$this->item('index_page').'?'.$uri; - } + return $this->slash_item('base_url').$this->item('index_page').'?'.$uri; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c3693e5f9..30734a835 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -76,6 +76,10 @@ Hg Tag:

  • In-development code is now hosted at BitBucket.
  • Removed the deprecated Validation Class.
  • Added CI_ Prefix to all core classes.
  • +
  • Package paths can now be set in application/config/autoload.php.
  • +
  • Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.
  • +
  • Name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.
  • +
  • $config['base_url'] is now empty by default and will guess what it should be.
  • Libraries

    Replacing Core Classes

    -- cgit v1.2.3-24-g4f1b From 5dd84d04294b622f8b85f8aaac54d8329a2ae173 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 20 Jan 2011 00:17:47 -0500 Subject: Moving the file to Utf8.php --- system/core/Unicode.php | 165 ------------------------------------------------ system/core/Utf8.php | 165 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 165 deletions(-) delete mode 100644 system/core/Unicode.php create mode 100644 system/core/Utf8.php diff --git a/system/core/Unicode.php b/system/core/Unicode.php deleted file mode 100644 index 291bfb2eb..000000000 --- a/system/core/Unicode.php +++ /dev/null @@ -1,165 +0,0 @@ -item('charset') == 'UTF-8' // Application charset must be UTF-8 - ) - { - log_message('debug', "UTF-8 Support Enabled"); - - define('UTF8_ENABLED', TRUE); - - // set internal encoding for multibyte string functions if necessary - // and set a flag so we don't have to repeatedly use extension_loaded() - // or function_exists() - if (extension_loaded('mbstring')) - { - define('MB_ENABLED', TRUE); - mb_internal_encoding('UTF-8'); - } - else - { - define('MB_ENABLED', FALSE); - } - } - else - { - log_message('debug', "UTF-8 Support Disabled"); - define('UTF8_ENABLED', FALSE); - } - } - - // -------------------------------------------------------------------- - - /** - * Clean UTF-8 strings - * - * Ensures strings are UTF-8 - * - * @access public - * @param string - * @return string - */ - function clean_string($str) - { - if ($this->_is_ascii($str) === FALSE) - { - $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Remove ASCII control characters - * - * Removes all ASCII control characters except horizontal tabs, - * line feeds, and carriage returns, as all others can cause - * problems in XML - * - * @access public - * @param string - * @return string - */ - function safe_ascii_for_xml($str) - { - return preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S', '', $str); - } - - // -------------------------------------------------------------------- - - /** - * Convert to UTF-8 - * - * Attempts to convert a string to UTF-8 - * - * @access public - * @param string - * @param string - input encoding - * @return string - */ - function convert_to_utf8($str, $encoding) - { - if (function_exists('iconv')) - { - $str = @iconv($encoding, 'UTF-8', $str); - } - elseif (function_exists('mb_convert_encoding')) - { - $str = @mb_convert_encoding($str, 'UTF-8', $encoding); - } - else - { - return FALSE; - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Is ASCII? - * - * Tests if a string is standard 7-bit ASCII or not - * - * @access public - * @param string - * @return bool - */ - function _is_ascii($str) - { - return (preg_match('/[^\x00-\x7F]/S', $str) == 0); - } - - // -------------------------------------------------------------------- - -} -// End Utf8 Class - -/* End of file Utf8.php */ -/* Location: ./system/core/Utf8.php */ \ No newline at end of file diff --git a/system/core/Utf8.php b/system/core/Utf8.php new file mode 100644 index 000000000..291bfb2eb --- /dev/null +++ b/system/core/Utf8.php @@ -0,0 +1,165 @@ +item('charset') == 'UTF-8' // Application charset must be UTF-8 + ) + { + log_message('debug', "UTF-8 Support Enabled"); + + define('UTF8_ENABLED', TRUE); + + // set internal encoding for multibyte string functions if necessary + // and set a flag so we don't have to repeatedly use extension_loaded() + // or function_exists() + if (extension_loaded('mbstring')) + { + define('MB_ENABLED', TRUE); + mb_internal_encoding('UTF-8'); + } + else + { + define('MB_ENABLED', FALSE); + } + } + else + { + log_message('debug', "UTF-8 Support Disabled"); + define('UTF8_ENABLED', FALSE); + } + } + + // -------------------------------------------------------------------- + + /** + * Clean UTF-8 strings + * + * Ensures strings are UTF-8 + * + * @access public + * @param string + * @return string + */ + function clean_string($str) + { + if ($this->_is_ascii($str) === FALSE) + { + $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Remove ASCII control characters + * + * Removes all ASCII control characters except horizontal tabs, + * line feeds, and carriage returns, as all others can cause + * problems in XML + * + * @access public + * @param string + * @return string + */ + function safe_ascii_for_xml($str) + { + return preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S', '', $str); + } + + // -------------------------------------------------------------------- + + /** + * Convert to UTF-8 + * + * Attempts to convert a string to UTF-8 + * + * @access public + * @param string + * @param string - input encoding + * @return string + */ + function convert_to_utf8($str, $encoding) + { + if (function_exists('iconv')) + { + $str = @iconv($encoding, 'UTF-8', $str); + } + elseif (function_exists('mb_convert_encoding')) + { + $str = @mb_convert_encoding($str, 'UTF-8', $encoding); + } + else + { + return FALSE; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Is ASCII? + * + * Tests if a string is standard 7-bit ASCII or not + * + * @access public + * @param string + * @return bool + */ + function _is_ascii($str) + { + return (preg_match('/[^\x00-\x7F]/S', $str) == 0); + } + + // -------------------------------------------------------------------- + +} +// End Utf8 Class + +/* End of file Utf8.php */ +/* Location: ./system/core/Utf8.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 700205ad5cb6c00596ad82d5ed282f516add5481 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 07:44:28 -0600 Subject: updating copyrights to 2011 --- system/libraries/Cache/Cache.php | 2 +- system/libraries/Cache/drivers/Cache_apc.php | 2 +- system/libraries/Cache/drivers/Cache_dummy.php | 2 +- system/libraries/Cache/drivers/Cache_file.php | 2 +- system/libraries/Cache/drivers/Cache_memcached.php | 2 +- system/libraries/Cart.php | 2 +- system/libraries/Driver.php | 2 +- user_guide/changelog.html | 2 +- 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/doc_style/template.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/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/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/url_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_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/jquery.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 +- 136 files changed, 136 insertions(+), 136 deletions(-) diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index ea3194237..d3f6105ea 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index 9c716a971..e82e8e1f5 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index 13c1f5cde..74f689241 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php index bedbfaff8..3ed357f2f 100644 --- a/system/libraries/Cache/drivers/Cache_file.php +++ b/system/libraries/Cache/drivers/Cache_file.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php index adc7fbf44..a7efdc5de 100644 --- a/system/libraries/Cache/drivers/Cache_memcached.php +++ b/system/libraries/Cache/drivers/Cache_memcached.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 5d3f91d43..7f65b48b9 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index 8579a6023..15fc3da26 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2006 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3fd2a465a..7fa9ac665 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1221,7 +1221,7 @@ Previous Topic:  License Agreement User Guide Home   ·   Next Topic:  Credits

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 9ae93a9ae..30c45fdde 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -750,7 +750,7 @@ Previous Topic:  Query Helper Functions User Guide Home   ·   Next Topic:  Transactions

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index d5ed5885d..ec2e5c40b 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -213,7 +213,7 @@ Previous Topic:  Custom Function CallsUser Guide Home   ·   Next Topic:  Database manipulation with Database Forge

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 46dfe89dc..e34369f37 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -111,7 +111,7 @@ Previous Topic:  Field MetaData User Guide Home   ·   Next Topic:  Query Caching

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 893db6221..8e6fe1f42 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -159,7 +159,7 @@ Previous Topic:  Quick Start: Usage ExamplesUser Guide Home   ·   Next Topic:  Connecting to your Database

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 3ce405629..1e971986e 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -181,7 +181,7 @@ Previous Topic:  Database ConfigurationUser Guide Home   ·   Next Topic:  Queries

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 41cfba0eb..c0eabd846 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -210,7 +210,7 @@ Previous Topic:  Database Class User Guide Home   ·   Next Topic:  Database Configuration

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index e5cc4777d..b1dbd0012 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -156,7 +156,7 @@ Previous Topic:   Table Data User Guide Home   ·   Next Topic:  Custom Function Calls

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index b9e04428c..d18db5820 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -227,7 +227,7 @@ Previous Topic:  DB Caching Class Top of Page   ·   User Guide Home   ·   Next Topic:  Database Utilities Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index b7b8a538c..f4ad8dfe6 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -144,7 +144,7 @@ Previous Topic:  Query Results User Guide Home   ·   Next Topic:  Active Record Pattern

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 381592c26..cc2d2166b 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -92,7 +92,7 @@ Previous Topic:  Config Class User Guide Home   ·   Next Topic:  Quick Start: Usage Examples

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index c8a304943..e3d6ab186 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -146,7 +146,7 @@ Previous Topic:  Connecting to your Database User Guide Home   ·   Next Topic:  Query Results

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 410dac840..75cb190f9 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -231,7 +231,7 @@ Previous Topic:  Queries User Guide Home   ·   Next Topic:  Query Helper Functions

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 8b86ed58e..90ce478da 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -106,7 +106,7 @@ Previous Topic:   Transactions User Guide Home   ·   Next Topic:   Field Metadata

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index c6ecac6fb..448e468d9 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -193,7 +193,7 @@ Previous Topic:   Field MetaData   User Guide Home   ·   Next Topic:  Table Metadata

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 1ce63d3a0..d4296fe2e 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -307,7 +307,7 @@ Previous Topic:  DB Forge Class Top of Page   ·   User Guide Home   ·   Next Topic:   Email Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 22637d389..2d2718d44 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -80,7 +80,7 @@ Previous Topic:  PHP Style Guide< User Guide Home   ·   Next Topic:  Benchmarking Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index d5ef5caa4..d59d5e4ed 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -121,7 +121,7 @@ Previous Topic:  Previous Class User Guide Home   ·   Next Topic:  Next Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 3193c0585..652cdad29 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -140,7 +140,7 @@ Previous Topic:  Managing ApplicationsUser Guide Home   ·   Next Topic:  Security

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 92a8fd952..fc5d0bec5 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -110,7 +110,7 @@ Previous Topic:  Creating Core Libra User Guide Home   ·   Next Topic:  Auto-loading Resources

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index adcd2269a..e05ee03ef 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -93,7 +93,7 @@ Previous Topic:  Hooks - Extending the Core Top of Page   ·   User Guide Home   ·   Next Topic:  Common Functions

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 5c1bcfd0a..440896bb7 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -108,7 +108,7 @@ Previous Topic:  Error Handling User Guide Home   ·   Next Topic:  Profiling Your Application

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 0e68d1113..03c455346 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -118,7 +118,7 @@ Previous Topic:  Auto-loading Resources< Top of Page   ·   User Guide Home   ·   Next Topic:  URI Routing

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 3a85ca38a..91e700aba 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -381,7 +381,7 @@ Previous Topic:  CodeIgniter URLs Top of Page   ·   User Guide Home   ·   Next Topic:  Reserved Names

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index e36a5e2b9..11410a31f 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -179,7 +179,7 @@ Previous Topic:  Creating Your Own L User Guide Home   ·   Next Topic:  Hooks - Extending the Core

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html index 920cc16cb..6208dd5d3 100644 --- a/user_guide/general/creating_drivers.html +++ b/user_guide/general/creating_drivers.html @@ -93,7 +93,7 @@ Previous Topic:  Using CodeIgniter Drivers User Guide Home   ·   Next Topic:  Creating Core System Classes

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index e700f30fc..b7b66f0c1 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -286,7 +286,7 @@ Previous Topic:  Using CodeIgniter Libraries< User Guide Home   ·   Next Topic:  Using CodeIgniter Drivers

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 5423d5838..b6915924c 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -79,7 +79,7 @@ Previous Topic:  Change Log User Guide Home   ·   Next Topic:  Downloading CodeIgniter

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html index 3163c11a7..83ed9852d 100644 --- a/user_guide/general/drivers.html +++ b/user_guide/general/drivers.html @@ -97,7 +97,7 @@ Previous Topic:  Creating Libraries< User Guide Home   ·   Next Topic:  Creating Drivers

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 5bd5011ae..98af3f0c7 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -133,7 +133,7 @@ Previous Topic:  URI Routing User Guide Home   ·   Next Topic:  Page Caching

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 98c0dca85..cc3e22644 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -178,7 +178,7 @@ Previous Topic:  Models User Guide Home   ·   Next Topic:  Using Libraries

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 0d87f3b2b..1a77389a9 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -158,7 +158,7 @@ Previous Topic:  Creating Core Classes User Guide Home   ·   Next Topic:  Auto-loading Resources

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index dc0d9b6c6..82c409bf0 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -91,7 +91,7 @@ Previous Topic:  Helpers User Guide Home   ·   Next Topic:  Creating Libraries

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index a1a96cf82..4b4493dce 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -126,7 +126,7 @@ Previous Topic:  Profiling Your ApplicationUser Guide Home   ·   Next Topic:  Alternative PHP Syntax

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/models.html b/user_guide/general/models.html index eb6962f0a..9afec7ef2 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -244,7 +244,7 @@ Previous Topic:  Views User Guide Home   ·   Next Topic:  Helpers

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 7cb3f158d..c8d7eb431 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -169,7 +169,7 @@ Previous Topic:  Caching User Guide Home   ·   Next Topic:  Managing Applications

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index d90e9620c..388f25978 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -70,7 +70,7 @@ Quick Reference Chart Top of Page   ·   User Guide Home

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 6ae3da78f..fbe38261d 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -75,7 +75,7 @@ Server Requirements User Guide Home   ·   Next Topic:  License Agreement

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 3115d6a8a..c12ee6e15 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -120,7 +120,7 @@ Previous Topic:  Controllers Top of Page   ·   User Guide Home   ·   Next Topic:  Views

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index a423eaa8d..e973d2351 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -159,7 +159,7 @@ Previous Topic:  Common Functions User Guide Home   ·   Next Topic:  Error Handling

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 1a0ed13fd..8a41dff9d 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -146,7 +146,7 @@ Previous Topic:  Alternative PHP User Guide Home   ·   Next Topic:  PHP Style Guide

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index f30f45529..caddddcc4 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -672,7 +672,7 @@ Previous Topic:  Security User Guide Home   ·   Next Topic:  Writing Documentation

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index abddea83b..4ce6c3995 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -144,7 +144,7 @@ segment based URLs.

    Top of Page   ·   User Guide Home   ·   Next Topic:  Controllers

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 228eb64b5..fd5bde6af 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -267,7 +267,7 @@ Previous Topic:  Reserved Names User Guide Home   ·   Next Topic:  Models

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 6d95c4a5f..2bbf89cad 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -163,7 +163,7 @@ Previous Topic:   Zip Encoding ClassTop of Page   ·   User Guide Home   ·   Next Topic:  Compatibility Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index d6eb0652c..3a863c995 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -188,7 +188,7 @@ Previous Topic:  URL Helper Top of Page   ·   User Guide Home

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index d0471d716..860979bd8 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -100,7 +100,7 @@ Previous Topic:  Compatibility Hel Top of Page   ·   User Guide Home   ·   Next Topic:  Date Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 59641a9e8..ba9aa8ef5 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -401,7 +401,7 @@ Previous Topic:  Cookie Helper User Guide Home   ·   Next Topic:  Directory Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 6e4faef02..d9a3d0e99 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -136,7 +136,7 @@ Previous Topic:  Date Helper User Guide Home   ·   Next Topic:  Download Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 4c0e20172..7fc9c440e 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -105,7 +105,7 @@ Previous Topic:  Directory Helper Top of Page   ·   User Guide Home   ·   Next Topic:  Email Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 0084ada10..6e11ba0e6 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -95,7 +95,7 @@ Previous Topic:  Download Helper Top of Page   ·   User Guide Home   ·   Next Topic:  File Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index dd9df9540..85a76e100 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -172,7 +172,7 @@ Previous Topic:  Email Helper Top of Page   ·   User Guide Home   ·   Next Topic:  Form Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 0aaa8f60f..62544c459 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -477,7 +477,7 @@ Previous Topic:  File Helper User Guide Home   ·   Next Topic:  HTML Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 845ecf109..07fd6d3dc 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -378,7 +378,7 @@ Previous Topic:  Form Helper Top of Page   ·   User Guide Home   ·   Next Topic:   Path Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 9dcd1fc78..bd44fea74 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -144,7 +144,7 @@ Previous Topic:   HTML Helper User Guide Home   ·   Next Topic:  Number Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index ada6c60ea..5c0cb26d5 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -91,7 +91,7 @@ Previous Topic:  Date Helper User Guide Home   ·   Next Topic:  Download Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 9274e0cf3..afe5bc3fe 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -106,7 +106,7 @@ Previous Topic:  Inflector Helper User Guide Home   ·   Next Topic:  Path Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index c1d7b0206..205cce20e 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -99,7 +99,7 @@ Previous Topic:  Number Helper User Guide Home   ·   Next Topic:  Security Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index f74a7766c..2dba7bb8e 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -125,7 +125,7 @@ Previous Topic:   Path Helper Top of Page   ·   User Guide Home   ·   Next Topic:  Smiley Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 6846b78e7..18df9876f 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -208,7 +208,7 @@ Previous Topic:  Security Helper User Guide Home   ·   Next Topic:  String Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index d3f97fb52..11b6b2736 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -171,7 +171,7 @@ Previous Topic:  Smiley Helper User Guide Home   ·   Next Topic:  Text Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 6a68180b6..a7f0f2b18 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -204,7 +204,7 @@ Previous Topic:  String Helper User Guide Home   ·   Next Topic:  Typography Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 96a68e9f0..425c20ec1 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -105,7 +105,7 @@ Previous Topic:  Text Helper User Guide Home   ·   Next Topic:  URL Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 5b4780246..6d8bdc240 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -281,7 +281,7 @@ Previous Topic:  Typography HelperUser Guide Home   ·   Next Topic:  XML Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 50179ce4b..446a01d8c 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -98,7 +98,7 @@ Previous Topic:  URL Helper Top of Page   ·   User Guide Home

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/index.html b/user_guide/index.html index a1d56d48e..882eec0f8 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -90,7 +90,7 @@ minimizing the amount of code needed for a given task.

    diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f557a7887..d580fde7b 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -102,7 +102,7 @@ Previous Topic:  Credits User Guide Home   ·   Next Topic:  Installation Instructions

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 973d21064..9a611eb41 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -95,7 +95,7 @@ Previous Topic:  Credits Next Topic:  Upgrading from a Previous Version

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 0c05ed60f..c1c423a76 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -83,7 +83,7 @@ Previous Topic:  Upgrading from a Previous Ve User Guide Home   ·   Next Topic:  CodeIgniter at a Glance

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index ec947274a..da49549a5 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -85,7 +85,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index bd43dd9e8..759177612 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -196,7 +196,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index db02b481c..a2f742532 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -95,7 +95,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 2caf9771c..e0e562231 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -93,7 +93,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index e3d058144..1fb537a76 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -105,7 +105,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 1d6b7ec03..9da635cf1 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -138,7 +138,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 121128031..f1dad54f4 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -141,7 +141,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 7e9bfa8c2..dd5a90d7a 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -171,7 +171,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 0b386a661..f548e259d 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -104,7 +104,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index b32130dc0..d76d8f173 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -93,7 +93,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 33fbef4bb..4c534ffcb 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -109,7 +109,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index b6a946d7e..366826fb8 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -118,7 +118,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 81d592c5a..c809b63dc 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -91,7 +91,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index 630fc3fe9..f4792c2f8 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -99,7 +99,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 222b7b4bd..915a7231d 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -92,7 +92,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 91238ecbc..d286cf289 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -114,7 +114,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index d9cbcc009..6058232b9 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -91,7 +91,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index 0f95a815a..b5c95b169 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -102,7 +102,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index 16c7d8d3b..c4a588772 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -124,7 +124,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 8604d5144..dd0a9bcdb 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -137,7 +137,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index eb1cd9d93..9f95783cf 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -95,7 +95,7 @@ Previous Topic:  Installation Instructions User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 05f7cc0e9..e8182d080 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -191,7 +191,7 @@ Previous Topic:  Writing Documentaio User Guide Home   ·   Next Topic:  Calendar Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index e4651dc4a..3d3354436 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -186,7 +186,7 @@ Previous Topic:  Error Handling User Guide Home   ·   Next Topic:  Profiling Your Application

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 2c052424d..347b3d92b 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -242,7 +242,7 @@ Previous Topic:  Benchmark Class User Guide Home   ·   Next Topic:  Cart Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index ba95b24c5..bc0721bb4 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -339,7 +339,7 @@ Previous Topic:  Calendar Class User Guide Home   ·   Next Topic:  Config Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index bfb679457..6b48b2515 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -174,7 +174,7 @@ Previous Topic:  Calendaring Class User Guide Home   ·   Next Topic:  Database Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index b863ef4c1..a02d6587f 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -300,7 +300,7 @@ Previous Topic:  Database Class User Guide Home   ·   Next Topic:  Encryption Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index fbffd63c6..f6fb2b81d 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -217,7 +217,7 @@ Previous Topic:  Email Class User Guide Home   ·   Next Topic:  File Uploading Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 54725d035..c5eab4695 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -444,7 +444,7 @@ Previous Topic:  Encryption Helper User Guide Home   ·   Next Topic:  Form Validation Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index eae2036c1..935dca61f 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1211,7 +1211,7 @@ Previous Topic:  File Uploading ClassUser Guide Home   ·   Next Topic:  FTP Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 493177655..e3c06741d 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -309,7 +309,7 @@ Previous Topic:  Form Validation Class< User Guide Home   ·   Next Topic:  HTML Table Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 98ed4f6dd..0f023cff1 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -660,7 +660,7 @@ Previous Topic:  HTML Table Class User Guide Home   ·   Next Topic:  Input Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index d838cf020..552c49afd 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -262,7 +262,7 @@ Previous Topic:  Image Manipulation Class User Guide Home   ·   Next Topic:  Loader Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 0f1d0a090..b5041e5b8 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -97,7 +97,7 @@ Previous Topic:  Input Class Top of Page   ·   User Guide Home   ·   Next Topic:  Language Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html index d8307f347..732999c57 100644 --- a/user_guide/libraries/jquery.html +++ b/user_guide/libraries/jquery.html @@ -229,7 +229,7 @@ Previous Topic:  Input Class Top of Page   ·   User Guide Home   ·   Next Topic:  Language Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index c37f00926..dfdccad04 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -130,7 +130,7 @@ Previous Topic:  Loader Class User Guide Home   ·   Next Topic:  Output Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 34e3929a9..af312f4aa 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -248,7 +248,7 @@ Previous Topic:  Input Class User Guide Home   ·   Next Topic:  Language Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index a1427de7b..ab8f1d683 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -155,7 +155,7 @@ Previous Topic:  Language Class User Guide Home   ·   Next Topic:  Pagination Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 42c102c8d..da07c79be 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -222,7 +222,7 @@ Previous Topic:  Output Class User Guide Home   ·   Next Topic:  Session Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index ece61c1fa..5bb403a7f 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -205,7 +205,7 @@ Previous Topic:  Trackback Class User Guide Home   ·   Next Topic:  Typography

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 6d6216d95..5cd274787 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -121,7 +121,7 @@ Previous Topic:  Pagination Class User Guide Home   ·   Next Topic:  Session Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 2d295d72e..c8757995c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -315,7 +315,7 @@ Previous Topic:  Security Class User Guide Home   ·   Next Topic:  Trackback Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 094d7aac6..9de70775a 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -308,7 +308,7 @@ Previous Topic:  FTP Class   &mi User Guide Home   ·   Next Topic:  Image Manipulation Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index a07b8d1f8..32b1ee258 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -239,7 +239,7 @@ Previous Topic:  Session Class User Guide Home   ·   Next Topic:  Template Parser Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index e78af5f9a..9c4272b37 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -153,7 +153,7 @@ Previous Topic:  Template Parser User Guide Home   ·   Next Topic:  Unit Testing Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 84db54431..49c5881e1 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -219,7 +219,7 @@ Previous Topic:  Typography Class User Guide Home   ·   Next Topic:  URI Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index b2f5ac3d9..0dbaffa49 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -245,7 +245,7 @@ Previous Topic:  Unit Testing Class User Guide Home   ·   Next Topic:  User Agent Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index d2f79d2ec..8989fb2e1 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -219,7 +219,7 @@ Previous Topic:  URI Class User Guide Home   ·   Next Topic:  XML-RPC Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 87ca09480..7a8934d39 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -512,7 +512,7 @@ Previous Topic:  User Agent Class User Guide Home   ·   Next Topic:  Zip Encoding Class

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index d57dd48ac..48e2562be 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -281,7 +281,7 @@ Previous Topic:   XML-RPC Class User Guide Home   ·   Next Topic:  Array Helper

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/license.html b/user_guide/license.html index 96ca53a70..bb01a7e8d 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -100,7 +100,7 @@ Previous Topic:  Server Requiremen User Guide Home   ·   Next Topic:  Change Log

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 804c81d08..c5af8bc15 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -88,7 +88,7 @@ Previous Topic:  CodeIgniter Features User Guide Home   ·   Next Topic:  Model-View-Controller

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index f54a4e90b..9cbc8afb7 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -155,7 +155,7 @@ Previous Topic:  Getting Started User Guide Home   ·   Next Topic:  CodeIgniter Cheatsheets

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index cf200e08c..764d6d9e1 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -76,7 +76,7 @@ Previous Topic:  CodeIgniter at a GlanceUser Guide Home   ·   Next Topic:  CodeIgniter Features

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 3ce6391f9..6dfd15d90 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -111,7 +111,7 @@ Previous Topic:  CodeIgniter CheatsheetsUser Guide Home   ·   Next Topic:  Application Flow Chart

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index 88027eedb..5c00aba3d 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -85,7 +85,7 @@ our Wiki to see code examples posted User Guide Home   ·   Next Topic:  CodeIgniter At a Glance

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index e708753e4..bf7bc8fa2 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -91,7 +91,7 @@ Previous Topic:  Model-View-Controller User Guide Home   ·   Next Topic:  Getting Started

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 59ee05c5a..63eb5e930 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -77,7 +77,7 @@ Introduction diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index d0b1aa2eb..0b0fb25ee 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -93,7 +93,7 @@ Previous Topic:  Application Flow Chart User Guide Home   ·   Next Topic:  Architectural Goals

    -

    CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    diff --git a/user_guide/toc.html b/user_guide/toc.html index eed673c8c..68a7569f8 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -199,7 +199,7 @@ Table of Contents -- cgit v1.2.3-24-g4f1b From 048e42a63957f944444aeaff011d882b7c5914b3 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 10:26:10 -0600 Subject: marking Reactor changelog items with a special class to style accordingly --- user_guide/changelog.html | 14 ++++++++------ user_guide/images/reactor-bullet.png | Bin 0 -> 781 bytes user_guide/userguide.css | 3 +++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100755 user_guide/images/reactor-bullet.png diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7fa9ac665..ed7f48ee0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -57,6 +57,8 @@ Change Log

    Change Log

    +

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

    +

    Version 2.0.0

    Release Date: not yet released
    Hg Tag:

    @@ -77,10 +79,10 @@ Hg Tag:

  • In-development code is now hosted at BitBucket.
  • Removed the deprecated Validation Class.
  • Added CI_ Prefix to all core classes.
  • -
  • Package paths can now be set in application/config/autoload.php.
  • -
  • Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.
  • -
  • Name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.
  • -
  • $config['base_url'] is now empty by default and will guess what it should be.
  • +
  • Package paths can now be set in application/config/autoload.php.
  • +
  • Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.
  • +
  • Name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.
  • +
  • $config['base_url'] is now empty by default and will guess what it should be.
  • Libraries
  • Database @@ -176,7 +178,7 @@ Hg Tag:

    Bug fixes for 2.0.0

  • Libraries -- cgit v1.2.3-24-g4f1b From 3b0dea81d3219648ba7cfc154ad107be70ea3649 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 12:22:20 -0600 Subject: filled in some missing change log items --- user_guide/changelog.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6fa133276..50a8caec5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@ Hg Tag:

  • Scaffolding, having been deprecated for a number of versions, has been removed.
  • Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
  • Added new special Library type: Drivers.
  • +
  • Added full query-string support. See the config file for details.
  • Moved the application folder outside of the system folder.
  • Moved system/cache and system/logs directories to the application directory.
  • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.
  • @@ -83,9 +84,11 @@ Hg Tag:

  • Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.
  • In Database Forge the name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.
  • $config['base_url'] is now empty by default and will guess what it should be.
  • +
  • Enabled full Command Line Interface compatibility with config['uri_protocol'] = 'CLI';.
  • Libraries ' + + '

    Additional Resources

    ' + + '' + + '' + '

    Class Reference

    ' + @@ -73,7 +79,6 @@ function create_menu(basepath) '
  • Calendar Class
  • ' + '
  • Cart Class
  • ' + '
  • Config Class
  • ' + - '
  • Database Class
  • ' + '
  • Email Class
  • ' + '
  • Encryption Class
  • ' + '
  • File Uploading Class
  • ' + @@ -100,6 +105,13 @@ function create_menu(basepath) '' + + '

    Driver Reference

    ' + + '' + + '

    Helper Reference

    ' + '' + - '

    Additional Resources

    ' + - '' + - ''); } \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 9d3ad267e8e8f2972ceea05c4281b0234ed3efb4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 14:06:58 -0600 Subject: some cleanup for the javascript class docs --- system/libraries/javascript/Jquery.php | 2 +- user_guide/libraries/javascript.html | 153 ++++++++++++++++++++- user_guide/libraries/jquery.html | 236 --------------------------------- user_guide/nav/nav.js | 1 + user_guide/toc.html | 1 + 5 files changed, 150 insertions(+), 243 deletions(-) delete mode 100644 user_guide/libraries/jquery.html diff --git a/system/libraries/javascript/Jquery.php b/system/libraries/javascript/Jquery.php index 0fbb52696..baab83d25 100644 --- a/system/libraries/javascript/Jquery.php +++ b/system/libraries/javascript/Jquery.php @@ -21,7 +21,7 @@ * @subpackage Libraries * @author ExpressionEngine Dev Team * @category Loader - * @link http://www.codeigniter.com/user_guide/libraries/jquery.html + * @link http://www.codeigniter.com/user_guide/libraries/javascript.html */ class CI_Jquery extends CI_Javascript { diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 864efc82d..55ad18907 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -58,9 +58,9 @@ Input Class

    Note: This driver is experimental. Its feature set and implementation may change in future releases.


    Javascript Class

    -

    Rewrite this paragraph: jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

    +

    CodeIgniter provides a library to help you with certain common functions that you may want to use with Javascript. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

    Initializing the Class

    -

    To initialize the jQuery class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

    +

    To initialize the Javascript class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

    $this->load->library('javascript'); @@ -73,20 +73,161 @@ Input Class

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

    Setup and Configuration

    Set these variables in your view

    -

    As a javascript library, your files must be available to your application. For your convenience, the needed files to run this library are available for download from our site.

    -

    As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

    +

    As a Javascript library, your files must be available to your application.

    +

    As Javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

    <?php echo $library_src;?>
    <?php echo $script_head;?>

    $library_src, is where the actual library file will be loaded, as well as any subsequent plugin script calls; $script_head is where specific events, functions and other commands will be rendered.

    Set the path to the librarys with config items

    -

    There are some configuration items in javascript library. These can either be set in application/config.php, within its own confg/javascript.php file, or within any controller usings the set_item() function.

    +

    There are some configuration items in Javascript library. These can either be set in application/config.php, within its own config/javascript.php file, or within any controller usings the set_item() function.

    An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

    $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');
    $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

    If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.

    -

    For information on outputting events, effects, etc., refer to the jQuery Class documentation.

    +

    The jQuery Class

    + +

    To initialize the jQuery class manually in your controller constructor, use the $this->load->library function:

    + +$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:

    + +$this->load->library('jquery', FALSE); + +

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

    + +

    jQuery Events

    + +

    Events are set using the following syntax.

    + +

    $this->jquery->event('element_path', code_to_run());

    + +

    In the above example:

    + + + +

    Effects

    + +

    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 +$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);

    + + + +

    toggle()

    + +

    toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.

    +

    $this->jquery->toggle(target);

    + + +

    animate()

    + +

    $this->jquery->animate(target, parameters, optional speed, optional extra information);

    + +

    For a full summary, see http://docs.jquery.com/Effects/animate

    +

    Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.

    +

    $params = array(
    + 'height' => 80,
    + 'width' => '50%',
    + 'marginLeft' => 125
    +);
    +$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));

    + +

    fadeIn() / fadeOut()

    + +

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    + $this->jquery->fadeOut(target, optional speed, optional extra information);

    + + +

    toggleClass()

    + +

    This function will add or remove a CSS class to its target.

    +

    $this->jquery->toggleClass(target, class)

    + + +

    fadeIn() / fadeOut()

    + +

    These effects cause an element(s) to disappear or reappear over time.

    +

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    + $this->jquery->fadeOut(target, optional speed, optional extra information);

    + + +

    slideUp() / slideDown() / slideToggle()

    + +

    These effects cause an element(s) to slide.

    +

    $this->jquery->slideUp(target, optional speed, optional extra information);
    + $this->jquery->slideDown(target, optional speed, optional extra information);
    +$this->jquery->slideToggle(target, optional speed, optional extra information);

    + + +

    Plugins

    + +

    + +

    Some select jQuery plugins are made available using this library.

    + +

    corner()

    +

    Used to add distinct corners to page elements. For full details see http://www.malsup.com/jquery/corner/

    +

    $this->jquery->corner(target, corner_style);

    + +

    $this->jquery->corner("#note", "cool tl br");

    + +

    tablesorter()

    + +

    description to come

    + +

    modal()

    + +

    description to come

    + +

    calendar()

    + +

    description to come

    + diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html deleted file mode 100644 index 732999c57..000000000 --- a/user_guide/libraries/jquery.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - -CodeIgniter User Guide : Input Class - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 2.0.0

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    jQuery Class

    - -

    jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

    - -

    Initializing the Class

    - -

    To initialize the jQuery class manually in your controller constructor, use the $this->load->library function:

    - -$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:

    - -$this->load->library('jquery', FALSE); - -

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

    - -

    Setup and Configuration

    - -

    As a javascript library, jquery.js must be available to your application. For your convenience, the needed files to run this library are available for download from our site.

    - -

    As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

    - -

    <?php echo $jquery_script;?>
    -<?php echo $script_head;?>

    - -

    There are 2 configuration items in jQuery library. These can either be set in application/config.php, or within any controller. The first is the path from the root of your site to the jquery library ('js' is the default) and the second is an image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

    - -

    $config['javascript_folder'] = 'js';
    - $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

    - -

    If you keep your files in the same directories they were downloaded from, then you needed set this configuration items.

    - -

    Events

    - -

    Events are set using the following syntax.

    - -

    $this->jquery->event('element_path', code_to_run());

    - -

    In the above example:

    - -
      -
    • "event" is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.
    • -
    • "element_path" is any valid jQuery selector. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example "#notice_area" would effect <div id="notice_area">, and "#content a.notice" would effect all anchors with a class of "notice" in the div with id "content".
    • -
    • "code_to_run()" is script your write yourself, or an action such as an effect from the jQuery library below.
    • -
    - -

    Effects

    - -

    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 -$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);

    - -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    toggle()

    - -

    toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.

    -

    $this->jquery->toggle(target);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    - -

    animate()

    - -

    $this->jquery->animate(target, parameters, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "paramters" in jQuery would generally include a series of CSS properties that you wish to change.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    -

    For a full summary, see http://docs.jquery.com/Effects/animate

    -

    Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.

    -

    $params = array(
    - 'height' => 80,
    - 'width' => '50%',
    - 'marginLeft' => 125
    -);
    -$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));

    - -

    fadeIn() / fadeOut()

    - -

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    - $this->jquery->fadeOut(target, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    toggleClass()

    - -

    This function will add or remove a CSS class to its target.

    -

    $this->jquery->toggleClass(target, class)

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "class" is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.
    • -
    - -

    fadeIn() / fadeOut()

    - -

    These effects cause an element(s) to disappear or reappear over time.

    -

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    - $this->jquery->fadeOut(target, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    slideUp() / slideDown() / slideToggle()

    - -

    These effects cause an element(s) to slide.

    -

    $this->jquery->slideUp(target, optional speed, optional extra information);
    - $this->jquery->slideDown(target, optional speed, optional extra information);
    -$this->jquery->slideToggle(target, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    Plugins

    - -

    - -

    Some select jQuery plugins are made available using this library.

    - -

    corner()

    -

    Used to add distinct corners to page elements. For full details see http://www.malsup.com/jquery/corner/

    -

    $this->jquery->corner(target, corner_style);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "corner_style" is optional, and can be set to any valid style such as round, sharp, bevel, bite, dog, etc. Individual corners can be set by following the style with a space and using "tl" (top left), "tr" (top right), "bl" (bottom left), or "br" (bottom right).
    • -
    -

    $this->jquery->corner("#note", "cool tl br");

    - -

    tablesorter()

    - -

    description to come

    - -

    modal()

    - -

    description to come

    - -

    calendar()

    - -

    description to come

    - -
    - - - - - - - \ No newline at end of file diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index f1c215c4d..8f16e275f 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -87,6 +87,7 @@ function create_menu(basepath) '
  • HTML Table Class
  • ' + '
  • Image Manipulation Class
  • ' + '
  • Input Class
  • ' + + '
  • Javascript Class
  • ' + '
  • Loader Class
  • ' + '
  • Language Class
  • ' + '
  • Output Class
  • ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 68a7569f8..5eb9c2acc 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -136,6 +136,7 @@ Table of Contents
  • HTML Table Class
  • Image Manipulation Class
  • Input Class
  • +
  • Javascript Class
  • Loader Class
  • Language Class
  • Output Class
  • -- cgit v1.2.3-24-g4f1b From 8efefd1f2cc09caccedccbc6c6b2f18b3c58265d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 14:30:42 -0600 Subject: adding release notes to change log --- user_guide/changelog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 50a8caec5..35187efda 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -60,8 +60,8 @@ Change Log

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

    Version 2.0.0

    -

    Release Date: not yet released
    -Hg Tag:

    +

    Release Date: January 28, 2011
    +Hg Tag: v2.0.0

    • General changes -- cgit v1.2.3-24-g4f1b -- cgit v1.2.3-24-g4f1b From 999e7472aa094dac056494ff41772f9204da04b2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sat, 29 Jan 2011 16:16:58 -0600 Subject: Fix #21 - Typo in get_metadata() function of apc and memcached cache drivers. --- system/libraries/Cache/drivers/Cache_apc.php | 2 +- system/libraries/Cache/drivers/Cache_memcached.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index e82e8e1f5..4b995c793 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -114,7 +114,7 @@ class Cache_apc extends CI_Driver { return FALSE; } - list($value, $time, $ttl) = $stored; + list($data, $time, $ttl) = $stored; return array( 'expire' => $time + $ttl, diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php index a7efdc5de..5f5a31591 100644 --- a/system/libraries/Cache/drivers/Cache_memcached.php +++ b/system/libraries/Cache/drivers/Cache_memcached.php @@ -122,7 +122,7 @@ class Cache_memcached extends CI_Driver { return FALSE; } - list($value, $time, $ttl) = $stored; + list($data, $time, $ttl) = $stored; return array( 'expire' => $time + $ttl, -- cgit v1.2.3-24-g4f1b From d91d0f7544967869248743c7ca663159d93628f5 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 30 Jan 2011 20:47:42 -0500 Subject: Fixed breadcrumb and removed errand parentheses. --- user_guide/libraries/javascript.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 55ad18907..18b7181b0 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -2,7 +2,7 @@ -CodeIgniter User Guide : JavaScript Class +JavaScript Driver : CodeIgniter User Guide @@ -42,7 +42,8 @@ CodeIgniter Home  ›  User Guide Home  ›  -Input Class +Drivers  ›  +JavaScript Driver
      Search User Guide   
      @@ -57,7 +58,7 @@ Input Class

      Note: This driver is experimental. Its feature set and implementation may change in future releases.


      -

      Javascript Class

      +

      Javascript Driver

      CodeIgniter provides a library to help you with certain common functions that you may want to use with Javascript. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

      Initializing the Class

      To initialize the Javascript class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

      @@ -82,7 +83,7 @@ Input Class

      Set the path to the librarys with config items

      There are some configuration items in Javascript library. These can either be set in application/config.php, within its own config/javascript.php file, or within any controller usings the set_item() function.

      An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      -

      $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');
      +

      $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/';
      $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

      If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.

      -- cgit v1.2.3-24-g4f1b From c7f2bd28a8b26a6ed61f83f1d75fdd78aa37ebfe Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 30 Jan 2011 20:50:08 -0500 Subject: The db utility had the wrong code example for database_exists(). Fixes #26 --- user_guide/database/utilities.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index d4296fe2e..ac3841641 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -102,13 +102,13 @@ foreach($dbs as $db)
      }
      -

      $this->db->database_exists();

      +

      $this->dbutil->database_exists();

      Sometimes it's helpful to know whether a particular database exists. Returns a boolean TRUE/FALSE. Usage example:

      -if ($this->db->database_exists('database_name'))
      +if ($this->dbutil->database_exists('database_name'))
      {
         // some code...
      } -- cgit v1.2.3-24-g4f1b From c5bf616c68ab4d18777ba77d5eaf07384b392f78 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 30 Jan 2011 21:17:11 -0500 Subject: Added 404_override to Codeigniter file to catch the 404 if the controller is available but no method. Fixes #19 --- system/core/CodeIgniter.php | 14 ++++++++++++-- system/core/Router.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 2d3f24958..0414ffbf1 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -80,7 +80,7 @@ { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } - + /* * ------------------------------------------------------ * Set a liberal script execution time limit @@ -289,7 +289,17 @@ // methods, so we'll use this workaround for consistent behavior if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) { - show_404("{$class}/{$method}"); + // Check and see if we are using a 404 override and use it. + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + } + else + { + show_404("{$class}/{$method}"); + } } // Call the requested method. diff --git a/system/core/Router.php b/system/core/Router.php index 7be508fef..6893e6e92 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -270,7 +270,7 @@ class CI_Router { // If we've gotten this far it means that the URI does not correlate to a valid // controller class. We will now see if there is an override - if (!empty($this->routes['404_override'])) + if ( ! empty($this->routes['404_override'])) { $x = explode('/', $this->routes['404_override']); -- cgit v1.2.3-24-g4f1b From dda07e9efe683248c042307147b6573e104777ad Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 31 Jan 2011 23:26:25 +0000 Subject: Some servers would trick URI into thinking it was being run in CLI mode, which broke routing. --- system/core/URI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/core/URI.php b/system/core/URI.php index 999015949..1b479e92a 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -61,8 +61,8 @@ class CI_URI { { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { - // Arguments exist, it must be a command line request - if ( ! empty($_SERVER['argv'])) + // Is the request coming from the command line? + if (defined('STDIN')) { $this->uri_string = $this->_parse_cli_args(); return; -- cgit v1.2.3-24-g4f1b From 5519e3d5d3311275a6fb2aa4962f9cea1626996c Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 1 Feb 2011 13:07:37 -0500 Subject: Better logic handling for 404 override --- system/core/CodeIgniter.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0414ffbf1..567e67f65 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -295,6 +295,17 @@ $x = explode('/', $RTR->routes['404_override']); $class = $x[0]; $method = (isset($x[1]) ? $x[1] : 'index'); + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.EXT)) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.EXT); + unset($CI); + $CI = new $class(); + } } else { -- cgit v1.2.3-24-g4f1b From 5fd02675ed3d079c2719374b890fac599a2ef991 Mon Sep 17 00:00:00 2001 From: katzgrau Date: Wed, 2 Feb 2011 16:33:05 -0500 Subject: Added a better explanation for the 'autoinit' db option. Side note: should that really be true by default? --- user_guide/database/configuration.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index e9db5fc87..d71cd34db 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -134,7 +134,7 @@ for the primary connection, but it too can be renamed to something more relevant
    • char_set - The character set used in communicating with the database.
    • dbcollat - The character collation used in communicating with the database.
    • 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 initialize the database.
    • +
    • 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.
    • port - The database port number. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    -- cgit v1.2.3-24-g4f1b From e58199ba6de5622a062536ba03c43700b70716ac Mon Sep 17 00:00:00 2001 From: "ericbarnes@ericbarnes.local" Date: Wed, 2 Feb 2011 22:40:36 -0500 Subject: Fixes #27. When the default controller was used, the _detect_uri() method was returning an incorrect URI, which caused a 404 when a query string was used and no controller specified. via Dan Horrigan --- system/core/URI.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/core/URI.php b/system/core/URI.php index 1b479e92a..c43cde005 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -173,6 +173,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 f6f51a6ef6bad21dc04997a5d585f90eab082187 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sat, 5 Feb 2011 21:41:17 -0500 Subject: Fixed is_referral to return proper status. Fixes #40 --- system/libraries/User_agent.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index c62174836..3774fc283 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -375,7 +375,11 @@ class CI_User_agent { */ public function is_referral() { - return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == ''); + if ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') + { + return FALSE; + } + return TRUE; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 58e8caf2afb3ea054f83999fb0698720a1a58738 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Sat, 5 Feb 2011 22:19:57 -0500 Subject: Added documentation for changes to DB_result --- user_guide/database/results.html | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 75cb190f9..e9a5cb4cf 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -98,6 +98,18 @@ Query Results } +

    You can also pass a string to result() which represents a class to instantiate for each result object (note: this class must be loaded)

    + + + $query = $this->db->query("SELECT * FROM users;");
    +
    + foreach ($query->result('User') as $user)
    + {
    +    echo $row->name; // call attributes
    +    echo $row->reverse_name(); // or methods defined on the 'User' class
    + } +
    +

    result_array()

    This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

    @@ -133,6 +145,15 @@ Query Results $row = $query->row(5); +

    You can also add a second String parameter, which is the name of a class to instantiate the row with:

    + + + $query = $this->db->query("SELECT * FROM users LIMIT 1;");
    +
    + $query->row(0, 'User')
    + echo $row->name; // call attributes
    + echo $row->reverse_name(); // or methods defined on the 'User' class
    +

    row_array()

    @@ -235,4 +256,4 @@ Next Topic:  Query Helper Functions - \ No newline at end of file + -- cgit v1.2.3-24-g4f1b From 0ba58b81b65c2059210b921856489b5faaa81369 Mon Sep 17 00:00:00 2001 From: vascopj Date: Sun, 6 Feb 2011 14:20:21 +0000 Subject: A change to pass all fields back if there are no fields passed into the "post" method. Based on comments here http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor/suggestions/1346917-allow-this-input-post-to-return-array-of-eve --- system/core/Input.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/system/core/Input.php b/system/core/Input.php index 3e82874fd..fa8080deb 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -126,6 +126,22 @@ class CI_Input { */ function post($index = '', $xss_clean = FALSE) { + // check if a field has been entered + if( empty($index ) ) + { + // no field entered - return all fields + + $all_post_fields = array(); + + // loop through the full _POST array + foreach( $_POST as $key ) + { + $all_post_fields[$key] = $this->_fetch_from_array($_POST, $key, $xss_clean); + } + return $all_post_fields; + + } + return $this->_fetch_from_array($_POST, $index, $xss_clean); } -- cgit v1.2.3-24-g4f1b From 01d1a5b936556f3b19786b7407cce11cf3bdb616 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 7 Feb 2011 10:54:06 +0000 Subject: CLI requests can now be run from any folder, not just when CD'ed next to index.php. --- index.php | 7 +++++++ user_guide/changelog.html | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/index.php b/index.php index 918c80259..74e3ba32a 100644 --- a/index.php +++ b/index.php @@ -130,6 +130,13 @@ * Resolve the system path for increased reliability * --------------------------------------------------------------- */ + + // Set the current directory correctly for CLI requests + if (defined('STDIN')) + { + chdir(dirname(__FILE__)); + } + if (realpath($system_path) !== FALSE) { $system_path = realpath($system_path).'/'; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 35187efda..09a2cefce 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -59,6 +59,15 @@ Change Log

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

    +

    Version 2.0.1

    +

    Release Date: n/a
    +Hg Tag: n/a

    + +

    Bug fixes for 2.0.1

    +
      +
    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • +
    +

    Version 2.0.0

    Release Date: January 28, 2011
    Hg Tag: v2.0.0

    -- cgit v1.2.3-24-g4f1b From ef112c0830df4a31563351125888b0d522a1c965 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 7 Feb 2011 13:01:47 +0000 Subject: Added decimal, less_than and greater_than rules to the Form validation Class. --- system/libraries/Form_validation.php | 70 ++++++- user_guide/changelog.html | 8 + user_guide/libraries/form_validation.html | 310 ++++++++++++++++-------------- 3 files changed, 237 insertions(+), 151 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index fc5b82ee3..745fb7c03 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -138,14 +138,14 @@ class CI_Form_validation { // Build our master array $this->_field_data[$field] = array( - 'field' => $field, - 'label' => $label, - 'rules' => $rules, - 'is_array' => $is_array, - 'keys' => $indexes, - 'postdata' => NULL, - 'error' => '' - ); + 'field' => $field, + 'label' => $label, + 'rules' => $rules, + 'is_array' => $is_array, + 'keys' => $indexes, + 'postdata' => NULL, + 'error' => '' + ); return $this; } @@ -1147,7 +1147,57 @@ class CI_Form_validation { */ function integer($str) { - return (bool)preg_match( '/^[\-+]?[0-9]+$/', $str); + return (bool) preg_match('/^[\-+]?[0-9]+$/', $str); + } + + // -------------------------------------------------------------------- + + /** + * Decimal number + * + * @access public + * @param string + * @return bool + */ + function decimal($str) + { + return (bool) preg_match('/^[\-+]?[0-9]+\.[0-9]+$/', $str); + } + + // -------------------------------------------------------------------- + + /** + * Greather than + * + * @access public + * @param string + * @return bool + */ + function greater_than($str, $min) + { + if ( ! is_numeric($str)) + { + return false; + } + return $str > $min; + } + + // -------------------------------------------------------------------- + + /** + * Less than + * + * @access public + * @param string + * @return bool + */ + function less_than($str, $max) + { + if ( ! is_numeric($str)) + { + return false; + } + return $str < $max; } // -------------------------------------------------------------------- @@ -1161,7 +1211,7 @@ class CI_Form_validation { */ function is_natural($str) { - return (bool)preg_match( '/^[0-9]+$/', $str); + return (bool) preg_match( '/^[0-9]+$/', $str); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 09a2cefce..cd728226b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,6 +63,14 @@ Change Log

    Release Date: n/a
    Hg Tag: n/a

    + +

    Bug fixes for 2.0.1

    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 935dca61f..d6120054b 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -924,118 +924,146 @@ POST array:

      The following is a list of all the native rules that are available to use:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      RuleParameterDescriptionExample
      requiredNoReturns FALSE if the form element is empty. 
      matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
      min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
      max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
      exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
      alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
      alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
      alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
      numericNoReturns FALSE if the form element contains anything other than numeric characters. 
      integerNoReturns FALSE if the form element contains anything other than an integer. 
      is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
      is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
      valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
      valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
      valid_ipNoReturns FALSE if the supplied IP is not valid. 
      valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
      RuleParameterDescriptionExample
      requiredNoReturns FALSE if the form element is empty. 
      matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
      min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
      max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
      exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
      greater_thanYesReturns FALSE if the form element is less than the parameter value or not numeric.greater_than[8]
      less_thanYesReturns FALSE if the form element is greater than the parameter value or not numeric.less_than[8]
      alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
      alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
      alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
      numericNoReturns FALSE if the form element contains anything other than numeric characters. 
      integerNoReturns FALSE if the form element contains anything other than an integer. 
      decimalYesReturns FALSE if the form element is not exactly the parameter value. 
      is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
      is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
      valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
      valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
      valid_ipNoReturns FALSE if the supplied IP is not valid. 
      valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
      @@ -1058,36 +1086,36 @@ POST array:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      NameParameterDescription
      xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
      prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
      prep_urlNoAdds "http://" to URLs if missing.
      strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
      encode_php_tagsNoConverts PHP tags to entities.
      NameParameterDescription
      xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
      prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
      prep_urlNoAdds "http://" to URLs if missing.
      strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
      encode_php_tagsNoConverts PHP tags to entities.
      -- cgit v1.2.3-24-g4f1b From 9758d84b69185f80fd8197f28046af7ef3b2a2d3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 7 Feb 2011 20:39:00 +0000 Subject: Added Migrations library, config and an example controller/migration file. --- application/config/migration.php | 38 +++ application/controllers/migrate.php | 40 +++ application/migrations/001_Create_accounts.php | 32 +++ system/libraries/Migration.php | 336 +++++++++++++++++++++++++ 4 files changed, 446 insertions(+) create mode 100644 application/config/migration.php create mode 100644 application/controllers/migrate.php create mode 100644 application/migrations/001_Create_accounts.php create mode 100644 system/libraries/Migration.php diff --git a/application/config/migration.php b/application/config/migration.php new file mode 100644 index 000000000..37b1b8534 --- /dev/null +++ b/application/config/migration.php @@ -0,0 +1,38 @@ +migration->latest() this is the version that schema will +| be upgraded / downgraded to. +| +*/ +$config['migration_version'] = 1; + + +/* +|-------------------------------------------------------------------------- +| Migrations Path +|-------------------------------------------------------------------------- +| +| Path to your migrations folder. +| Typically, it will be within your application path. +| Also, writing permission is required within the migrations path. +| +*/ +$config['migration_path'] = APPPATH . 'migrations/'; diff --git a/application/controllers/migrate.php b/application/controllers/migrate.php new file mode 100644 index 000000000..e5442e79c --- /dev/null +++ b/application/controllers/migrate.php @@ -0,0 +1,40 @@ +load->library('migration'); + + /** VERY IMPORTANT - only turn this on when you need it. */ +// show_error('Access to this controller is blocked, turn me on when you need me.'); + } + + // Install up to the most up-to-date version. + function install() + { + if ( ! $this->migration->current()) + { + show_error($this->migration->error); + exit; + } + + echo "
      Migration Successful
      "; + } + + // This will migrate up to the configed migration version + function version($id = NULL) + { + // No $id supplied? Use the config version + $id OR $id = $this->config->item('migration_version'); + + if ( ! $this->migration->version($id)) + { + show_error($this->migration->error); + exit; + } + + echo "
      Migration Successful
      "; + } +} diff --git a/application/migrations/001_Create_accounts.php b/application/migrations/001_Create_accounts.php new file mode 100644 index 000000000..4b2fc936f --- /dev/null +++ b/application/migrations/001_Create_accounts.php @@ -0,0 +1,32 @@ +db->table_exists('accounts')) + { + // Setup Keys + $this->dbforge->add_key('id', TRUE); + + $this->dbforge->add_field(array( + 'id' => array('type' => 'INT', 'constraint' => 5, 'unsigned' => TRUE, 'auto_increment' => TRUE), + 'company_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE), + 'first_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE), + 'last_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE), + 'phone' => array('type' => 'TEXT', 'null' => FALSE), + 'email' => array('type' => 'TEXT', 'null' => FALSE), + 'address' => array('type' => 'TEXT', 'null' => FALSE), + 'Last_Update' => array('type' => 'DATETIME', 'null' => FALSE) + )); + + $this->dbforge->add_field("Created_At TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"); + $this->dbforge->create_table('accounts', TRUE); + } + } + + function down() + { + $this->dbforge->drop_table('accounts'); + } +} diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php new file mode 100644 index 000000000..73c55c346 --- /dev/null +++ b/system/libraries/Migration.php @@ -0,0 +1,336 @@ + $val) + { + $this->{'_' . $key} = $val; + } + + log_message('debug', 'Migrations class initialized'); + + // Are they trying to use migrations while it is disabled? + if ($this->_migration_enabled !== TRUE) + { + show_error('Migrations has been loaded but is disabled or set up incorrectly.'); + } + + // If not set, set it + $this->_migration_path == '' OR $this->_migration_path = APPPATH . 'migrations/'; + + // Add trailing slash if not set + $this->_migration_path = rtrim($this->_migration_path, '/').'/'; + + // They'll probably be using dbforge + $this->load->dbforge(); + + // If the migrations table is missing, make it + if ( ! $this->db->table_exists('migrations')) + { + $this->dbforge->add_field(array( + 'version' => array('type' => 'INT', 'constraint' => 3), + )); + + $this->dbforge->create_table('migrations', TRUE); + + $this->db->insert('migrations', array('version' => 0)); + } + } + + // -------------------------------------------------------------------- + + /** + * Migrate to a schema version + * + * Calls each migration step required to get to the schema version of + * choice + * + * @access public + * @param $version integer Target schema version + * @return mixed TRUE if already latest, FALSE if failed, int if upgraded + */ + function version($target_version) + { + $start = $current_version = $this->_get_version(); + $stop = $target_version; + + if ($target_version > $current_version) + { + // Moving Up + ++$start; + ++$stop; + $step = 1; + } + + else + { + // Moving Down + $step = -1; + } + + $method = $step === 1 ? 'up' : 'down'; + $migrations = array(); + + // We now prepare to actually DO the migrations + // But first let's make sure that everything is the way it should be + for ($i = $start; $i != $stop; $i += $step) + { + $f = glob(sprintf($this->_migration_path . '%03d_*.php', $i)); + + // Only one migration per step is permitted + if (count($f) > 1) + { + $this->error = sprintf($this->lang->line('multiple_migration_version'), $i); + return FALSE; + } + + // Migration step not found + if (count($f) == 0) + { + // If trying to migrate up to a version greater than the last + // existing one, migrate to the last one. + if ($step == 1) + { + break; + } + + // If trying to migrate down but we're missing a step, + // something must definitely be wrong. + $this->error = sprintf($this->lang->line('migration_not_found'), $i); + return FALSE; + } + + $file = basename($f[0]); + $name = basename($f[0], '.php'); + + // Filename validations + if (preg_match('/^\d{3}_(\w+)$/', $name, $match)) + { + $match[1] = strtolower($match[1]); + + // Cannot repeat a migration at different steps + if (in_array($match[1], $migrations)) + { + $this->error = sprintf($this->lang->line('multiple_migrations_name'), $match[1]); + return FALSE; + } + + include $f[0]; + $class = 'Migration_' . ucfirst($match[1]); + + if ( ! class_exists($class)) + { + $this->error = sprintf($this->lang->line('migration_class_doesnt_exist'), $class); + return FALSE; + } + + if ( ! is_callable(array($class, 'up')) || ! is_callable(array($class, 'down'))) + { + $this->error = sprintf($this->lang->line('wrong_migration_interface'), $class); + return FALSE; + } + + $migrations[] = $match[1]; + } + else + { + $this->error = sprintf($this->lang->line('invalid_migration_filename'), $file); + return FALSE; + } + } + + $this->log('Current schema version: ' . $current_version); + + $version = $i + ($step == 1 ? -1 : 0); + + // If there is nothing to do so quit + if ($migrations === array()) + { + return TRUE; + } + + $this->log('Moving ' . $method . ' to version ' . $version); + + // Loop through the migrations + foreach ($migrations AS $migration) + { + // Run the migration class + $class = 'Migration_' . ucfirst(strtolower($migration)); + call_user_func(array(new $class, $method)); + + $current_version += $step; + $this->_update_version($current_version); + } + + $this->log('All done. Schema is at version '.$current_version); + + return $current_version; + } + + // -------------------------------------------------------------------- + + /** + * Set's the schema to the latest migration + * + * @access public + * @return mixed true if already latest, false if failed, int if upgraded + */ + public function latest() + { + if ( ! $migrations = $this->find_migrations()) + { + throw new Exception('no_migrations_found'); + return false; + } + + $last_migration = basename(end($migrations)); + + // Calculate the last migration step from existing migration + // filenames and procceed to the standard version migration + $last_version = intval(substr($last_migration, 0, 3)); + return $this->version($last_version); + } + + // -------------------------------------------------------------------- + + /** + * Set's the schema to the migration version set in config + * + * @access public + * @return mixed true if already current, false if failed, int if upgraded + */ + public function current() + { + $version = $this->_migration_version; + return $this->version($version); + } + + // -------------------------------------------------------------------- + + /** + * Set's the schema to the latest migration + * + * @access public + * @return mixed true if already latest, false if failed, int if upgraded + */ + + protected static function find_migrations() + { + // Load all *_*.php files in the migrations path + $files = glob($this->_migration_path . '*_*.php'); + $file_count = count($files); + + for ($i = 0; $i < $file_count; $i++) + { + // Mark wrongly formatted files as false for later filtering + $name = basename($files[$i], '.php'); + if ( ! preg_match('/^\d{3}_(\w+)$/', $name)) + { + $files[$i] = FALSE; + } + } + + sort($files); + + return $files; + } + + // -------------------------------------------------------------------- + + /** + * Retrieves current schema version + * + * @access private + * @return integer Current Schema version + */ + private function _get_version() + { + $row = $this->db->get('migrations')->row(); + return $row ? $row->version : 0; + } + + // -------------------------------------------------------------------- + + /** + * Stores the current schema version + * + * @access private + * @param $migrations integer Schema version reached + * @return void Outputs a report of the migration + */ + private function _update_version($migrations) + { + return $this->db->update('migrations', array( + 'version' => $migrations + )); + } + + // -------------------------------------------------------------------- + + /** + * Stores the current schema version + * + * @access private + * @param $migrations integer Schema version reached + * @return void Outputs a report of the migration + */ + private function log($text) + { + echo $text.'
      '; + } + + // -------------------------------------------------------------------- + + /** + * Enable the use of CI super-global + * + * @access public + * @param $var + * @return mixed + */ + public function __get($var) + { + return get_instance()->$var; + } +} \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3167eebb81d740e0a74b28ff0353dd4fcf110d0e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 8 Feb 2011 21:19:28 +0000 Subject: MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors. --- system/database/drivers/mysql/mysql_driver.php | 16 ++++++++-------- user_guide/changelog.html | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index df18c912e..c9fc1ecab 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -287,12 +287,12 @@ class CI_DB_mysql_driver extends CI_DB { if (is_array($str)) { foreach($str as $key => $val) - { + { $str[$key] = $this->escape_str($val, $like); - } + } - return $str; - } + return $str; + } if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id)) { @@ -532,7 +532,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -551,7 +551,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _replace($table, $keys, $values) { - return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -569,7 +569,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _insert_batch($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); + return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values); } // -------------------------------------------------------------------- @@ -592,7 +592,7 @@ class CI_DB_mysql_driver extends CI_DB { { foreach($values as $key => $val) { - $valstr[] = $key." = ".$val; + $valstr[] = sprintf('`%s` = %s', $key, $val); } $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cd728226b..0aac5aec5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@ Hg Tag: n/a

      Bug fixes for 2.0.1

      • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
      • +
      • MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.

      Version 2.0.0

      -- cgit v1.2.3-24-g4f1b From a12216baff3aef18413a84e3d37aba2096b5ebe8 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 9 Feb 2011 16:09:31 +0000 Subject: Reverted recent MySQL backtick escaping as some queries were double-escaping. --- system/database/drivers/mysql/mysql_driver.php | 8 ++++---- user_guide/changelog.html | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index c9fc1ecab..72c834b8f 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -532,7 +532,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -551,7 +551,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _replace($table, $keys, $values) { - return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")"; + return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -569,7 +569,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _insert_batch($table, $keys, $values) { - return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values); + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); } // -------------------------------------------------------------------- @@ -592,7 +592,7 @@ class CI_DB_mysql_driver extends CI_DB { { foreach($values as $key => $val) { - $valstr[] = sprintf('`%s` = %s', $key, $val); + $valstr[] = $key . ' = ' . $val; } $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0aac5aec5..cd728226b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,7 +74,6 @@ Hg Tag: n/a

      Bug fixes for 2.0.1

      • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
      • -
      • MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.

      Version 2.0.0

      -- cgit v1.2.3-24-g4f1b From ff5c948222d5985312be71b917594e5e438addc3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 9 Feb 2011 16:10:58 +0000 Subject: Fixed issue #41: Added audio/mp3 mime type to mp3. --- application/config/mimes.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/application/config/mimes.php b/application/config/mimes.php index de923c45a..58eea5f83 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -56,7 +56,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'midi' => 'audio/midi', 'mpga' => 'audio/mpeg', 'mp2' => 'audio/mpeg', - 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3'), + 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), 'aif' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cd728226b..388f25d2a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@ Hg Tag: n/a

      Bug fixes for 2.0.1

      • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
      • +
      • Fixed issue #41: Added audio/mp3 mime type to mp3.

      Version 2.0.0

      -- cgit v1.2.3-24-g4f1b From 5d990f97ec60cb46a1bd2cd84eef110a3dd837e3 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 13 Feb 2011 15:11:32 -0500 Subject: Changed the downloads to be 2.0.0 - Fixes #47 --- user_guide/installation/downloads.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index d580fde7b..ad653307a 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -58,7 +58,9 @@ Downloading CodeIgniter

      Downloading CodeIgniter

      +

      Additional Resources

      + + + @@ -127,7 +134,6 @@ Table of Contents
    • Calendar Class
    • Cart Class
    • Config Class
    • -
    • Database Class
    • Email Class
    • Encryption Class
    • File Uploading Class
    • @@ -157,6 +163,13 @@ Table of Contents +

      Driver Reference

      + +

      Helper Reference

      -

      Additional Resources

      - -- cgit v1.2.3-24-g4f1b From ff1cfa1ae5c5440bfde35c36ecb4cdcd73cd3966 Mon Sep 17 00:00:00 2001 From: vascopj Date: Sun, 13 Feb 2011 21:30:19 +0000 Subject: Updated the post method and added the new functionality to the get method also Updated the documentation --- system/core/Input.php | 18 +++++++++++++++++- user_guide/changelog.html | 1 + user_guide/libraries/input.html | 20 ++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/system/core/Input.php b/system/core/Input.php index fa8080deb..1be591508 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -111,6 +111,22 @@ class CI_Input { */ function get($index = '', $xss_clean = FALSE) { + // check if a field has been entered + if( empty($index) AND is_array($_GET) AND count($_GET) ) + { + // no field entered - return all fields + + $all_get_fields = array(); + + // loop through the full _GET array + foreach( $_GET as $key ) + { + $all_get_fields[$key] = $this->_fetch_from_array($_GET, $key, $xss_clean); + } + return $all_get_fields; + + } + return $this->_fetch_from_array($_GET, $index, $xss_clean); } @@ -127,7 +143,7 @@ class CI_Input { function post($index = '', $xss_clean = FALSE) { // check if a field has been entered - if( empty($index ) ) + if( empty($index) AND is_array($_POST) AND count($_POST) ) { // no field entered - return all fields diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 35187efda..92513e6d6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -120,6 +120,7 @@ Hg Tag: v2.0.0

    • Altered Email Library to allow for method chaining.
    • Added request_headers(), get_request_header() and is_ajax_request() to the input class.
    • Altered User agent library so that is_browser(), is_mobile() and is_robot() can optionally check for a specific browser or mobile device.
    • +
    • Altered Input library so that post() and get() will return all POST and GET items (respectively) if there are no parameters passed in.
  • Database diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 552c49afd..4faecd768 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -132,12 +132,32 @@ else
    $this->input->post('some_data', TRUE); +

    To return an array of all POST items call without any parameters.

    +

    To return all POST items and pass them through the XSS filter leave the first parameter blank while setting the second parameter to boolean;

    +

    The function returns FALSE (boolean) if there are no items in the POST.

    + + + $this->input->post(); // returns all POST items with XSS filter +
    + $this->input->post('', FALSE); // returns all POST items without XSS +
    +

    $this->input->get()

    This function is identical to the post function, only it fetches get data:

    $this->input->get('some_data', TRUE); +

    To return an array of all GET items call without any parameters.

    +

    To return all GET items and pass them through the XSS filter leave the first parameter blank while setting the second parameter to boolean;

    +

    The function returns FALSE (boolean) if there are no items in the GET.

    + + + $this->input->get(); // returns all GET items with XSS filter +
    + $this->input->get('', FALSE); // returns all GET items without XSS filtering +
    +

    $this->input->get_post()

    This function will search through both the post and get streams for data, looking first in post, and then in get:

    -- cgit v1.2.3-24-g4f1b From 23351dc30a1787d30a97dd0a8ba83d6e312a5a2f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 14 Feb 2011 00:14:21 -0600 Subject: Fix #329 where the file caching driver referenced the incorrect cache directory. --- system/libraries/Cache/drivers/Cache_file.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php index 3ed357f2f..86d1a3b6a 100644 --- a/system/libraries/Cache/drivers/Cache_file.php +++ b/system/libraries/Cache/drivers/Cache_file.php @@ -39,7 +39,7 @@ class Cache_file extends CI_Driver { $path = $CI->config->item('cache_path'); - $this->_cache_path = ($path == '') ? BASEPATH.'cache/' : $path; + $this->_cache_path = ($path == '') ? APPPATH.'cache/' : $path; } // ------------------------------------------------------------------------ diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 388f25d2a..c37bd4f26 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@ Hg Tag: n/a

    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • Fixed issue #41: Added audio/mp3 mime type to mp3.
    • +
    • Fixed a bug (#329) where the file caching driver referenced the incorrect cache directory.

    Version 2.0.0

    -- cgit v1.2.3-24-g4f1b From 8761ef56b465a190489ed555c6a0ab58470bfc73 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:13:52 -0500 Subject: Uppercasing some stray lowercase keywords for code consistency --- system/database/drivers/odbc/odbc_result.php | 4 ++-- system/database/drivers/postgre/postgre_driver.php | 10 +++++----- system/libraries/Form_validation.php | 4 ++-- system/libraries/Image_lib.php | 2 +- system/libraries/Xmlrpc.php | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index a81a2b8b7..5d64a464f 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -188,7 +188,7 @@ class CI_DB_odbc_result extends CI_DB_result { */ function _odbc_fetch_object(& $odbc_result) { $rs = array(); - $rs_obj = false; + $rs_obj = FALSE; if (odbc_fetch_into($odbc_result, $rs)) { foreach ($rs as $k=>$v) { $field_name= odbc_field_name($odbc_result, $k+1); @@ -210,7 +210,7 @@ class CI_DB_odbc_result extends CI_DB_result { */ function _odbc_fetch_array(& $odbc_result) { $rs = array(); - $rs_assoc = false; + $rs_assoc = FALSE; if (odbc_fetch_into($odbc_result, $rs)) { $rs_assoc=array(); foreach ($rs as $k=>$v) { diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 0bb7974d8..81ca6e051 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -330,21 +330,21 @@ class CI_DB_postgre_driver extends CI_DB { $v = $this->_version(); $v = $v['server']; - $table = func_num_args() > 0 ? func_get_arg(0) : null; - $column = func_num_args() > 1 ? func_get_arg(1) : null; + $table = func_num_args() > 0 ? func_get_arg(0) : NULL; + $column = func_num_args() > 1 ? func_get_arg(1) : NULL; - if ($table == null && $v >= '8.1') + if ($table == NULL && $v >= '8.1') { $sql='SELECT LASTVAL() as ins_id'; } - elseif ($table != null && $column != null && $v >= '8.0') + elseif ($table != NULL && $column != NULL && $v >= '8.0') { $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column); $query = $this->query($sql); $row = $query->row(); $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq); } - elseif ($table != null) + elseif ($table != NULL) { // seq_name passed in table parameter $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table); diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 745fb7c03..c6d7c2976 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1177,7 +1177,7 @@ class CI_Form_validation { { if ( ! is_numeric($str)) { - return false; + return FALSE; } return $str > $min; } @@ -1195,7 +1195,7 @@ class CI_Form_validation { { if ( ! is_numeric($str)) { - return false; + return FALSE; } return $str < $max; } diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 41f9ad393..8902f524d 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -749,7 +749,7 @@ class CI_Image_lib { @chmod($this->full_dst_path, FILE_WRITE_MODE); - return true; + return TRUE; } // -------------------------------------------------------------------- diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 9cf307cc0..0d5a261f9 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -358,7 +358,7 @@ class XML_RPC_Client extends CI_Xmlrpc var $errno = ''; var $errstring = ''; var $timeout = 5; - var $no_multicall = false; + var $no_multicall = FALSE; public function __construct($path, $server, $port=80) { @@ -896,7 +896,7 @@ class XML_RPC_Message extends CI_Xmlrpc $this->xh[$the_parser]['isf'] = 1; break; case 'PARAM': - $this->xh[$the_parser]['value'] = null; + $this->xh[$the_parser]['value'] = NULL; break; case 'VALUE': $this->xh[$the_parser]['vt'] = 'value'; @@ -925,7 +925,7 @@ class XML_RPC_Message extends CI_Xmlrpc $this->xh[$the_parser]['valuestack'][0]['name'] = ''; // Set NULL value to check to see if value passed for this param/member - $this->xh[$the_parser]['value'] = null; + $this->xh[$the_parser]['value'] = NULL; break; case 'DATA': case 'METHODCALL': -- cgit v1.2.3-24-g4f1b From feba2de9287ed2c5d43e555fc52ce2bdedfed0d9 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:25:30 -0500 Subject: Whitespace tweaks to put code examples in line with our guidelines --- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/views.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index ac3841641..4a8b6739e 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -96,7 +96,7 @@ already be running, since the utilities class relies on it.

    $dbs = $this->dbutil->list_databases();

    -foreach($dbs as $db)
    +foreach ($dbs as $db)
    {
        echo $db;
    }
    diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 652cdad29..c843f2f6e 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -94,7 +94,7 @@ written in a simplified format as well. Here is an example using foreach:

    <ul>

    -<?php foreach($todo as $item): ?>
    +<?php foreach ($todo as $item): ?>

    <li><?=$item?></li>

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index fd5bde6af..746f7b846 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -233,7 +233,7 @@ class Blog extends CI_Controller { <h3>My Todo List</h3> <ul> -<?php foreach($todo_list as $item):?> +<?php foreach ($todo_list as $item):?> <li><?php echo $item;?></li> diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index bc0721bb4..fe87a23f2 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -178,7 +178,7 @@ $this->cart->insert($data); <?php $i = 1; ?> -<?php foreach($this->cart->contents() as $items): ?> +<?php foreach ($this->cart->contents() as $items): ?> <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?> diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index c5eab4695..5c3162819 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -125,7 +125,7 @@ In it, place this code and save it to your applications/views/ fold <h3>Your file was successfully uploaded!</h3> <ul> -<?php foreach($upload_data as $item => $value):?> +<?php foreach ($upload_data as $item => $value):?> <li><?php echo $item;?>: <?php echo $value;?></li> <?php endforeach; ?> </ul> -- cgit v1.2.3-24-g4f1b From 45e3cdf52d7438c5a6adf70835d96cfeab1eea0e Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:26:20 -0500 Subject: Whitespace cleanup for code consistency --- system/helpers/captcha_helper.php | 2 +- system/helpers/file_helper.php | 2 +- system/helpers/language_helper.php | 2 +- system/helpers/number_helper.php | 2 +- system/helpers/smiley_helper.php | 4 ++-- system/helpers/text_helper.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index c0e3798f4..19ec0c778 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -87,7 +87,7 @@ if ( ! function_exists('create_captcha')) $current_dir = @opendir($img_path); - while($filename = @readdir($current_dir)) + while ($filename = @readdir($current_dir)) { if ($filename != "." and $filename != ".." and $filename != "index.html") { diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 334eef87c..9518e4843 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -128,7 +128,7 @@ if ( ! function_exists('delete_files')) return FALSE; } - while(FALSE !== ($filename = @readdir($current_dir))) + while (FALSE !== ($filename = @readdir($current_dir))) { if ($filename != "." and $filename != "..") { diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php index 68c1a1fc6..ac0d69da1 100644 --- a/system/helpers/language_helper.php +++ b/system/helpers/language_helper.php @@ -1,4 +1,4 @@ - $id) + foreach ($alias as $name => $id) { $m[] = '"'.$name.'" : "'.$id.'"'; } @@ -101,7 +101,7 @@ EOF; { if (is_array($alias)) { - foreach($alias as $name => $id) + foreach ($alias as $name => $id) { $r .= 'smiley_map["'.$name.'"] = "'.$id.'";'."\n"; } diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 47e6ccc93..96afd4cee 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -443,7 +443,7 @@ if ( ! function_exists('word_wrap')) } $temp = ''; - while((strlen($line)) > $charlim) + while ((strlen($line)) > $charlim) { // If the over-length word is a URL we won't wrap it if (preg_match("!\[url.+\]|://|wwww.!", $line)) -- cgit v1.2.3-24-g4f1b From 5d5895fd1084cd62721afd4c5f875eb2f99eefc4 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:27:07 -0500 Subject: Whitespace cleanup in core/ --- system/core/Config.php | 4 ++-- system/core/Input.php | 6 +++--- system/core/Loader.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/system/core/Config.php b/system/core/Config.php index da22222dc..75f945efd 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -51,7 +51,7 @@ class CI_Config { // Set the base_url automatically if none was provided if ($this->config['base_url'] == '') { - if(isset($_SERVER['HTTP_HOST'])) + if (isset($_SERVER['HTTP_HOST'])) { $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http'; $base_url .= '://'. $_SERVER['HTTP_HOST']; @@ -83,7 +83,7 @@ class CI_Config { $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); $loaded = FALSE; - foreach($this->_config_paths as $path) + foreach ($this->_config_paths as $path) { $file_path = $path.'config/'.ENVIRONMENT.'/'.$file.EXT; diff --git a/system/core/Input.php b/system/core/Input.php index 3e82874fd..cb842812f 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -413,7 +413,7 @@ class CI_Input { { if (is_array($_GET) AND count($_GET) > 0) { - foreach($_GET as $key => $val) + foreach ($_GET as $key => $val) { $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); } @@ -423,7 +423,7 @@ class CI_Input { // Clean $_POST Data if (is_array($_POST) AND count($_POST) > 0) { - foreach($_POST as $key => $val) + foreach ($_POST as $key => $val) { $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); } @@ -441,7 +441,7 @@ class CI_Input { unset($_COOKIE['$Path']); unset($_COOKIE['$Domain']); - foreach($_COOKIE as $key => $val) + foreach ($_COOKIE as $key => $val) { $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); } diff --git a/system/core/Loader.php b/system/core/Loader.php index ca2f016e7..7003318ee 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -79,7 +79,7 @@ class CI_Loader { { if (is_array($library)) { - foreach($library as $read) + foreach ($library as $read) { $this->library($read); } @@ -127,7 +127,7 @@ class CI_Loader { { if (is_array($model)) { - foreach($model as $babe) + foreach ($model as $babe) { $this->model($babe); } -- cgit v1.2.3-24-g4f1b From 68d29873fb155651f46523fdcfb9027102a89f1f Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:39:06 -0500 Subject: Large cleanup of xmlrpcs docblocks. --- system/libraries/Xmlrpcs.php | 178 ++++++++++++++++++++++++++++++------------- 1 file changed, 123 insertions(+), 55 deletions(-) diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 6bedfe324..9cd332147 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -59,10 +59,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc log_message('debug', "XML-RPC Server Class Initialized"); } - //------------------------------------- - // Initialize Prefs and Serve - //------------------------------------- + // -------------------------------------------------------------------- + /** + * Initialize Prefs and Serve + * + * @access public + * @param mixed + * @return void + */ function initialize($config=array()) { if (isset($config['functions']) && is_array($config['functions'])) @@ -86,11 +91,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc } } - //------------------------------------- - // Setting of System Methods - //------------------------------------- + // -------------------------------------------------------------------- - function set_system_methods () + /** + * Setting of System Methods + * + * @access public + * @return void + */ + function set_system_methods() { $this->methods = array( 'system.listMethods' => array( @@ -112,11 +121,14 @@ class CI_Xmlrpcs extends CI_Xmlrpc ); } + // -------------------------------------------------------------------- - //------------------------------------- - // Main Server Function - //------------------------------------- - + /** + * Main Server Function + * + * @access public + * @return void + */ function serve() { $r = $this->parseRequest(); @@ -129,11 +141,19 @@ class CI_Xmlrpcs extends CI_Xmlrpc exit($payload); } - //------------------------------------- - // Add Method to Class - //------------------------------------- + // -------------------------------------------------------------------- - function add_to_map($methodname,$function,$sig,$doc) + /** + * Add Method to Class + * + * @access public + * @param string method name + * @param string function + * @param string signature + * @param string docstring + * @return void + */ + function add_to_map($methodname, $function, $sig, $doc) { $this->methods[$methodname] = array( 'function' => $function, @@ -142,11 +162,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc ); } + // -------------------------------------------------------------------- - //------------------------------------- - // Parse Server Request - //------------------------------------- - + /** + * Parse Server Request + * + * @access public + * @param string data + * @return object xmlrpc response + */ function parseRequest($data='') { global $HTTP_RAW_POST_DATA; @@ -196,7 +220,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc xml_get_current_line_number($parser))); xml_parser_free($parser); } - elseif($parser_object->xh[$parser]['isf']) + elseif ($parser_object->xh[$parser]['isf']) { return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']); } @@ -207,7 +231,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); $plist=''; - for($i=0; $i < count($parser_object->xh[$parser]['params']); $i++) + for ($i=0; $i < count($parser_object->xh[$parser]['params']); $i++) { if ($this->debug === TRUE) { @@ -239,10 +263,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc return $r; } - //------------------------------------- - // Executes the Method - //------------------------------------- + // -------------------------------------------------------------------- + /** + * Executes the Method + * + * @access protected + * @param object + * @return mixed + */ function _execute($m) { $methName = $m->method_name; @@ -297,13 +326,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc if (isset($this->methods[$methName]['signature'])) { $sig = $this->methods[$methName]['signature']; - for($i=0; $iparams)+1) { - for($n=0; $n < count($m->params); $n++) + for ($n=0; $n < count($m->params); $n++) { $p = $m->params[$n]; $pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf(); @@ -352,23 +381,27 @@ class CI_Xmlrpcs extends CI_Xmlrpc return call_user_func($this->methods[$methName]['function'], $m); } } + + // -------------------------------------------------------------------- - - //------------------------------------- - // Server Function: List Methods - //------------------------------------- - + /** + * Server Function: List Methods + * + * @access public + * @param mixed + * @return object + */ function listMethods($m) { $v = new XML_RPC_Values(); $output = array(); - foreach($this->methods as $key => $value) + foreach ($this->methods as $key => $value) { $output[] = new XML_RPC_Values($key, 'string'); } - foreach($this->system_methods as $key => $value) + foreach ($this->system_methods as $key => $value) { $output[]= new XML_RPC_Values($key, 'string'); } @@ -376,11 +409,16 @@ class CI_Xmlrpcs extends CI_Xmlrpc $v->addArray($output); return new XML_RPC_Response($v); } + + // -------------------------------------------------------------------- - //------------------------------------- - // Server Function: Return Signature for Method - //------------------------------------- - + /** + * Server Function: Return Signature for Method + * + * @access public + * @param mixed + * @return object + */ function methodSignature($m) { $parameters = $m->output_parameters(); @@ -393,11 +431,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc $sigs = array(); $signature = $this->methods[$method_name]['signature']; - for($i=0; $i < count($signature); $i++) + for ($i=0; $i < count($signature); $i++) { $cursig = array(); $inSig = $signature[$i]; - for($j=0; $joutput_parameters(); @@ -437,11 +480,16 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); } } + + // -------------------------------------------------------------------- - //------------------------------------- - // Server Function: Multi-call - //------------------------------------- - + /** + * Server Function: Multi-call + * + * @access public + * @param mixed + * @return object + */ function multicall($m) { // Disabled @@ -459,7 +507,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc $m = new XML_RPC_Message($value[0]); $plist=''; - for($i=0; $i < count($value[1]); $i++) + for ($i=0; $i < count($value[1]); $i++) { $m->addParam(new XML_RPC_Values($value[1][$i], 'string')); } @@ -477,11 +525,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Response(new XML_RPC_Values($result, 'array')); } + // -------------------------------------------------------------------- - //------------------------------------- - // Multi-call Function: Error Handling - //------------------------------------- - + /** + * Multi-call Function: Error Handling + * + * @access public + * @param mixed + * @return object + */ function multicall_error($err) { $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); @@ -493,29 +545,45 @@ class CI_Xmlrpcs extends CI_Xmlrpc return new XML_RPC_Values($struct, 'struct'); } + // -------------------------------------------------------------------- - //------------------------------------- - // Multi-call Function: Processes method - //------------------------------------- - + /** + * Multi-call Function: Processes method + * + * @access public + * @param mixed + * @return object + */ function do_multicall($call) { if ($call->kindOf() != 'struct') + { return $this->multicall_error('notstruct'); + } elseif ( ! $methName = $call->me['struct']['methodName']) + { return $this->multicall_error('nomethod'); + } list($scalar_type,$scalar_value)=each($methName->me); $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; if ($methName->kindOf() != 'scalar' OR $scalar_type != 'string') + { return $this->multicall_error('notstring'); + } elseif ($scalar_value == 'system.multicall') + { return $this->multicall_error('recursion'); + } elseif ( ! $params = $call->me['struct']['params']) + { return $this->multicall_error('noparams'); + } elseif ($params->kindOf() != 'array') + { return $this->multicall_error('notarray'); + } list($a,$b)=each($params->me); $numParams = count($b); -- cgit v1.2.3-24-g4f1b From 14287f3e81d4d717ff49e640d799c579e593f0c0 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:39:34 -0500 Subject: Whitespace cleanup in libraries/ --- system/libraries/Driver.php | 6 ++--- system/libraries/Email.php | 12 +++++----- system/libraries/Form_validation.php | 2 +- system/libraries/Profiler.php | 4 ++-- system/libraries/Security.php | 2 +- system/libraries/Sha1.php | 2 +- system/libraries/Table.php | 8 +++---- system/libraries/Trackback.php | 4 ++-- system/libraries/Upload.php | 2 +- system/libraries/Xmlrpc.php | 46 +++++++++++++++++------------------- system/libraries/Zip.php | 2 +- 11 files changed, 44 insertions(+), 46 deletions(-) diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index 15fc3da26..02e093d7e 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -1,4 +1,4 @@ -lib_name)) + if ( ! isset($this->lib_name)) { $this->lib_name = get_class($this); } @@ -143,7 +143,7 @@ class CI_Driver { } } - foreach($r->getProperties() as $prop) + foreach ($r->getProperties() as $prop) { if ($prop->isPublic()) { diff --git a/system/libraries/Email.php b/system/libraries/Email.php index e5af38f45..6c21f114d 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -897,7 +897,7 @@ class CI_Email { } $temp = ''; - while((strlen($line)) > $charlim) + while ((strlen($line)) > $charlim) { // If the over-length word is a URL we won't wrap it if (preg_match("!\[url.+\]|://|wwww.!", $line)) @@ -973,7 +973,7 @@ class CI_Email { reset($this->_headers); $this->_header_str = ""; - foreach($this->_headers as $key => $val) + foreach ($this->_headers as $key => $val) { $val = trim($val); @@ -1607,14 +1607,14 @@ class CI_Email { $this->_send_command('from', $this->clean_email($this->_headers['From'])); - foreach($this->_recipients as $val) + foreach ($this->_recipients as $val) { $this->_send_command('to', $val); } if (count($this->_cc_array) > 0) { - foreach($this->_cc_array as $val) + foreach ($this->_cc_array as $val) { if ($val != "") { @@ -1625,7 +1625,7 @@ class CI_Email { if (count($this->_bcc_array) > 0) { - foreach($this->_bcc_array as $val) + foreach ($this->_bcc_array as $val) { if ($val != "") { @@ -1672,7 +1672,7 @@ class CI_Email { $errstr, $this->smtp_timeout); - if( ! is_resource($this->_smtp_connect)) + if ( ! is_resource($this->_smtp_connect)) { $this->_set_error_message('email_smtp_error', $errno." ".$errstr); return FALSE; diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index c6d7c2976..adfd17db1 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1040,7 +1040,7 @@ class CI_Form_validation { return $this->valid_email(trim($str)); } - foreach(explode(',', $str) as $email) + foreach (explode(',', $str) as $email) { if (trim($email) != '' && $this->valid_email(trim($email)) === FALSE) { diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 6587eae0b..8a1f18ced 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -415,7 +415,7 @@ class CI_Profiler { $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) + 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) { $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; $output .= "\n"; @@ -446,7 +446,7 @@ class CI_Profiler { $output .= "\n\n
    ".$header."  ".$val."
    \n"; - foreach($this->CI->config->config as $config=>$val) + foreach ($this->CI->config->config as $config=>$val) { if (is_array($val)) { diff --git a/system/libraries/Security.php b/system/libraries/Security.php index ba64c7326..91896866f 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -373,7 +373,7 @@ class CI_Security { $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); } } - while($original != $str); + while ($original != $str); unset($original); diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index ad747a001..05a42345a 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -88,7 +88,7 @@ class CI_SHA { $oldd = $d; $olde = $e; - for($j = 0; $j < 80; $j++) + for ($j = 0; $j < 80; $j++) { if ($j < 16) { diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 485541630..2a1a95b16 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -108,7 +108,7 @@ class CI_Table { } $new = array(); - while(count($array) > 0) + while (count($array) > 0) { $temp = array_splice($array, 0, $col_limit); @@ -280,7 +280,7 @@ class CI_Table { $out .= $this->template['heading_row_start']; $out .= $this->newline; - foreach($this->heading as $heading) + foreach ($this->heading as $heading) { $temp = $this->template['heading_cell_start']; @@ -310,7 +310,7 @@ class CI_Table { $out .= $this->newline; $i = 1; - foreach($this->rows as $row) + foreach ($this->rows as $row) { if ( ! is_array($row)) { @@ -323,7 +323,7 @@ class CI_Table { $out .= $this->template['row_'.$name.'start']; $out .= $this->newline; - foreach($row as $cell) + foreach ($row as $cell) { $temp = $this->template['cell_'.$name.'start']; diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index e29b35c7a..b0a767822 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -94,7 +94,7 @@ class CI_Trackback { { $$item = $this->convert_ascii($$item); } - elseif($item == 'blog_name') + elseif ($item == 'blog_name') { $$item = $this->convert_ascii($$item); } @@ -261,7 +261,7 @@ class CI_Trackback { // Was it successful? $this->response = ""; - while( ! feof($fp)) + while ( ! feof($fp)) { $this->response .= fgets($fp, 128); } diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 8f84ffd7e..c8c42d885 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -214,7 +214,7 @@ class CI_Upload { $this->file_name = $this->_prep_filename($this->_file_name_override); // If no extension was provided in the file_name config item, use the uploaded one - if(strpos($this->_file_name_override, '.') === FALSE) + if (strpos($this->_file_name_override, '.') === FALSE) { $this->file_name .= $this->file_ext; } diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 0d5a261f9..a24bca9b6 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -207,7 +207,7 @@ class CI_Xmlrpc { $this->data = array(); - foreach($incoming as $key => $value) + foreach ($incoming as $key => $value) { $this->data[$key] = $this->values_parsing($value); } @@ -232,7 +232,7 @@ class CI_Xmlrpc { { if (is_array($value) && array_key_exists(0, $value)) { - if ( ! isset($value['1']) OR (! isset($this->xmlrpcTypes[$value['1']]))) + if ( ! isset($value['1']) OR ( ! isset($this->xmlrpcTypes[$value['1']]))) { if (is_array($value[0])) { @@ -243,7 +243,7 @@ class CI_Xmlrpc { $temp = new XML_RPC_Values($value['0'], 'string'); } } - elseif(is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array')) + elseif (is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array')) { while (list($k) = each($value['0'])) { @@ -281,7 +281,7 @@ class CI_Xmlrpc { $this->error = $this->result->errstr; return FALSE; } - elseif( ! is_object($this->result->val)) + elseif ( ! is_object($this->result->val)) { $this->error = $this->result->errstr; return FALSE; @@ -392,7 +392,7 @@ class XML_RPC_Client extends CI_Xmlrpc return $r; } - if(empty($msg->payload)) + if (empty($msg->payload)) { // $msg = XML_RPC_Messages $msg->createPayload(); @@ -553,11 +553,11 @@ class XML_RPC_Response { $kind = $xmlrpc_val->kindOf(); - if($kind == 'scalar') + if ($kind == 'scalar') { return $xmlrpc_val->scalarval(); } - elseif($kind == 'array') + elseif ($kind == 'array') { reset($xmlrpc_val->me); list($a,$b) = each($xmlrpc_val->me); @@ -565,18 +565,18 @@ class XML_RPC_Response $arr = array(); - for($i = 0; $i < $size; $i++) + for ($i = 0; $i < $size; $i++) { $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]); } return $arr; } - elseif($kind == 'struct') + elseif ($kind == 'struct') { reset($xmlrpc_val->me['struct']); $arr = array(); - while(list($key,$value) = each($xmlrpc_val->me['struct'])) + while (list($key,$value) = each($xmlrpc_val->me['struct'])) { $arr[$key] = $this->xmlrpc_decoder($value); } @@ -595,10 +595,8 @@ class XML_RPC_Response $t = 0; if (preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/', $time, $regs)) { - if ($utc == 1) - $t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); - else - $t = mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + $fnc = ($utc == 1) ? 'gmmktime' : 'mktime'; + $t = $fnc($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); } return $t; } @@ -628,7 +626,7 @@ class XML_RPC_Message extends CI_Xmlrpc $this->method_name = $method; if (is_array($pars) && count($pars) > 0) { - for($i=0; $iparams[] = $pars[$i]; @@ -646,7 +644,7 @@ class XML_RPC_Message extends CI_Xmlrpc $this->payload .= '' . $this->method_name . "\r\n"; $this->payload .= "\r\n"; - for($i=0; $iparams); $i++) + for ($i=0; $iparams); $i++) { // $p = XML_RPC_Values $p = $this->params[$i]; @@ -664,7 +662,7 @@ class XML_RPC_Message extends CI_Xmlrpc { $data = ''; - while($datum = fread($fp, 4096)) + while ($datum = fread($fp, 4096)) { $data .= $datum; } @@ -684,7 +682,7 @@ class XML_RPC_Message extends CI_Xmlrpc // Check for data //------------------------------------- - if($data == "") + if ($data == "") { error_log($this->xmlrpcstr['no_data']); $r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']); @@ -1108,7 +1106,7 @@ class XML_RPC_Message extends CI_Xmlrpc $this->xh[$the_parser]['lv'] = 2; // Found a value } - if( ! @isset($this->xh[$the_parser]['ac'])) + if ( ! @isset($this->xh[$the_parser]['ac'])) { $this->xh[$the_parser]['ac'] = ''; } @@ -1174,11 +1172,11 @@ class XML_RPC_Message extends CI_Xmlrpc { $kind = $param->kindOf(); - if($kind == 'scalar') + if ($kind == 'scalar') { return $param->scalarval(); } - elseif($kind == 'array') + elseif ($kind == 'array') { reset($param->me); list($a,$b) = each($param->me); @@ -1192,13 +1190,13 @@ class XML_RPC_Message extends CI_Xmlrpc return $arr; } - elseif($kind == 'struct') + elseif ($kind == 'struct') { reset($param->me['struct']); $arr = array(); - while(list($key,$value) = each($param->me['struct'])) + while (list($key,$value) = each($param->me['struct'])) { $arr[$key] = $this->decode_message($value); } @@ -1343,7 +1341,7 @@ class XML_RPC_Values extends CI_Xmlrpc // struct $rs .= "\n"; reset($val); - while(list($key2, $val2) = each($val)) + while (list($key2, $val2) = each($val)) { $rs .= "\n{$key2}\n"; $rs .= $this->serializeval($val2); diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 80633c708..666327d5c 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -289,7 +289,7 @@ class CI_Zip { while (FALSE !== ($file = readdir($fp))) { - if(substr($file, 0, 1) == '.') + if (substr($file, 0, 1) == '.') { continue; } -- cgit v1.2.3-24-g4f1b From c3a4a8d973b9c0a7cc935d150b8b1c6898037c45 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:40:08 -0500 Subject: Whitespace cleanup in db classes --- system/database/DB.php | 2 +- system/database/DB_active_rec.php | 6 +++--- system/database/DB_driver.php | 12 ++++++------ system/database/DB_forge.php | 2 +- system/database/DB_result.php | 2 +- system/database/drivers/mssql/mssql_driver.php | 4 ++-- system/database/drivers/mysql/mysql_driver.php | 10 +++++----- system/database/drivers/mysqli/mysqli_driver.php | 10 +++++----- system/database/drivers/oci8/oci8_driver.php | 6 +++--- system/database/drivers/odbc/odbc_driver.php | 4 ++-- system/database/drivers/postgre/postgre_driver.php | 4 ++-- system/database/drivers/sqlite/sqlite_driver.php | 4 ++-- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/system/database/DB.php b/system/database/DB.php index 513e5aefd..93ee3922a 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -88,7 +88,7 @@ function &DB($params = '', $active_record_override = NULL) { parse_str($dns['query'], $extra); - foreach($extra as $key => $val) + foreach ($extra as $key => $val) { // booleans please if (strtoupper($val) == "TRUE") diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index ce9d1c1af..06ec3cd95 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1167,7 +1167,7 @@ class CI_DB_active_record extends CI_DB_driver { { $clean = array(); - foreach($row as $value) + foreach ($row as $value) { $clean[] = $this->escape($value); } @@ -1425,7 +1425,7 @@ class CI_DB_active_record extends CI_DB_driver { $index_set = FALSE; $clean = array(); - foreach($v as $k2 => $v2) + foreach ($v as $k2 => $v2) { if ($k2 == $index) { @@ -1569,7 +1569,7 @@ class CI_DB_active_record extends CI_DB_driver { } elseif (is_array($table)) { - foreach($table as $single_table) + foreach ($table as $single_table) { $this->delete($single_table, $where, $limit, FALSE); } diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 2d8f592e3..e7a9de475 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -767,7 +767,7 @@ class CI_DB_driver { if ($query->num_rows() > 0) { - foreach($query->result_array() as $row) + foreach ($query->result_array() as $row) { if (isset($row['TABLE_NAME'])) { @@ -834,7 +834,7 @@ class CI_DB_driver { $query = $this->query($sql); $retval = array(); - foreach($query->result_array() as $row) + foreach ($query->result_array() as $row) { if (isset($row['COLUMN_NAME'])) { @@ -904,7 +904,7 @@ class CI_DB_driver { $fields = array(); $values = array(); - foreach($data as $key => $val) + foreach ($data as $key => $val) { $fields[] = $this->_escape_identifiers($key); $values[] = $this->escape($val); @@ -932,7 +932,7 @@ class CI_DB_driver { } $fields = array(); - foreach($data as $key => $val) + foreach ($data as $key => $val) { $fields[$this->_protect_identifiers($key)] = $this->escape($val); } @@ -1175,7 +1175,7 @@ class CI_DB_driver { $trace = debug_backtrace(); - foreach($trace as $call) + foreach ($trace as $call) { if (isset($call['file']) && strpos($call['file'], BASEPATH.'database') === FALSE) { @@ -1248,7 +1248,7 @@ class CI_DB_driver { { $escaped_array = array(); - foreach($item as $k => $v) + foreach ($item as $k => $v) { $escaped_array[$this->_protect_identifiers($k)] = $this->_protect_identifiers($v); } diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 27f2c372d..a71fca78f 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -99,7 +99,7 @@ class CI_DB_forge { { if (is_array($key)) { - foreach($key as $one) + foreach ($key as $one) { $this->add_key($one, $primary); } diff --git a/system/database/DB_result.php b/system/database/DB_result.php index fb4268c21..76e1d6abb 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -78,7 +78,7 @@ class CI_DB_result { while ($row = $this->_fetch_object()) { $object = new $class_name(); - foreach($row as $key => $value) + foreach ($row as $key => $value) { $object->$key = $value; } diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 5a69132cd..5048c0b4a 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -253,7 +253,7 @@ class CI_DB_mssql_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -551,7 +551,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key." = ".$val; } diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 72c834b8f..4ff9b0a11 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -286,7 +286,7 @@ class CI_DB_mysql_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -590,7 +590,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key . ' = ' . $val; } @@ -627,11 +627,11 @@ class CI_DB_mysql_driver extends CI_DB { $ids = array(); $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; - foreach($values as $key => $val) + foreach ($values as $key => $val) { $ids[] = $val[$index]; - foreach(array_keys($val) as $field) + foreach (array_keys($val) as $field) { if ($field != $index) { @@ -643,7 +643,7 @@ class CI_DB_mysql_driver extends CI_DB { $sql = "UPDATE ".$table." SET "; $cases = ''; - foreach($final as $k => $v) + foreach ($final as $k => $v) { $cases .= $k.' = CASE '."\n"; foreach ($v as $row) diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 8942100d4..ccdabce1a 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -287,7 +287,7 @@ class CI_DB_mysqli_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -571,7 +571,7 @@ class CI_DB_mysqli_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key." = ".$val; } @@ -607,11 +607,11 @@ class CI_DB_mysqli_driver extends CI_DB { $ids = array(); $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; - foreach($values as $key => $val) + foreach ($values as $key => $val) { $ids[] = $val[$index]; - foreach(array_keys($val) as $field) + foreach (array_keys($val) as $field) { if ($field != $index) { @@ -623,7 +623,7 @@ class CI_DB_mysqli_driver extends CI_DB { $sql = "UPDATE ".$table." SET "; $cases = ''; - foreach($final as $k => $v) + foreach ($final as $k => $v) { $cases .= $k.' = CASE '."\n"; foreach ($v as $row) diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 64f53cc3f..14df104ff 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -253,7 +253,7 @@ class CI_DB_oci8_driver extends CI_DB { $sql = "begin $package.$procedure("; $have_cursor = FALSE; - foreach($params as $param) + foreach ($params as $param) { $sql .= $param['name'] . ","; @@ -395,7 +395,7 @@ class CI_DB_oci8_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -655,7 +655,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key." = ".$val; } diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index c8e03c356..81e0d7cf2 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -264,7 +264,7 @@ class CI_DB_odbc_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -523,7 +523,7 @@ class CI_DB_odbc_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key." = ".$val; } diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 81ca6e051..47ff36246 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -283,7 +283,7 @@ class CI_DB_postgre_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -568,7 +568,7 @@ class CI_DB_postgre_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key." = ".$val; } diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 5bfc1f558..eb4e585b3 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -280,7 +280,7 @@ class CI_DB_sqlite_driver extends CI_DB { { if (is_array($str)) { - foreach($str as $key => $val) + foreach ($str as $key => $val) { $str[$key] = $this->escape_str($val, $like); } @@ -537,7 +537,7 @@ class CI_DB_sqlite_driver extends CI_DB { */ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { - foreach($values as $key => $val) + foreach ($values as $key => $val) { $valstr[] = $key." = ".$val; } -- cgit v1.2.3-24-g4f1b From f46d9d6abdc6ae71a3307cf76f7064d0aa18eb65 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 14 Feb 2011 21:53:48 +0000 Subject: Removed Migration code for now, will come back later. --- application/config/migration.php | 38 ----- system/libraries/Migration.php | 336 --------------------------------------- 2 files changed, 374 deletions(-) delete mode 100644 application/config/migration.php delete mode 100644 system/libraries/Migration.php diff --git a/application/config/migration.php b/application/config/migration.php deleted file mode 100644 index 37b1b8534..000000000 --- a/application/config/migration.php +++ /dev/null @@ -1,38 +0,0 @@ -migration->latest() this is the version that schema will -| be upgraded / downgraded to. -| -*/ -$config['migration_version'] = 1; - - -/* -|-------------------------------------------------------------------------- -| Migrations Path -|-------------------------------------------------------------------------- -| -| Path to your migrations folder. -| Typically, it will be within your application path. -| Also, writing permission is required within the migrations path. -| -*/ -$config['migration_path'] = APPPATH . 'migrations/'; diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php deleted file mode 100644 index 73c55c346..000000000 --- a/system/libraries/Migration.php +++ /dev/null @@ -1,336 +0,0 @@ - $val) - { - $this->{'_' . $key} = $val; - } - - log_message('debug', 'Migrations class initialized'); - - // Are they trying to use migrations while it is disabled? - if ($this->_migration_enabled !== TRUE) - { - show_error('Migrations has been loaded but is disabled or set up incorrectly.'); - } - - // If not set, set it - $this->_migration_path == '' OR $this->_migration_path = APPPATH . 'migrations/'; - - // Add trailing slash if not set - $this->_migration_path = rtrim($this->_migration_path, '/').'/'; - - // They'll probably be using dbforge - $this->load->dbforge(); - - // If the migrations table is missing, make it - if ( ! $this->db->table_exists('migrations')) - { - $this->dbforge->add_field(array( - 'version' => array('type' => 'INT', 'constraint' => 3), - )); - - $this->dbforge->create_table('migrations', TRUE); - - $this->db->insert('migrations', array('version' => 0)); - } - } - - // -------------------------------------------------------------------- - - /** - * Migrate to a schema version - * - * Calls each migration step required to get to the schema version of - * choice - * - * @access public - * @param $version integer Target schema version - * @return mixed TRUE if already latest, FALSE if failed, int if upgraded - */ - function version($target_version) - { - $start = $current_version = $this->_get_version(); - $stop = $target_version; - - if ($target_version > $current_version) - { - // Moving Up - ++$start; - ++$stop; - $step = 1; - } - - else - { - // Moving Down - $step = -1; - } - - $method = $step === 1 ? 'up' : 'down'; - $migrations = array(); - - // We now prepare to actually DO the migrations - // But first let's make sure that everything is the way it should be - for ($i = $start; $i != $stop; $i += $step) - { - $f = glob(sprintf($this->_migration_path . '%03d_*.php', $i)); - - // Only one migration per step is permitted - if (count($f) > 1) - { - $this->error = sprintf($this->lang->line('multiple_migration_version'), $i); - return FALSE; - } - - // Migration step not found - if (count($f) == 0) - { - // If trying to migrate up to a version greater than the last - // existing one, migrate to the last one. - if ($step == 1) - { - break; - } - - // If trying to migrate down but we're missing a step, - // something must definitely be wrong. - $this->error = sprintf($this->lang->line('migration_not_found'), $i); - return FALSE; - } - - $file = basename($f[0]); - $name = basename($f[0], '.php'); - - // Filename validations - if (preg_match('/^\d{3}_(\w+)$/', $name, $match)) - { - $match[1] = strtolower($match[1]); - - // Cannot repeat a migration at different steps - if (in_array($match[1], $migrations)) - { - $this->error = sprintf($this->lang->line('multiple_migrations_name'), $match[1]); - return FALSE; - } - - include $f[0]; - $class = 'Migration_' . ucfirst($match[1]); - - if ( ! class_exists($class)) - { - $this->error = sprintf($this->lang->line('migration_class_doesnt_exist'), $class); - return FALSE; - } - - if ( ! is_callable(array($class, 'up')) || ! is_callable(array($class, 'down'))) - { - $this->error = sprintf($this->lang->line('wrong_migration_interface'), $class); - return FALSE; - } - - $migrations[] = $match[1]; - } - else - { - $this->error = sprintf($this->lang->line('invalid_migration_filename'), $file); - return FALSE; - } - } - - $this->log('Current schema version: ' . $current_version); - - $version = $i + ($step == 1 ? -1 : 0); - - // If there is nothing to do so quit - if ($migrations === array()) - { - return TRUE; - } - - $this->log('Moving ' . $method . ' to version ' . $version); - - // Loop through the migrations - foreach ($migrations AS $migration) - { - // Run the migration class - $class = 'Migration_' . ucfirst(strtolower($migration)); - call_user_func(array(new $class, $method)); - - $current_version += $step; - $this->_update_version($current_version); - } - - $this->log('All done. Schema is at version '.$current_version); - - return $current_version; - } - - // -------------------------------------------------------------------- - - /** - * Set's the schema to the latest migration - * - * @access public - * @return mixed true if already latest, false if failed, int if upgraded - */ - public function latest() - { - if ( ! $migrations = $this->find_migrations()) - { - throw new Exception('no_migrations_found'); - return false; - } - - $last_migration = basename(end($migrations)); - - // Calculate the last migration step from existing migration - // filenames and procceed to the standard version migration - $last_version = intval(substr($last_migration, 0, 3)); - return $this->version($last_version); - } - - // -------------------------------------------------------------------- - - /** - * Set's the schema to the migration version set in config - * - * @access public - * @return mixed true if already current, false if failed, int if upgraded - */ - public function current() - { - $version = $this->_migration_version; - return $this->version($version); - } - - // -------------------------------------------------------------------- - - /** - * Set's the schema to the latest migration - * - * @access public - * @return mixed true if already latest, false if failed, int if upgraded - */ - - protected static function find_migrations() - { - // Load all *_*.php files in the migrations path - $files = glob($this->_migration_path . '*_*.php'); - $file_count = count($files); - - for ($i = 0; $i < $file_count; $i++) - { - // Mark wrongly formatted files as false for later filtering - $name = basename($files[$i], '.php'); - if ( ! preg_match('/^\d{3}_(\w+)$/', $name)) - { - $files[$i] = FALSE; - } - } - - sort($files); - - return $files; - } - - // -------------------------------------------------------------------- - - /** - * Retrieves current schema version - * - * @access private - * @return integer Current Schema version - */ - private function _get_version() - { - $row = $this->db->get('migrations')->row(); - return $row ? $row->version : 0; - } - - // -------------------------------------------------------------------- - - /** - * Stores the current schema version - * - * @access private - * @param $migrations integer Schema version reached - * @return void Outputs a report of the migration - */ - private function _update_version($migrations) - { - return $this->db->update('migrations', array( - 'version' => $migrations - )); - } - - // -------------------------------------------------------------------- - - /** - * Stores the current schema version - * - * @access private - * @param $migrations integer Schema version reached - * @return void Outputs a report of the migration - */ - private function log($text) - { - echo $text.'
    '; - } - - // -------------------------------------------------------------------- - - /** - * Enable the use of CI super-global - * - * @access public - * @param $var - * @return mixed - */ - public function __get($var) - { - return get_instance()->$var; - } -} \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 44f210543cf6adcac99264d973dd73ea1b0ab37e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 15 Feb 2011 21:39:25 +0000 Subject: Input post() and get() will now return a full array if the first argument is not provided. --- system/core/Input.php | 36 +++++++++++++++--------------------- user_guide/changelog.html | 3 ++- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index ea5b248cf..16b295546 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -109,22 +109,19 @@ class CI_Input { * @param bool * @return string */ - function get($index = '', $xss_clean = FALSE) + function get($index = NULL, $xss_clean = FALSE) { - // check if a field has been entered - if( empty($index) AND is_array($_GET) AND count($_GET) ) + // Check if a field has been provided + if ($index === NULL AND ! empty($_GET)) { - // no field entered - return all fields - - $all_get_fields = array(); + $get = array(); // loop through the full _GET array - foreach( $_GET as $key ) + foreach (array_keys($_GET) as $key) { - $all_get_fields[$key] = $this->_fetch_from_array($_GET, $key, $xss_clean); + $get[$key] = $this->_fetch_from_array($_GET, $key, $xss_clean); } - return $all_get_fields; - + return $get; } return $this->_fetch_from_array($_GET, $index, $xss_clean); @@ -140,22 +137,19 @@ class CI_Input { * @param bool * @return string */ - function post($index = '', $xss_clean = FALSE) + function post($index = NULL, $xss_clean = FALSE) { - // check if a field has been entered - if( empty($index) AND is_array($_POST) AND count($_POST) ) + // Check if a field has been provided + if ($index === NULL AND ! empty($_POST)) { - // no field entered - return all fields + $post = array(); - $all_post_fields = array(); - - // loop through the full _POST array - foreach( $_POST as $key ) + // Loop through the full _POST array and return it + foreach (array_keys($_POST) as $key) { - $all_post_fields[$key] = $this->_fetch_from_array($_POST, $key, $xss_clean); + $post[$key] = $this->_fetch_from_array($_POST, $key, $xss_clean); } - return $all_post_fields; - + return $post; } return $this->_fetch_from_array($_POST, $index, $xss_clean); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d58d43552..ccfbd0528 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,7 +66,8 @@ Hg Tag: n/a

    • Libraries
        -
      • Added decimal, less_than and greater_than rules to the Form validation Class.
      • +
      • Added decimal, less_than and greater_than rules to the Form validation Class.
      • +
      • Input Class methods post() and get() will now return a full array if the first argument is not provided.
    -- cgit v1.2.3-24-g4f1b From d0ac1a250608c1fe21f11bb96c4291e38962b187 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 15 Feb 2011 22:54:08 +0000 Subject: Better potential fix for escaping MySQL keywords with backticks on insert/update. --- system/database/DB_active_rec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 06ec3cd95..ee72dbbf4 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -954,7 +954,7 @@ class CI_DB_active_record extends CI_DB_driver { } else { - $this->ar_set[$this->_protect_identifiers($k)] = $this->escape($v); + $this->ar_set[$this->_protect_identifiers($k, FALSE, TRUE)] = $this->escape($v); } } @@ -1156,7 +1156,7 @@ class CI_DB_active_record extends CI_DB_driver { $this->ar_set[] = array(); return; } - + ksort($row); // puts $row in the same order as our keys if ($escape === FALSE) -- cgit v1.2.3-24-g4f1b From f2b9c911bcee47166f3fdc8f2f57d1cafeade006 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 16:56:37 +0000 Subject: Applied Dan's fix for the incorrectly named Sha1 class. --- system/libraries/Sha1.php | 2 +- user_guide/changelog.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index 05a42345a..1a657572b 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -42,7 +42,7 @@ * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/general/encryption.html */ -class CI_SHA { +class CI_SHA1 { public function __construct() { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ccfbd0528..4d3b502a8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -76,7 +76,8 @@ Hg Tag: n/a

    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • Fixed issue #41: Added audio/mp3 mime type to mp3.
    • -
    • Fixed a bug (#329) where the file caching driver referenced the incorrect cache directory.
    • +
    • Fixed a bug (Core #329) where the file caching driver referenced the incorrect cache directory.
    • +
    • Fixed a bug (Reactor #69) where the SHA1 library was named incorrectly.

    Version 2.0.0

    -- cgit v1.2.3-24-g4f1b From d8d1e24eee56d2466c91ecd72b3c8932eb3d0639 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 17:23:16 +0000 Subject: Secure cookies can now be made with the set_cookie() helper and Input Class method. --- system/core/Input.php | 7 ++++--- system/helpers/cookie_helper.php | 4 ++-- user_guide/changelog.html | 1 + user_guide/libraries/input.html | 18 ++++++++++-------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index 16b295546..3957aa63d 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -208,13 +208,14 @@ class CI_Input { * @param string the cookie domain. Usually: .yourdomain.com * @param string the cookie path * @param string the cookie prefix + * @param bool true makes the cookie secure * @return void */ - function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '') + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) { if (is_array($name)) { - foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name') as $item) + foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name', 'secure') as $item) { if (isset($name[$item])) { @@ -245,7 +246,7 @@ class CI_Input { $expire = ($expire > 0) ? time() + $expire : 0; } - setcookie($prefix.$name, $value, $expire, $path, $domain, 0); + setcookie($prefix.$name, $value, $expire, $path, $domain, $secure); } // -------------------------------------------------------------------- diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 7701d503f..7cee02827 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -44,11 +44,11 @@ */ if ( ! function_exists('set_cookie')) { - function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '') + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) { // Set the config file options $CI =& get_instance(); - $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); + $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure); } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4d3b502a8..ab825c8d8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,7 @@ Hg Tag: n/a

    • Added decimal, less_than and greater_than rules to the Form validation Class.
    • Input Class methods post() and get() will now return a full array if the first argument is not provided.
    • +
    • Secure cookies can now be made with the set_cookie() helper and Input Class method.
    diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 4faecd768..844e99ab8 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -187,13 +187,14 @@ Array Method, and Discrete Parameters:

    Using this method, an associative array is passed to the first parameter:

    $cookie = array(
    -                   'name'   => 'The Cookie Name',
    -                   'value'  => 'The Value',
    -                   'expire' => '86500',
    -                   'domain' => '.some-domain.com',
    -                   'path'   => '/',
    -                   'prefix' => 'myprefix_',
    -               );
    +    'name'   => 'The Cookie Name',
    +    'value'  => 'The Value',
    +    'expire' => '86500',
    +    'domain' => '.some-domain.com',
    +    'path'   => '/',
    +    'prefix' => 'myprefix_',
    +    'secure' => TRUE
    +);

    $this->input->set_cookie($cookie);
    @@ -208,12 +209,13 @@ 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

    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.

    Discrete Parameters

    If you prefer, you can set the cookie by passing data using individual parameters:

    -$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); +$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);

    $this->input->get_cookie()

    -- cgit v1.2.3-24-g4f1b From 9b77fe3e39894af4816a662630c442ab89f16e31 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 19:05:25 +0000 Subject: Updated input documentation to use NULL instead of empty string for new post() and get() changes. --- user_guide/libraries/input.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 844e99ab8..0615fe622 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -139,7 +139,7 @@ else
    $this->input->post(); // returns all POST items with XSS filter
    - $this->input->post('', FALSE); // returns all POST items without XSS + $this->input->post(NULL, FALSE); // returns all POST items without XSS

    $this->input->get()

    @@ -155,7 +155,7 @@ else
    $this->input->get(); // returns all GET items with XSS filter
    - $this->input->get('', FALSE); // returns all GET items without XSS filtering + $this->input->get(NULL, FALSE); // returns all GET items without XSS filtering

    $this->input->get_post()

    -- cgit v1.2.3-24-g4f1b From 9aa7dc9c96baedf06afb443553a313297158f850 Mon Sep 17 00:00:00 2001 From: tobiasbg Date: Fri, 18 Feb 2011 21:57:13 +0100 Subject: Bugfix in foreach-loop ('name' must be last, as it also is the array's name); consistent handling for 'cookie_secure' config item --- system/core/Input.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index 25fe102b5..626245390 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -211,11 +211,12 @@ class CI_Input { * @param bool true makes the cookie secure * @return void */ - function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = NULL) + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) { if (is_array($name)) { - foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name', 'secure') as $item) + // always leave 'name' in last place, as the loop will break otherwise, due to $$item + foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'name') as $item) { if (isset($name[$item])) { @@ -236,6 +237,10 @@ class CI_Input { { $path = config_item('cookie_path'); } + if ($secure == FALSE AND config_item('cookie_secure') != FALSE) + { + $secure = config_item('cookie_secure'); + } if ( ! is_numeric($expire)) { @@ -246,12 +251,6 @@ class CI_Input { $expire = ($expire > 0) ? time() + $expire : 0; } - // If TRUE/FALSE is not provided, use the config - if ( ! is_bool($secure)) - { - $secure = (bool) (config_item('cookie_secure') === TRUE); - } - setcookie($prefix.$name, $value, $expire, $path, $domain, $secure); } -- cgit v1.2.3-24-g4f1b From ba6432c6e16350c4235ee49ac0388500b28a150c Mon Sep 17 00:00:00 2001 From: tobiasbg Date: Fri, 18 Feb 2011 21:58:48 +0100 Subject: Consistent handling of 'cookie_secure' setting, also makes the variable changeable through the Session class constructor --- system/libraries/Session.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 0b94340d5..182294059 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -37,6 +37,7 @@ class CI_Session { var $cookie_prefix = ''; var $cookie_path = ''; var $cookie_domain = ''; + var $cookie_secure = FALSE; var $sess_time_to_update = 300; var $encryption_key = ''; var $flashdata_key = 'flash'; @@ -61,7 +62,7 @@ class CI_Session { // Set all the session preferences, which can either be set // manually via the $params array above or via the config file - foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) + foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'cookie_secure', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) { $this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key); } @@ -658,8 +659,6 @@ class CI_Session { } $expire = ($this->sess_expire_on_close === TRUE) ? 0 : $this->sess_expiration + time(); - - $secure_cookie = (config_item('cookie_secure') === TRUE) ? 1 : 0; // Set the cookie setcookie( @@ -668,7 +667,7 @@ class CI_Session { $expire, $this->cookie_path, $this->cookie_domain, - $secure_cookie + $this->cookie_secure ); } -- cgit v1.2.3-24-g4f1b From 283d3c82ce39e7b3977757aca92fbd1b41e2c120 Mon Sep 17 00:00:00 2001 From: Kenny Katzgrau Date: Sun, 20 Feb 2011 18:12:59 -0500 Subject: Fixed docs specifying cache location (sys/cache v app/cache) --- user_guide/general/caching.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 440896bb7..9f49b95d6 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -68,7 +68,7 @@ By caching your pages, since they are saved in their fully rendered state, you c

    How Does Caching Work?

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. -When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved +When a page is loaded for the first time, the cache file will be written to your application/cache folder. On subsequent page loads the cache file will be retrieved and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    @@ -86,7 +86,7 @@ most logical to you. Once the tag is in place, your pages will begin being cache

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    Note: Before the cache files can be written you must set the file permissions on your -system/cache folder such that it is writable.

    +application/cache folder such that it is writable.

    Deleting Caches

    -- cgit v1.2.3-24-g4f1b From e8b8d6824ca0a9bb3cadf88590be20744d71b867 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 23 Feb 2011 16:21:39 +0000 Subject: Added documentation for DB active record insert_batch(); --- user_guide/database/active_record.html | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 30c45fdde..f2f33e212 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -489,10 +489,10 @@ echo $this->db->count_all_results();
    $data = array(
    -               'title' => 'My title' ,
    -               'name' => 'My Name' ,
    -               'date' => 'My date'
    -            );
    +   'title' => 'My title' ,
    +   'name' => 'My Name' ,
    +   'date' => 'My date'
    +);

    $this->db->insert('mytable', $data);

    @@ -521,6 +521,31 @@ $this->db->insert('mytable', $object);

    Note: All values are escaped automatically producing safer queries.

    +

    $this->db->insert_batch();

    +

    Generates an insert string based on the data you supply, and runs the query. You can either pass an +array or an object to the function. Here is an example using an array:

    + + +$data = array(
    +   array(
    +      'title' => 'My title' ,
    +      'name' => 'My Name' ,
    +      'date' => 'My date'
    +   ),
    +   array(
    +      'title' => 'Another title' ,
    +      'name' => 'Another Name' ,
    +      'date' => 'Another date'
    +   )
    +);
    +
    +$this->db->insert_batch('mytable', $data); +

    +// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')
    + +

    The first parameter will contain the table name, the second is an associative array of values.

    + +

    Note: All values are escaped automatically producing safer queries.

    -- cgit v1.2.3-24-g4f1b From 58f5f0fe32aeb2e8a4f72e23d4acaa874b598b78 Mon Sep 17 00:00:00 2001 From: katzgrau Date: Thu, 24 Feb 2011 09:31:28 -0500 Subject: Adding a link to the User Agent Class docs from the user_agent function of the input class --- user_guide/libraries/input.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 0615fe622..2bc9b3b8c 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -253,7 +253,7 @@ else

    $this->input->user_agent()

    Returns the user agent (web browser) being used by the current user. Returns FALSE if it's not available.

    echo $this->input->user_agent(); - +

    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.

    -- cgit v1.2.3-24-g4f1b From 9869f890f21c30d0016cd28d8ea1bdb89da3e96a Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 8 Mar 2011 21:16:53 +0000 Subject: Added 'json' to config/mimes.php. --- application/config/mimes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/config/mimes.php b/application/config/mimes.php index 58eea5f83..8065794ff 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -97,7 +97,8 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'word' => array('application/msword', 'application/octet-stream'), 'xl' => 'application/excel', - 'eml' => 'message/rfc822' + 'eml' => 'message/rfc822', + 'json' => array('application/json', 'text/json') ); -- cgit v1.2.3-24-g4f1b From 60ed1a305bea9f879489a1b4c7ac223b6cf3e132 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 8 Mar 2011 21:43:54 +0000 Subject: Added $this->output->set_content_type() and method chaining to other methods. --- system/core/Output.php | 67 +++++++++++++++++++++++++++++++++++----- user_guide/changelog.html | 2 ++ user_guide/libraries/output.html | 15 +++++++++ 3 files changed, 77 insertions(+), 7 deletions(-) diff --git a/system/core/Output.php b/system/core/Output.php index 7fb9f7916..6644b3bff 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -28,19 +28,24 @@ */ class CI_Output { - var $final_output; - var $cache_expiration = 0; - var $headers = array(); - var $enable_profiler = FALSE; - var $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage} + protected $final_output; + protected $cache_expiration = 0; + protected $headers = array(); + protected $mime_types = array(); + protected $enable_profiler = FALSE; + protected $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage} - var $_zlib_oc = FALSE; - var $_profiler_sections = array(); + protected $_zlib_oc = FALSE; + protected $_profiler_sections = array(); function __construct() { $this->_zlib_oc = @ini_get('zlib.output_compression'); + // Get mime types for later + include APPPATH.'config/mimes'.EXT; + $this->mime_types = $mimes; + log_message('debug', "Output Class Initialized"); } @@ -73,6 +78,8 @@ class CI_Output { function set_output($output) { $this->final_output = $output; + + return $this; } // -------------------------------------------------------------------- @@ -96,6 +103,8 @@ class CI_Output { { $this->final_output .= $output; } + + return $this; } // -------------------------------------------------------------------- @@ -125,6 +134,42 @@ class CI_Output { } $this->headers[] = array($header, $replace); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Set Content Type Header + * + * @access public + * @param string extension of the file we're outputting + * @return void + */ + function set_content_type($mime_type) + { + if (strpos($mime_type, '/') === FALSE) + { + $extension = ltrim($mime_type, '.'); + + // Is this extension supported? + if (isset($this->mime_types[$extension])) + { + $mime_type =& $this->mime_types[$extension]; + + if (is_array($mime_type)) + { + $mime_type = current($mime_type); + } + } + } + + $header = 'Content-Type: '.$mime_type; + + $this->headers[] = array($header, TRUE); + + return $this; } // -------------------------------------------------------------------- @@ -141,6 +186,8 @@ class CI_Output { function set_status_header($code = 200, $text = '') { set_status_header($code, $text); + + return $this; } // -------------------------------------------------------------------- @@ -155,6 +202,8 @@ class CI_Output { function enable_profiler($val = TRUE) { $this->enable_profiler = (is_bool($val)) ? $val : TRUE; + + return $this; } // -------------------------------------------------------------------- @@ -174,6 +223,8 @@ class CI_Output { { $this->_profiler_sections[$section] = ($enable !== FALSE) ? TRUE : FALSE; } + + return $this; } // -------------------------------------------------------------------- @@ -188,6 +239,8 @@ class CI_Output { function cache($time) { $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time; + + return $this; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d759686e9..815590dc1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,8 @@ Hg Tag: n/a

  • Added decimal, less_than and greater_than rules to the Form validation Class.
  • Input Class methods post() and get() will now return a full array if the first argument is not provided.
  • Secure cookies can now be made with the set_cookie() helper and Input Class method.
  • +
  • Added set_content_type() to Output Class to set the output Content-Type HTTP header based on a MIME Type or a config/mimes.php array key.
  • +
  • Output Class will now support method chaining.
  • diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index ab8f1d683..25ec521b1 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -78,6 +78,21 @@ It is possible, however, for you to manually intervene with the output if you ne For example, if you build a page in one of your controller functions, don't set the output until the end.

    +

    $this->output->set_content_type();

    + +

    Permits you to set the mime-type of your page so you can serve JSON data, JPEG's, XML, etc easily.

    + +$this->output
    +    ->set_content_type('application/json')
    +    ->set_output(json_encode(array('foo' => 'bar')));
    +
    +$this->output
    +    ->set_content_type('jpeg') // You could also use ".jpeg" which will have the full stop removed before looking in config/mimes.php
    +    ->set_output(file_get_contents('files/something.jpg'));
    + +

    Important: Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect.

    + +

    $this->output->get_output();

    Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

    -- cgit v1.2.3-24-g4f1b From 2f8b27efeb0a39c24eddf89cf31ea0fd113a6b71 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 8 Mar 2011 21:56:08 +0000 Subject: Added the constant CI_CORE to help differentiate between Core: TRUE and Reactor: FALSE. --- system/core/CodeIgniter.php | 7 +++++++ user_guide/changelog.html | 1 + 2 files changed, 8 insertions(+) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 567e67f65..b91ed3896 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -34,6 +34,13 @@ */ define('CI_VERSION', '2.0'); +/* + * ------------------------------------------------------ + * Define the CodeIgniter Branch (Core = TRUE, Reactor = FALSE) + * ------------------------------------------------------ + */ + define('CI_CORE', FALSE); + /* * ------------------------------------------------------ * Load the global functions diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 815590dc1..159f1a645 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@ Hg Tag: n/a

  • General changes
    • Added $config['cookie_secure'] to the config file to allow requiring a secure (HTTPS) in order to set cookies.
    • +
    • Added the constant CI_CORE to help differentiate between Core: TRUE and Reactor: FALSE.
  • Libraries -- cgit v1.2.3-24-g4f1b