From 37f4b9caa02783e06dd7c5318200113409a0deb1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:56:50 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- application/config/autoload.php | 22 +-- application/config/config.php | 40 ++-- application/config/constants.php | 6 +- application/config/database.php | 10 +- application/config/foreign_chars.php | 2 +- application/config/hooks.php | 4 +- application/config/mimes.php | 8 +- application/config/profiler.php | 2 +- application/config/routes.php | 2 +- application/config/smileys.php | 4 +- application/config/user_agents.php | 6 +- application/controllers/welcome.php | 4 +- application/errors/error_php.php | 2 +- index.php | 30 +-- license.txt | 4 +- system/core/Benchmark.php | 4 +- system/core/CodeIgniter.php | 68 +++---- system/core/Common.php | 28 +-- system/core/Config.php | 18 +- system/core/Controller.php | 6 +- system/core/Exceptions.php | 6 +- system/core/Hooks.php | 4 +- system/core/Input.php | 24 +-- system/core/Lang.php | 2 +- system/core/Loader.php | 60 +++--- system/core/Model.php | 2 +- system/core/Output.php | 20 +- system/core/Router.php | 26 +-- system/core/Security.php | 104 +++++----- system/core/URI.php | 14 +- system/core/Utf8.php | 2 +- system/database/DB.php | 16 +- system/database/DB_active_rec.php | 32 +-- system/database/DB_cache.php | 6 +- system/database/DB_driver.php | 34 ++-- system/database/DB_forge.php | 2 +- system/database/DB_result.php | 106 +++++----- system/database/DB_utility.php | 6 +- system/database/drivers/mssql/mssql_driver.php | 2 +- system/database/drivers/mssql/mssql_forge.php | 4 +- system/database/drivers/mssql/mssql_result.php | 4 +- system/database/drivers/mssql/mssql_utility.php | 2 +- system/database/drivers/mysql/mysql_driver.php | 14 +- system/database/drivers/mysql/mysql_forge.php | 4 +- system/database/drivers/mysql/mysql_result.php | 4 +- system/database/drivers/mysql/mysql_utility.php | 4 +- system/database/drivers/mysqli/mysqli_driver.php | 8 +- system/database/drivers/mysqli/mysqli_forge.php | 4 +- system/database/drivers/mysqli/mysqli_result.php | 4 +- system/database/drivers/mysqli/mysqli_utility.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 138 ++++++------- system/database/drivers/oci8/oci8_forge.php | 4 +- system/database/drivers/oci8/oci8_result.php | 34 ++-- system/database/drivers/oci8/oci8_utility.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- system/database/drivers/odbc/odbc_forge.php | 4 +- system/database/drivers/odbc/odbc_result.php | 4 +- system/database/drivers/odbc/odbc_utility.php | 2 +- system/database/drivers/postgre/postgre_driver.php | 2 +- system/database/drivers/postgre/postgre_forge.php | 10 +- system/database/drivers/postgre/postgre_result.php | 4 +- .../database/drivers/postgre/postgre_utility.php | 2 +- system/database/drivers/sqlite/sqlite_driver.php | 2 +- system/database/drivers/sqlite/sqlite_forge.php | 6 +- system/database/drivers/sqlite/sqlite_result.php | 4 +- system/database/drivers/sqlite/sqlite_utility.php | 4 +- system/helpers/array_helper.php | 8 +- system/helpers/captcha_helper.php | 20 +- system/helpers/cookie_helper.php | 6 +- system/helpers/date_helper.php | 22 +-- system/helpers/directory_helper.php | 4 +- system/helpers/download_helper.php | 2 +- system/helpers/email_helper.php | 2 +- system/helpers/file_helper.php | 4 +- system/helpers/form_helper.php | 18 +- system/helpers/html_helper.php | 10 +- system/helpers/inflector_helper.php | 14 +- system/helpers/language_helper.php | 2 +- system/helpers/number_helper.php | 2 +- system/helpers/path_helper.php | 4 +- system/helpers/security_helper.php | 4 +- system/helpers/smiley_helper.php | 12 +- system/helpers/string_helper.php | 8 +- system/helpers/text_helper.php | 10 +- system/helpers/typography_helper.php | 2 +- system/helpers/url_helper.php | 6 +- system/helpers/xml_helper.php | 4 +- system/language/english/email_lang.php | 6 +- system/language/english/imglib_lang.php | 10 +- system/libraries/Cache/Cache.php | 30 +-- system/libraries/Cache/drivers/Cache_apc.php | 24 +-- system/libraries/Cache/drivers/Cache_file.php | 40 ++-- system/libraries/Calendar.php | 18 +- system/libraries/Cart.php | 22 +-- system/libraries/Driver.php | 2 +- system/libraries/Email.php | 46 ++--- system/libraries/Encrypt.php | 2 +- system/libraries/Form_validation.php | 32 +-- system/libraries/Ftp.php | 8 +- system/libraries/Image_lib.php | 118 +++++------ system/libraries/Javascript.php | 12 +- system/libraries/Log.php | 8 +- system/libraries/Pagination.php | 18 +- system/libraries/Parser.php | 18 +- system/libraries/Profiler.php | 26 +-- system/libraries/Session.php | 30 +-- system/libraries/Sha1.php | 8 +- system/libraries/Table.php | 12 +- system/libraries/Trackback.php | 16 +- system/libraries/Typography.php | 36 ++-- system/libraries/Unit_test.php | 2 +- system/libraries/Upload.php | 28 +-- system/libraries/User_agent.php | 2 +- system/libraries/Xmlrpc.php | 90 ++++----- system/libraries/Xmlrpcs.php | 44 ++--- system/libraries/Zip.php | 12 +- system/libraries/javascript/Jquery.php | 218 ++++++++++----------- user_guide/changelog.html | 118 +++++------ user_guide/database/active_record.html | 68 +++---- user_guide/database/caching.html | 34 ++-- user_guide/database/call_function.html | 8 +- user_guide/database/configuration.html | 18 +- user_guide/database/connecting.html | 6 +- user_guide/database/examples.html | 12 +- user_guide/database/fields.html | 4 +- user_guide/database/forge.html | 10 +- user_guide/database/helpers.html | 12 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 14 +- user_guide/database/results.html | 20 +- user_guide/database/table_data.html | 6 +- user_guide/database/transactions.html | 14 +- user_guide/database/utilities.html | 18 +- user_guide/doc_style/template.html | 2 +- user_guide/general/alternative_php.html | 16 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 8 +- user_guide/general/common_functions.html | 6 +- user_guide/general/controllers.html | 32 +-- user_guide/general/core_classes.html | 4 +- user_guide/general/creating_libraries.html | 26 +-- user_guide/general/credits.html | 2 +- user_guide/general/drivers.html | 6 +- user_guide/general/environments.html | 40 ++-- user_guide/general/errors.html | 18 +- user_guide/general/helpers.html | 26 +-- user_guide/general/hooks.html | 16 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 8 +- user_guide/general/models.html | 18 +- user_guide/general/profiling.html | 2 +- user_guide/general/reserved_names.html | 4 +- user_guide/general/routing.html | 12 +- user_guide/general/security.html | 26 +-- user_guide/general/styleguide.html | 64 +++--- user_guide/general/urls.html | 8 +- user_guide/general/views.html | 28 +-- user_guide/helpers/array_helper.html | 12 +- user_guide/helpers/captcha_helper.html | 8 +- user_guide/helpers/cookie_helper.html | 8 +- user_guide/helpers/date_helper.html | 32 +-- user_guide/helpers/directory_helper.html | 4 +- user_guide/helpers/file_helper.html | 16 +- user_guide/helpers/form_helper.html | 54 ++--- user_guide/helpers/html_helper.html | 24 +-- user_guide/helpers/inflector_helper.html | 10 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/security_helper.html | 14 +- user_guide/helpers/smiley_helper.html | 8 +- user_guide/helpers/string_helper.html | 6 +- user_guide/helpers/text_helper.html | 30 +-- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 48 ++--- user_guide/helpers/xml_helper.html | 2 +- user_guide/installation/index.html | 16 +- user_guide/installation/troubleshooting.html | 4 +- user_guide/installation/upgrade_130.html | 8 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 8 +- user_guide/installation/upgrade_140.html | 6 +- user_guide/installation/upgrade_141.html | 10 +- user_guide/installation/upgrade_150.html | 8 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_160.html | 6 +- user_guide/installation/upgrade_170.html | 8 +- user_guide/installation/upgrade_200.html | 10 +- user_guide/installation/upgrade_202.html | 2 +- user_guide/installation/upgrade_203.html | 12 +- user_guide/installation/upgrade_b11.html | 6 +- user_guide/libraries/benchmark.html | 8 +- user_guide/libraries/caching.html | 16 +- user_guide/libraries/calendar.html | 12 +- user_guide/libraries/cart.html | 46 ++--- user_guide/libraries/config.html | 40 ++-- user_guide/libraries/email.html | 24 +-- user_guide/libraries/encryption.html | 34 ++-- user_guide/libraries/file_uploading.html | 58 +++--- user_guide/libraries/form_validation.html | 94 ++++----- user_guide/libraries/ftp.html | 36 ++-- user_guide/libraries/image_lib.html | 64 +++--- user_guide/libraries/input.html | 32 +-- user_guide/libraries/javascript.html | 26 +-- user_guide/libraries/language.html | 22 +-- user_guide/libraries/loader.html | 40 ++-- user_guide/libraries/output.html | 20 +- user_guide/libraries/pagination.html | 20 +- user_guide/libraries/parser.html | 16 +- user_guide/libraries/security.html | 8 +- user_guide/libraries/sessions.html | 42 ++-- user_guide/libraries/table.html | 28 +-- user_guide/libraries/trackback.html | 26 +-- user_guide/libraries/typography.html | 4 +- user_guide/libraries/unit_testing.html | 16 +- user_guide/libraries/uri.html | 14 +- user_guide/libraries/user_agent.html | 10 +- user_guide/libraries/xmlrpc.html | 46 ++--- user_guide/libraries/zip.html | 32 +-- user_guide/license.html | 2 +- user_guide/nav/hacks.txt | 2 +- user_guide/nav/moo.fx.js | 4 +- user_guide/nav/prototype.lite.js | 92 ++++----- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 12 +- user_guide/overview/features.html | 6 +- user_guide/overview/getting_started.html | 2 +- user_guide/overview/goals.html | 6 +- user_guide/overview/mvc.html | 6 +- user_guide/userguide.css | 2 +- 230 files changed, 2110 insertions(+), 2110 deletions(-) diff --git a/application/config/autoload.php b/application/config/autoload.php index 1c492a20d..53129c9c6 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -1,4 +1,4 @@ - 'application/mac-binhex40', 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', - 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), + 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mpga' => 'audio/mpeg', @@ -71,7 +71,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'jpeg' => array('image/jpeg', 'image/pjpeg'), 'jpg' => array('image/jpeg', 'image/pjpeg'), 'jpe' => array('image/jpeg', 'image/pjpeg'), - 'png' => array('image/png', 'image/x-png'), + 'png' => array('image/png', 'image/x-png'), 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'css' => 'text/css', diff --git a/application/config/profiler.php b/application/config/profiler.php index b0f43b1d8..f8a5b1a1e 100644 --- a/application/config/profiler.php +++ b/application/config/profiler.php @@ -1,4 +1,4 @@ -A PHP Error was encountered

Severity:

-

Message:

+

Message:

Filename:

Line Number:

diff --git a/index.php b/index.php index e56de13ed..f4ac11a72 100644 --- a/index.php +++ b/index.php @@ -11,9 +11,9 @@ * * This can be set to anything, but default usage is: * - * development - * testing - * production + * development + * testing + * production * * NOTE: If you change these, also change the error_reporting() code below * @@ -35,7 +35,7 @@ if (defined('ENVIRONMENT')) case 'development': error_reporting(E_ALL); break; - + case 'testing': case 'production': error_reporting(0); @@ -52,7 +52,7 @@ if (defined('ENVIRONMENT')) *--------------------------------------------------------------- * * This variable must contain the name of your "system" folder. - * Include the path if the folder is not in the same directory + * Include the path if the folder is not in the same directory * as this file. * */ @@ -65,7 +65,7 @@ if (defined('ENVIRONMENT')) * * If you want this front controller to use a different "application" * folder then the default one you can set its name here. The folder - * can also be renamed or relocated anywhere on your server. If + * can also be renamed or relocated anywhere on your server. If * you do, use a full server path. For more info please see the user guide: * http://codeigniter.com/user_guide/general/managing_apps.html * @@ -81,24 +81,24 @@ if (defined('ENVIRONMENT')) * * Normally you will set your default controller in the routes.php file. * You can, however, force a custom routing by hard-coding a - * specific controller class/function here. For most applications, you + * specific controller class/function here. For most applications, you * WILL NOT set your routing here, but it's an option for those * special instances where you might want to override the standard * routing in a specific front controller that shares a common CI installation. * - * IMPORTANT: If you set the routing here, NO OTHER controller will be + * IMPORTANT: If you set the routing here, NO OTHER controller will be * callable. In essence, this preference limits your application to ONE - * specific controller. Leave the function name blank if you need + * specific controller. Leave the function name blank if you need * to call functions dynamically via the URI. * * Un-comment the $routing array below to use this feature * */ - // The directory name, relative to the "controllers" folder. Leave blank + // The directory name, relative to the "controllers" folder. Leave blank // if your controller is not in a sub-folder within the "controllers" folder // $routing['directory'] = ''; - // The controller class file name. Example: Mycontroller + // The controller class file name. Example: Mycontroller // $routing['controller'] = ''; // The controller function you wish to be called. @@ -107,7 +107,7 @@ if (defined('ENVIRONMENT')) /* * ------------------------------------------------------------------- - * CUSTOM CONFIG VALUES + * CUSTOM CONFIG VALUES * ------------------------------------------------------------------- * * The $assign_to_config array below will be passed dynamically to the @@ -125,12 +125,12 @@ if (defined('ENVIRONMENT')) // -------------------------------------------------------------------- -// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE +// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE // -------------------------------------------------------------------- /* * --------------------------------------------------------------- - * Resolve the system path for increased reliability + * Resolve the system path for increased reliability * --------------------------------------------------------------- */ @@ -156,7 +156,7 @@ if (defined('ENVIRONMENT')) /* * ------------------------------------------------------------------- - * Now that we know the path, set the main path constants + * Now that we know the path, set the main path constants * ------------------------------------------------------------------- */ // The name of THIS file diff --git a/license.txt b/license.txt index 4809e8ca4..061cdb9db 100644 --- a/license.txt +++ b/license.txt @@ -2,7 +2,7 @@ Copyright (c) 2008 - 2011, EllisLab, Inc. All rights reserved. This license is a legal agreement between you and EllisLab Inc. for the use -of CodeIgniter Software (the "Software"). By obtaining the Software you +of CodeIgniter Software (the "Software"). By obtaining the Software you agree to comply with the terms and conditions of this license. PERMITTED USE @@ -48,4 +48,4 @@ FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF -DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. \ No newline at end of file +DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php index 3686c2d73..515550e9f 100644 --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -1,4 +1,4 @@ -_call_hook('pre_system'); /* * ------------------------------------------------------ - * Instantiate the config class + * Instantiate the config class * ------------------------------------------------------ */ $CFG =& load_class('Config', 'core'); @@ -143,7 +143,7 @@ /* * ------------------------------------------------------ - * Instantiate the UTF-8 class + * Instantiate the UTF-8 class * ------------------------------------------------------ * * Note: Order here is rather important as the UTF-8 @@ -157,14 +157,14 @@ /* * ------------------------------------------------------ - * Instantiate the URI class + * Instantiate the URI class * ------------------------------------------------------ */ $URI =& load_class('URI', 'core'); /* * ------------------------------------------------------ - * Instantiate the routing class and set the routing + * Instantiate the routing class and set the routing * ------------------------------------------------------ */ $RTR =& load_class('Router', 'core'); @@ -178,14 +178,14 @@ /* * ------------------------------------------------------ - * Instantiate the output class + * Instantiate the output class * ------------------------------------------------------ */ $OUT =& load_class('Output', 'core'); /* * ------------------------------------------------------ - * Is there a valid cache file? If so, we're done... + * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE) @@ -205,21 +205,21 @@ /* * ------------------------------------------------------ - * Load the Input class and sanitize globals + * Load the Input class and sanitize globals * ------------------------------------------------------ */ $IN =& load_class('Input', 'core'); /* * ------------------------------------------------------ - * Load the Language class + * Load the Language class * ------------------------------------------------------ */ $LANG =& load_class('Lang', 'core'); /* * ------------------------------------------------------ - * Load the app controller and local controller + * Load the app controller and local controller * ------------------------------------------------------ * */ @@ -252,14 +252,14 @@ /* * ------------------------------------------------------ - * Security check + * Security check * ------------------------------------------------------ * - * None of the functions in the app controller or the - * loader class can be called via the URI, nor can - * controller functions that begin with an underscore + * None of the functions in the app controller or the + * loader class can be called via the URI, nor can + * controller functions that begin with an underscore */ - $class = $RTR->fetch_class(); + $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); if ( ! class_exists($class) @@ -272,14 +272,14 @@ /* * ------------------------------------------------------ - * Is there a "pre_controller" hook? + * Is there a "pre_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ - * Instantiate the requested controller + * Instantiate the requested controller * ------------------------------------------------------ */ // Mark a start point so we can benchmark the controller @@ -289,14 +289,14 @@ /* * ------------------------------------------------------ - * Is there a "post_controller_constructor" hook? + * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); /* * ------------------------------------------------------ - * Call the requested method + * Call the requested method * ------------------------------------------------------ */ // Is there a "remap" function? If so, we call it instead @@ -345,14 +345,14 @@ /* * ------------------------------------------------------ - * Is there a "post_controller" hook? + * Is there a "post_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ - * Send the final rendered output to the browser + * Send the final rendered output to the browser * ------------------------------------------------------ */ if ($EXT->_call_hook('display_override') === FALSE) @@ -362,14 +362,14 @@ /* * ------------------------------------------------------ - * Is there a "post_system" hook? + * Is there a "post_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_system'); /* * ------------------------------------------------------ - * Close the DB connection if one exists + * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB') AND isset($CI->db)) diff --git a/system/core/Common.php b/system/core/Common.php index eb9e14425..d1e8e77e9 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -1,4 +1,4 @@ -show_php_error($severity, $message, $filepath, $line); } - // Should we log the error? No? We're done... + // Should we log the error? No? We're done... if (config_item('log_threshold') == 0) { return; @@ -479,16 +479,16 @@ function remove_invisible_characters($str, $url_encoded = TRUE) { $non_displayables = array(); - + // every control character except newline (dec 10) // carriage return (dec 13), and horizontal tab (dec 09) - + if ($url_encoded) { $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15 $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31 } - + $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 do diff --git a/system/core/Config.php b/system/core/Config.php index fa71f4d3d..1096a9ea6 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -1,4 +1,4 @@ -load =& load_class('Loader', 'core'); $this->load->set_base_classes()->ci_autoloader(); - + log_message('debug', "Controller Class Initialized"); } diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index 2503c907f..bff86a92f 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -1,4 +1,4 @@ -ob_level = ob_get_level(); - // Note: Do not log messages from this constructor. + // Note: Do not log messages from this constructor. } // -------------------------------------------------------------------- @@ -75,7 +75,7 @@ class CI_Exceptions { { $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; - log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); + log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); } // -------------------------------------------------------------------- diff --git a/system/core/Hooks.php b/system/core/Hooks.php index ffb3258d8..fd6380f0a 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -1,4 +1,4 @@ -_fetch_from_array($_POST, $index, $xss_clean); } @@ -201,7 +201,7 @@ class CI_Input { * @param mixed * @param string the value of the cookie * @param string the number of seconds until expiration - * @param string the cookie domain. Usually: .yourdomain.com + * @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 @@ -402,9 +402,9 @@ class CI_Input { function _sanitize_globals() { // It would be "wrong" to unset any of these GLOBALS. - $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', + $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', - 'system_folder', 'application_folder', 'BM', 'EXT', + 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN'); // Unset globals for securiy. @@ -523,7 +523,7 @@ class CI_Input { { $str = $this->uni->clean_string($str); } - + // Remove control characters $str = remove_invisible_characters($str); @@ -579,7 +579,7 @@ class CI_Input { /** * Request Headers * - * In Apache, you can simply call apache_request_headers(), however for + * In Apache, you can simply call apache_request_headers(), however for * people running other webservers the function is undefined. * * @return array @@ -609,10 +609,10 @@ class CI_Input { { $key = str_replace('_', ' ', strtolower($key)); $key = str_replace(' ', '-', ucwords($key)); - + $this->headers[$key] = $val; } - + return $this->headers; } @@ -633,7 +633,7 @@ class CI_Input { { $this->request_headers(); } - + if ( ! isset($this->headers[$index])) { return FALSE; @@ -644,7 +644,7 @@ class CI_Input { return $this->security->xss_clean($this->headers[$index]); } - return $this->headers[$index]; + return $this->headers[$index]; } // -------------------------------------------------------------------- diff --git a/system/core/Lang.php b/system/core/Lang.php index 79eb443a0..170e6c725 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -1,4 +1,4 @@ - 'unit', + protected $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); /** @@ -50,29 +50,29 @@ class CI_Loader { */ public function __construct() { - $this->_ci_ob_level = ob_get_level(); + $this->_ci_ob_level = ob_get_level(); $this->_ci_library_paths = array(APPPATH, BASEPATH); $this->_ci_helper_paths = array(APPPATH, BASEPATH); $this->_ci_model_paths = array(APPPATH); $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); - + log_message('debug', "Loader Class Initialized"); } // -------------------------------------------------------------------- - + /** * Set _base_classes variable * * This method is called once in CI_Controller. * - * @param array + * @param array * @return object */ public function set_base_classes() { $this->_base_classes =& is_loaded(); - + return $this; } @@ -96,7 +96,7 @@ class CI_Loader { { return $this->_ci_classes[$class]; } - + return FALSE; } @@ -260,7 +260,7 @@ class CI_Loader { return DB($params, $active_record); } - // Initialize the db variable. Needed to prevent + // Initialize the db variable. Needed to prevent // reference errors with some configurations $CI->db = ''; @@ -323,11 +323,11 @@ class CI_Loader { /** * Load View * - * This function is used to load a "view" file. It has three parameters: + * This function is used to load a "view" file. It has three parameters: * * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. - * 3. TRUE/FALSE - whether to return the data or load it. In + * 3. TRUE/FALSE - whether to return the data or load it. In * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * @@ -538,13 +538,13 @@ class CI_Loader { * Prepends a parent path to the library, model, helper, and config path arrays * * @param string - * @param boolean + * @param boolean * @return void */ public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; - + array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); @@ -604,7 +604,7 @@ class CI_Loader { unset($this->{$var}[$key]); } } - + if (isset($this->_ci_view_paths[$path.'views/'])) { unset($this->_ci_view_paths[$path.'views/']); @@ -643,7 +643,7 @@ class CI_Loader { { $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; } - + $file_exists = FALSE; // Set the path to the requested file @@ -665,11 +665,11 @@ class CI_Loader { $file_exists = TRUE; break; } - + if ( ! $cascade) { break; - } + } } } @@ -710,9 +710,9 @@ class CI_Loader { * We buffer the output for two reasons: * 1. Speed. You get a significant speed boost. * 2. So that the final rendered template can be - * post-processed by the output class. Why do we - * need post processing? For one thing, in order to - * show the elapsed page load time. Unless we + * post-processed by the output class. Why do we + * need post processing? For one thing, in order to + * show the elapsed page load time. Unless we * can intercept the content right before it's sent to * the browser and then stop the timer it won't be accurate. */ @@ -809,11 +809,11 @@ class CI_Loader { show_error("Unable to load the requested class: ".$class); } - // Safety: Was the class already loaded by a previous call? + // Safety: Was the class already loaded by a previous call? if (in_array($subclass, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see - // if a custom object name is being supplied. If so, we'll + // if a custom object name is being supplied. If so, we'll // return a new instance of the object if ( ! is_null($object_name)) { @@ -842,17 +842,17 @@ class CI_Loader { { $filepath = $path.'libraries/'.$subdir.$class.'.php'; - // Does the file exist? No? Bummer... + // Does the file exist? No? Bummer... if ( ! file_exists($filepath)) { continue; } - // Safety: Was the class already loaded by a previous call? + // Safety: Was the class already loaded by a previous call? if (in_array($filepath, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see - // if a custom object name is being supplied. If so, we'll + // if a custom object name is being supplied. If so, we'll // return a new instance of the object if ( ! is_null($object_name)) { @@ -875,7 +875,7 @@ class CI_Loader { } // END FOREACH - // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? + // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? if ($subdir == '') { $path = strtolower($class).'/'.$class; @@ -903,7 +903,7 @@ class CI_Loader { */ protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { - // Is there an associated config file for this class? Note: these should always be lowercase + // Is there an associated config file for this class? Note: these should always be lowercase if ($config === NULL) { // Fetch the config paths containing any package paths @@ -970,7 +970,7 @@ class CI_Loader { } // Set the variable name we will assign the class to - // Was a custom class name supplied? If so we'll use it + // Was a custom class name supplied? If so we'll use it $class = strtolower($class); if (is_null($object_name)) @@ -1005,7 +1005,7 @@ class CI_Loader { * The config/autoload.php file contains an array that permits sub-systems, * libraries, and helpers to be loaded automatically. * - * This function is public, as it's used in the CI_Controller class. + * This function is public, as it's used in the CI_Controller class. * However, there is no reason you should ever needs to use it. * * @param array @@ -1021,7 +1021,7 @@ class CI_Loader { { include_once(APPPATH.'config/autoload.php'); } - + if ( ! isset($autoload)) { diff --git a/system/core/Model.php b/system/core/Model.php index 61c71b672..8566a0b66 100644 --- a/system/core/Model.php +++ b/system/core/Model.php @@ -1,4 +1,4 @@ -final_output * * This function sends the finalized output data to the browser along - * with any server headers and profile data. It also stops the + * with any server headers and profile data. It also stops the * benchmark timer so the page rendering speed and memory usage can be shown. * * @access public @@ -269,7 +269,7 @@ class CI_Output { */ function _display($output = '') { - // Note: We use globals because we can't use $CI =& get_instance() + // Note: We use globals because we can't use $CI =& get_instance() // since this function is sometimes called by the caching mechanism, // which happens before the CI super object is available. global $BM, $CFG; @@ -290,7 +290,7 @@ class CI_Output { // -------------------------------------------------------------------- - // Do we need to write a cache file? Only if the controller does not have its + // Do we need to write a cache file? Only if the controller does not have its // own _output() method and we are not dealing with a cache file, which we // can determine by the existence of the $CI object above if ($this->cache_expiration > 0 && isset($CI) && ! method_exists($CI, '_output')) @@ -368,7 +368,7 @@ class CI_Output { // we will remove them and add them back after we insert the profile data if (preg_match("|.*?|is", $output)) { - $output = preg_replace("|.*?|is", '', $output); + $output = preg_replace("|.*?|is", '', $output); $output .= $CI->profiler->run(); $output .= ''; } @@ -381,14 +381,14 @@ class CI_Output { // -------------------------------------------------------------------- // Does the controller contain a function named _output()? - // If so send the output there. Otherwise, echo it. + // If so send the output there. Otherwise, echo it. if (method_exists($CI, '_output')) { $CI->_output($output); } else { - echo $output; // Send it to the browser! + echo $output; // Send it to the browser! } log_message('debug', "Final output sent to browser"); @@ -458,7 +458,7 @@ class CI_Output { { $cache_path = ($CFG->item('cache_path') == '') ? APPPATH.'cache/' : $CFG->item('cache_path'); - // Build the file path. The file name is an MD5 hash of the full URI + // Build the file path. The file name is an MD5 hash of the full URI $uri = $CFG->item('base_url'). $CFG->item('index_page'). $URI->uri_string; diff --git a/system/core/Router.php b/system/core/Router.php index a76a7bd0a..5e92a04b1 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -1,4 +1,4 @@ -routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; unset($route); @@ -103,7 +103,7 @@ class CI_Router { // the URI doesn't correlated to a valid controller. $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); - // Were there any query string segments? If so, we'll validate them and bail out since we're done. + // Were there any query string segments? If so, we'll validate them and bail out since we're done. if (count($segments) > 0) { return $this->_validate_request($segments); @@ -212,7 +212,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Validates the supplied segments. Attempts to determine the path to + * Validates the supplied segments. Attempts to determine the path to * the controller. * * @access private @@ -277,7 +277,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 + // controller class. We will now see if there is an override if ( ! empty($this->routes['404_override'])) { $x = explode('/', $this->routes['404_override']); @@ -296,7 +296,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Parse Routes + * Parse Routes * * This function matches any routes that may exist in * the config/routes.php file against the URI to @@ -310,7 +310,7 @@ class CI_Router { // Turn the segment array into a URI string $uri = implode('/', $this->uri->segments); - // Is there a literal match? If so we're done + // Is there a literal match? If so we're done if (isset($this->routes[$uri])) { return $this->_set_request(explode('/', $this->routes[$uri])); @@ -370,7 +370,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Set the method name + * Set the method name * * @access public * @param string @@ -384,7 +384,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Fetch the current method + * Fetch the current method * * @access public * @return string @@ -402,7 +402,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Set the directory name + * Set the directory name * * @access public * @param string @@ -416,7 +416,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Fetch the sub-directory (if any) that contains the requested controller class + * Fetch the sub-directory (if any) that contains the requested controller class * * @access public * @return string @@ -429,7 +429,7 @@ class CI_Router { // -------------------------------------------------------------------- /** - * Set the controller overrides + * Set the controller overrides * * @access public * @param array diff --git a/system/core/Security.php b/system/core/Security.php index f5bfafd9b..3617cadcc 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -1,4 +1,4 @@ - '[removed]', // IE, surprise! "Redirect\s+302" => '[removed]' ); - + /** * Constructor */ @@ -95,7 +95,7 @@ class CI_Security { } // Do the tokens exist in both the _POST and _COOKIE arrays? - if ( ! isset($_POST[$this->_csrf_token_name]) OR + if ( ! isset($_POST[$this->_csrf_token_name]) OR ! isset($_COOKIE[$this->_csrf_cookie_name])) { $this->csrf_show_error(); @@ -107,7 +107,7 @@ class CI_Security { $this->csrf_show_error(); } - // We kill this since we're done and we don't want to + // We kill this since we're done and we don't want to // polute the _POST array unset($_POST[$this->_csrf_token_name]); @@ -117,7 +117,7 @@ class CI_Security { $this->csrf_set_cookie(); log_message('debug', "CSRF token verified "); - + return $this; } @@ -146,7 +146,7 @@ class CI_Security { setcookie($this->_csrf_cookie_name, $this->_csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), $secure_cookie); log_message('debug', "CRSF cookie Set"); - + return $this; } @@ -165,9 +165,9 @@ class CI_Security { // -------------------------------------------------------------------- /** - * Get CSRF Hash + * Get CSRF Hash * - * Getter Method + * Getter Method * * @return string self::_csrf_hash */ @@ -196,14 +196,14 @@ class CI_Security { * XSS Clean * * Sanitizes data so that Cross Site Scripting Hacks can be - * prevented. This function does a fair amount of work but + * prevented. This function does a fair amount of work but * it is extremely thorough, designed to prevent even the - * most obscure XSS attempts. Nothing is ever 100% foolproof, + * most obscure XSS attempts. Nothing is ever 100% foolproof, * of course, but I haven't been able to get anything passed * the filter. * * Note: This function should only be used to deal with data - * upon submission. It's not something that should + * upon submission. It's not something that should * be used for general runtime processing. * * This function was based in part on some code and ideas I @@ -263,7 +263,7 @@ class CI_Security { */ $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); - + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str); /* @@ -276,7 +276,7 @@ class CI_Security { * * This prevents strings like this: ja vascript * NOTE: we deal with spaces between characters later. - * NOTE: preg_replace was found to be amazingly slow here on + * NOTE: preg_replace was found to be amazingly slow here on * large blocks of data, so we use str_replace. */ @@ -304,27 +304,27 @@ class CI_Security { */ if ($is_image === TRUE) { - // Images have a tendency to have the PHP short opening and - // closing tags every so often so we skip those and only + // Images have a tendency to have the PHP short opening and + // closing tags every so often so we skip those and only // do the long opening tags. $str = preg_replace('/<\?(php)/i', "<?\\1", $str); } else { - $str = str_replace(array(''), array('<?', '?>'), $str); + $str = str_replace(array(''), array('<?', '?>'), $str); } /* * Compact any exploded words * - * This corrects words like: j a v a s c r i p t + * This corrects words like: j a v a s c r i p t * These words are compacted back to their correct state. */ $words = array( - 'javascript', 'expression', 'vbscript', 'script', + 'javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window' ); - + foreach ($words as $word) { $temp = ''; @@ -341,8 +341,8 @@ class CI_Security { /* * Remove disallowed Javascript in links or img tags - * We used to do some version comparisons and use of stripos for PHP5, - * but it is dog slow compared to these simplified non-capturing + * We used to do some version comparisons and use of stripos for PHP5, + * but it is dog slow compared to these simplified non-capturing * preg_match(), especially if the pattern exists in the string */ do @@ -388,7 +388,7 @@ class CI_Security { * * Similar to above, only instead of looking for * tags it looks for PHP and JavaScript commands - * that are disallowed. Rather than removing the + * that are disallowed. Rather than removing the * code, it simply converts the parenthesis to entities * rendering the code un-executable. * @@ -405,11 +405,11 @@ class CI_Security { /* * Images are Handled in a Special Way - * - Essentially, we want to know that after all of the character - * conversion is done whether any unwanted, likely XSS, code was found. + * - Essentially, we want to know that after all of the character + * conversion is done whether any unwanted, likely XSS, code was found. * If not, we return TRUE, as the image is clean. - * However, if the string post-conversion does not matched the - * string post-removal of XSS, then it fails, as there was unwanted XSS + * However, if the string post-conversion does not matched the + * string post-removal of XSS, then it fails, as there was unwanted XSS * code found and removed/changed during processing. */ @@ -457,7 +457,7 @@ class CI_Security { * * In some versions of PHP the native function does not work * when UTF-8 is the specified character set, so this gives us - * a work-around. More info here: + * a work-around. More info here: * http://bugs.php.net/bug.php?id=25670 * * NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the @@ -475,10 +475,10 @@ class CI_Security { // The reason we are not using html_entity_decode() by itself is because // while it is not technically correct to leave out the semicolon // at the end of an entity most browsers will still interpret the entity - // correctly. html_entity_decode() does not convert entities without + // correctly. html_entity_decode() does not convert entities without // semicolons, so we are left with our own little solution here. Bummer. - if (function_exists('html_entity_decode') && + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8')) { $str = html_entity_decode($str, ENT_COMPAT, $charset); @@ -542,7 +542,7 @@ class CI_Security { "%3b", // ; "%3d" // = ); - + if ( ! $relative_path) { $bad[] = './'; @@ -570,7 +570,7 @@ class CI_Security { } // -------------------------------------------------------------------- - + /* * Remove Evil HTML Attributes (like evenhandlers and style) * @@ -578,7 +578,7 @@ class CI_Security { * - Everything up until a space * For example, everything between the pipes: * - * - Everything inside the quotes + * - Everything inside the quotes * For example, everything between the pipes: * * @@ -594,12 +594,12 @@ class CI_Security { if ($is_image === TRUE) { /* - * Adobe Photoshop puts XML metadata into JFIF images, + * Adobe Photoshop puts XML metadata into JFIF images, * including namespacing, so we have to allow this for images. */ unset($evil_attributes[array_search('xmlns', $evil_attributes)]); } - + do { $str = preg_replace( "#<(/?[^><]+?)([^A-Za-z\-])(".implode('|', $evil_attributes).")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i", @@ -607,10 +607,10 @@ class CI_Security { $str, -1, $count ); } while ($count); - + return $str; } - + // -------------------------------------------------------------------- /** @@ -627,7 +627,7 @@ class CI_Security { $str = '<'.$matches[1].$matches[2].$matches[3]; // encode captured opening or closing brace to prevent recursive vectors - $str .= str_replace(array('>', '<'), array('>', '<'), + $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); return $str; @@ -649,7 +649,7 @@ class CI_Security { protected function _js_link_removal($match) { $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - + return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - + return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|xss_hash()."\\1=\\2", $str); /* * Validate standard character entities * - * Add a semicolon if missing. We do this to enable + * Add a semicolon if missing. We do this to enable * the conversion of entities to ASCII later. * */ @@ -769,7 +769,7 @@ class CI_Security { * Un-Protect GET variables in URLs */ $str = str_replace($this->xss_hash(), '&', $str); - + return $str; } @@ -794,7 +794,7 @@ class CI_Security { { $str = preg_replace("#".$key."#i", $val, $str); } - + return $str; } @@ -809,16 +809,16 @@ class CI_Security { { if ($this->_csrf_hash == '') { - // If the cookie exists we will use it's value. + // If the cookie exists we will use it's value. // We don't necessarily want to regenerate it with - // each page load since a page could contain embedded + // each page load since a page could contain embedded // sub-pages causing this feature to fail - if (isset($_COOKIE[$this->_csrf_cookie_name]) && + if (isset($_COOKIE[$this->_csrf_cookie_name]) && $_COOKIE[$this->_csrf_cookie_name] != '') { return $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name]; } - + return $this->_csrf_hash = md5(uniqid(rand(), TRUE)); } diff --git a/system/core/URI.php b/system/core/URI.php index 94fac59ac..d56548654 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -1,4 +1,4 @@ -_set_uri_string($path); @@ -251,7 +251,7 @@ class CI_URI { */ function _remove_url_suffix() { - if ($this->config->item('url_suffix') != "") + if ($this->config->item('url_suffix') != "") { $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); } @@ -285,7 +285,7 @@ class CI_URI { * Re-index Segments * * This function re-indexes the $this->segment array so that it - * starts at 1 rather than 0. Doing so makes it simpler to + * starts at 1 rather than 0. Doing so makes it simpler to * use functions like $this->uri->segment(n) since there is * a 1:1 relationship between the segment array and the actual segments. * @@ -323,7 +323,7 @@ class CI_URI { * Fetch a URI "routed" Segment * * This function returns the re-routed URI segment (assuming routing rules are used) - * based on the number provided. If there is no routing this function returns the + * based on the number provided. If there is no routing this function returns the * same result as $this->segment() * * @access public @@ -425,7 +425,7 @@ class CI_URI { $i = 0; $lastval = ''; - $retval = array(); + $retval = array(); foreach ($segments as $seg) { if ($i % 2) diff --git a/system/core/Utf8.php b/system/core/Utf8.php index 738d7e9d8..2a27d1f35 100644 --- a/system/core/Utf8.php +++ b/system/core/Utf8.php @@ -1,4 +1,4 @@ -_track_aliases($val); @@ -332,7 +332,7 @@ class CI_DB_active_record extends CI_DB_driver { } } - // Extract any aliases that might exist. We use this information + // Extract any aliases that might exist. We use this information // in the _protect_identifiers to know whether to add a table prefix $this->_track_aliases($table); @@ -438,7 +438,7 @@ class CI_DB_active_record extends CI_DB_driver { $v = ' '.$this->escape($v); } - + if ( ! $this->_has_operator($k)) { $k .= ' = '; @@ -926,7 +926,7 @@ class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- /** - * The "set" function. Allows key/value pairs to be set for inserting or updating + * The "set" function. Allows key/value pairs to be set for inserting or updating * * @access public * @param mixed @@ -1084,7 +1084,7 @@ class CI_DB_active_record extends CI_DB_driver { { if ($this->db_debug) { - //No valid data array. Folds in cases where keys and values did not match up + //No valid data array. Folds in cases where keys and values did not match up return $this->display_error('db_must_use_set'); } return FALSE; @@ -1124,7 +1124,7 @@ class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- /** - * The "set_insert_batch" function. Allows key/value pairs to be set for batch inserts + * The "set_insert_batch" function. Allows key/value pairs to be set for batch inserts * * @access public * @param mixed @@ -1158,7 +1158,7 @@ class CI_DB_active_record extends CI_DB_driver { if ($escape === FALSE) { - $this->ar_set[] = '('.implode(',', $row).')'; + $this->ar_set[] = '('.implode(',', $row).')'; } else { @@ -1169,7 +1169,7 @@ class CI_DB_active_record extends CI_DB_driver { $clean[] = $this->escape($value); } - $this->ar_set[] = '('.implode(',', $clean).')'; + $this->ar_set[] = '('.implode(',', $clean).')'; } } @@ -1399,7 +1399,7 @@ class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- /** - * The "set_update_batch" function. Allows key/value pairs to be set for batch updating + * The "set_update_batch" function. Allows key/value pairs to be set for batch updating * * @access public * @param array @@ -1652,7 +1652,7 @@ class CI_DB_active_record extends CI_DB_driver { return; } - // Does the string contain a comma? If so, we need to separate + // Does the string contain a comma? If so, we need to separate // the string into discreet statements if (strpos($table, ',') !== FALSE) { @@ -1682,7 +1682,7 @@ class CI_DB_active_record extends CI_DB_driver { * Compile the SELECT statement * * Generates a query string based on which functions were used. - * Should not be called directly. The get() function calls it. + * Should not be called directly. The get() function calls it. * * @access private * @return string @@ -1989,7 +1989,7 @@ class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- /** - * Resets the active record values. Called by the get() function + * Resets the active record values. Called by the get() function * * @access private * @param array An array of fields to reset @@ -2009,7 +2009,7 @@ class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- /** - * Resets the active record values. Called by the get() function + * Resets the active record values. Called by the get() function * * @access private * @return void diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index 3249e9d8e..3bf065ca5 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -1,4 +1,4 @@ -CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); + $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); } if ($segment_two == '') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 40be2f903..10e8ed0c0 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1,4 +1,4 @@ -conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect(); - // No connection resource? Throw an error + // No connection resource? Throw an error if ( ! $this->conn_id) { log_message('error', 'Unable to connect to the database'); @@ -199,7 +199,7 @@ class CI_DB_driver { // -------------------------------------------------------------------- /** - * Database Version Number. Returns a string containing the + * Database Version Number. Returns a string containing the * version of the database being used * * @access public @@ -237,7 +237,7 @@ class CI_DB_driver { * Execute the query * * Accepts an SQL string as input and returns a result object upon - * successful execution of a "read" type query. Returns boolean TRUE + * successful execution of a "read" type query. Returns boolean TRUE * upon successful execution of a "write" type query. Returns boolean * FALSE upon failure, and if the $db_debug variable is set to TRUE * will raise an error. @@ -265,7 +265,7 @@ class CI_DB_driver { $sql = preg_replace("/(\W)".$this->swap_pre."(\S+?)/", "\\1".$this->dbprefix."\\2", $sql); } - // Is query caching enabled? If the query is a "read type" + // Is query caching enabled? If the query is a "read type" // we will load the caching class and return the previously // cached query if it exists if ($this->cache_on == TRUE AND stristr($sql, 'SELECT')) @@ -286,7 +286,7 @@ class CI_DB_driver { $sql = $this->compile_binds($sql, $binds); } - // Save the query for debugging + // Save the query for debugging if ($this->save_queries == TRUE) { $this->queries[] = $sql; @@ -314,7 +314,7 @@ class CI_DB_driver { $error_msg = $this->_error_message(); // We call this function in order to roll-back queries - // if transactions are enabled. If we don't call this here + // if transactions are enabled. If we don't call this here // the error message will trigger an exit, causing the // transactions to remain in limbo. $this->trans_complete(); @@ -385,7 +385,7 @@ class CI_DB_driver { // oci8 vars must be set before calling this $RES->num_rows = $RES->num_rows(); - // Is query caching enabled? If so, we'll serialize the + // Is query caching enabled? If so, we'll serialize the // result object and save it to a cache file. if ($this->cache_on == TRUE AND $this->_cache_init()) { @@ -435,7 +435,7 @@ class CI_DB_driver { /** * Simple Query - * This is a simplified version of the query() function. Internally + * This is a simplified version of the query() function. Internally * we only use it when running transaction commands since they do * not require all the features of the main query() function. * @@ -718,7 +718,7 @@ class CI_DB_driver { /** * Primary * - * Retrieves the primary key. It assumes that the row in the first + * Retrieves the primary key. It assumes that the row in the first * position is the primary key * * @access public @@ -1216,8 +1216,8 @@ class CI_DB_driver { * This function is used extensively by the Active Record class, and by * a couple functions in this class. * It takes a column or table name (optionally with an alias) and inserts - * the table prefix onto it. Some logic is necessary in order to deal with - * column names that include the path. Consider a query like this: + * the table prefix onto it. Some logic is necessary in order to deal with + * column names that include the path. Consider a query like this: * * SELECT * FROM hostname.database.table.column AS c FROM hostname.database.table * @@ -1270,7 +1270,7 @@ class CI_DB_driver { // This is basically a bug fix for queries that use MAX, MIN, etc. // If a parenthesis is found we know that we do not need to - // escape the data or add a prefix. There's probably a more graceful + // escape the data or add a prefix. There's probably a more graceful // way to deal with this, but I'm not thinking of it -- Rick if (strpos($item, '(') !== FALSE) { @@ -1285,7 +1285,7 @@ class CI_DB_driver { $parts = explode('.', $item); // Does the first segment of the exploded item match - // one of the aliases previously identified? If so, + // one of the aliases previously identified? If so, // we have nothing more to do other than escape the item if (in_array($parts[0], $this->ar_aliased_tables)) { @@ -1304,7 +1304,7 @@ class CI_DB_driver { return $item.$alias; } - // Is there a table prefix defined in the config file? If not, no need to do anything + // Is there a table prefix defined in the config file? If not, no need to do anything if ($this->dbprefix != '') { // We now add the table prefix based on some logic. @@ -1358,7 +1358,7 @@ class CI_DB_driver { return $item.$alias; } - // Is there a table prefix? If not, no need to insert it + // Is there a table prefix? If not, no need to insert it if ($this->dbprefix != '') { // Verify table prefix and replace if necessary diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 9730c7761..a71fca78f 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -1,4 +1,4 @@ -result_array(); - else if ($type == 'object') return $this->result_object(); - else return $this->custom_result_object($type); + if ($type == 'array') return $this->result_array(); + else if ($type == 'object') return $this->result_object(); + else return $this->custom_result_object($type); } // -------------------------------------------------------------------- - /** - * Custom query result. - * - * @param class_name A string that represents the type of object you want back - * @return array of objects - */ - function custom_result_object($class_name) - { - if (array_key_exists($class_name, $this->custom_result_object)) - { - return $this->custom_result_object[$class_name]; - } - - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - // add the data to the object - $this->_data_seek(0); - $result_object = array(); + /** + * Custom query result. + * + * @param class_name A string that represents the type of object you want back + * @return array of objects + */ + function custom_result_object($class_name) + { + if (array_key_exists($class_name, $this->custom_result_object)) + { + return $this->custom_result_object[$class_name]; + } + + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + // add the data to the object + $this->_data_seek(0); + $result_object = array(); while ($row = $this->_fetch_object()) - { - $object = new $class_name(); - foreach ($row as $key => $value) - { - $object->$key = $value; - } + { + $object = new $class_name(); + foreach ($row as $key => $value) + { + $object->$key = $value; + } $result_object[] = $object; } - // return the array - return $this->custom_result_object[$class_name] = $result_object; - } + // return the array + return $this->custom_result_object[$class_name] = $result_object; + } /** - * Query result. "object" version. + * Query result. "object" version. * * @access public * @return object @@ -122,7 +122,7 @@ class CI_DB_result { // -------------------------------------------------------------------- /** - * Query result. "array" version. + * Query result. "array" version. * * @access public * @return array @@ -154,7 +154,7 @@ class CI_DB_result { // -------------------------------------------------------------------- /** - * Query result. Acts as a wrapper function for the following functions. + * Query result. Acts as a wrapper function for the following functions. * * @access public * @param string @@ -180,9 +180,9 @@ class CI_DB_result { $n = 0; } - if ($type == 'object') return $this->row_object($n); - else if ($type == 'array') return $this->row_array($n); - else return $this->custom_row_object($n, $type); + if ($type == 'object') return $this->row_object($n); + else if ($type == 'array') return $this->row_array($n); + else return $this->custom_row_object($n, $type); } // -------------------------------------------------------------------- @@ -219,7 +219,7 @@ class CI_DB_result { // -------------------------------------------------------------------- - /** + /** * Returns a single result row - custom object version * * @access public @@ -242,7 +242,7 @@ class CI_DB_result { return $result[$this->current_row]; } - /** + /** * Returns a single result row - object version * * @access public @@ -383,9 +383,9 @@ class CI_DB_result { /** * The following functions are normally overloaded by the identically named * methods in the platform-specific driver -- except when query caching - * is used. When caching is enabled we do not load the other driver. + * is used. When caching is enabled we do not load the other driver. * These functions are primarily here to prevent undefined function errors - * when a cached result object is in use. They are not otherwise fully + * when a cached result object is in use. They are not otherwise fully * operational due to the unavailability of the database resource IDs with * cached results. */ diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index a3c00a5a6..a5f174f0a 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -1,4 +1,4 @@ -db->db_debug) { diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 56ecf32d1..65397ed8f 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -1,4 +1,4 @@ -db->_protect_identifiers($field); - $sql .= ' '.$attributes['TYPE']; + $sql .= ' '.$attributes['TYPE']; if (array_key_exists('CONSTRAINT', $attributes)) { diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index f1f6dbb84..2897ca5a5 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -1,4 +1,4 @@ -= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback @@ -302,12 +302,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)) { @@ -650,7 +650,7 @@ class CI_DB_mysql_driver extends CI_DB { { if ($field != $index) { - $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; } } } diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 5328a7b4e..529ec980d 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -1,4 +1,4 @@ -= 5.0.7, use SET NAMES as fallback @@ -568,7 +568,7 @@ class CI_DB_mysqli_driver extends CI_DB { { return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); } - + // -------------------------------------------------------------------- /** @@ -630,7 +630,7 @@ class CI_DB_mysqli_driver extends CI_DB { { if ($field != $index) { - $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; } } } diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 6450968dd..d5097335e 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -1,4 +1,4 @@ - format - * value no the value of the parameter. If this is an OUT or IN OUT parameter, + * value no the value of the parameter. If this is an OUT or IN OUT parameter, * this should be a reference to a variable * type yes the type of the parameter * length yes the max size of the parameter @@ -275,8 +275,8 @@ class CI_DB_oci8_driver extends CI_DB { /** * Bind parameters * - * @access private - * @return none + * @access private + * @return none */ function _bind_params($params) { @@ -386,10 +386,10 @@ class CI_DB_oci8_driver extends CI_DB { /** * Escape String * - * @access public - * @param string + * @access public + * @param string * @param bool whether or not the string will be used in a LIKE condition - * @return string + * @return string */ function escape_str($str, $like = FALSE) { @@ -421,8 +421,8 @@ class CI_DB_oci8_driver extends CI_DB { /** * Affected Rows * - * @access public - * @return integer + * @access public + * @return integer */ function affected_rows() { @@ -434,8 +434,8 @@ class CI_DB_oci8_driver extends CI_DB { /** * Insert ID * - * @access public - * @return integer + * @access public + * @return integer */ function insert_id() { @@ -451,9 +451,9 @@ class CI_DB_oci8_driver extends CI_DB { * Generates a platform-specific query string that counts all records in * the specified database * - * @access public - * @param string - * @return string + * @access public + * @param string + * @return string */ function count_all($table = '') { @@ -480,9 +480,9 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @access private + * @access private * @param boolean - * @return string + * @return string */ function _list_tables($prefix_limit = FALSE) { @@ -503,9 +503,9 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * - * @access public - * @param string the table name - * @return string + * @access public + * @param string the table name + * @return string */ function _list_columns($table = '') { @@ -519,9 +519,9 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query so that the column data can be retrieved * - * @access public - * @param string the table name - * @return object + * @access public + * @param string the table name + * @return object */ function _field_data($table) { @@ -533,8 +533,8 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message string * - * @access private - * @return string + * @access private + * @return string */ function _error_message() { @@ -547,8 +547,8 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message number * - * @access private - * @return integer + * @access private + * @return integer */ function _error_number() { @@ -627,11 +627,11 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific insert string from the supplied data * - * @access public - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string + * @access public + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string */ function _insert($table, $keys, $values) { @@ -732,11 +732,11 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific LIMIT clause * - * @access public - * @param string the sql query string - * @param integer the number of rows to limit the query to - * @param integer the offset value - * @return string + * @access public + * @param string the sql query string + * @param integer the number of rows to limit the query to + * @param integer the offset value + * @return string */ function _limit($sql, $limit, $offset) { @@ -759,9 +759,9 @@ class CI_DB_oci8_driver extends CI_DB { /** * Close DB Connection * - * @access public - * @param resource - * @return void + * @access public + * @param resource + * @return void */ function _close($conn_id) { diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 589e3c29d..3cd17585a 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -1,4 +1,4 @@ -db->_protect_identifiers($field); - $sql .= ' '.$attributes['TYPE']; + $sql .= ' '.$attributes['TYPE']; if (array_key_exists('CONSTRAINT', $attributes)) { diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 60d8396ef..88531b436 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -1,4 +1,4 @@ -name = ocicolumnname($this->stmt_id, $c); $F->type = ocicolumntype($this->stmt_id, $c); - $F->max_length = ocicolumnsize($this->stmt_id, $c); + $F->max_length = ocicolumnsize($this->stmt_id, $c); $retval[] = $F; } @@ -145,8 +145,8 @@ class CI_DB_oci8_result extends CI_DB_result { * * Returns the result set as an array * - * @access private - * @return array + * @access private + * @return array */ function _fetch_assoc(&$row) { @@ -162,8 +162,8 @@ class CI_DB_oci8_result extends CI_DB_result { * * Returns the result set as an object * - * @access private - * @return object + * @access private + * @return object */ function _fetch_object() { @@ -202,10 +202,10 @@ class CI_DB_oci8_result extends CI_DB_result { // -------------------------------------------------------------------- /** - * Query result. "array" version. + * Query result. "array" version. * - * @access public - * @return array + * @access public + * @return array */ function result_array() { @@ -230,7 +230,7 @@ class CI_DB_oci8_result extends CI_DB_result { /** * Data Seek * - * Moves the internal pointer to the desired offset. We call + * Moves the internal pointer to the desired offset. We call * this internally before fetching results to make sure the * result set starts at zero * diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index f1fe5dc00..854b467e1 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -1,4 +1,4 @@ -db->_protect_identifiers($field); - $sql .= ' '.$attributes['TYPE']; + $sql .= ' '.$attributes['TYPE']; if (array_key_exists('CONSTRAINT', $attributes)) { diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index d83b2e5f0..5d64a464f 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -1,4 +1,4 @@ -db->_protect_identifiers($field); - $sql .= ' '.$attributes['TYPE']; + $sql .= ' '.$attributes['TYPE']; if (array_key_exists('CONSTRAINT', $attributes)) { @@ -172,7 +172,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { /** * Drop Table * - * Unsupported feature in SQLite + * Unsupported feature in SQLite * * @access private * @return bool diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 62204946c..7bd30db7c 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -1,4 +1,4 @@ -text. To close fieldset + * Used to produce
text. To close fieldset * use form_fieldset_close() * * @access public @@ -663,7 +663,7 @@ if ( ! function_exists('form_prep')) * Form Value * * Grabs a value from the POST array for the specified field so you can - * re-populate an input field or textarea. If Form Validation + * re-populate an input field or textarea. If Form Validation * is active it retrieves the info from the validation class * * @access public @@ -858,7 +858,7 @@ if ( ! function_exists('set_radio')) /** * Form Error * - * Returns the error for a specific form field. This is a helper for the + * Returns the error for a specific form field. This is a helper for the * form validation class. * * @access public @@ -885,7 +885,7 @@ if ( ! function_exists('form_error')) /** * Validation Error String * - * Returns all the errors associated with a form submission. This is a helper + * Returns all the errors associated with a form submission. This is a helper * function for the form validation class. * * @access public @@ -1034,17 +1034,17 @@ if ( ! function_exists('_get_validation_object')) // We set this as a variable since we're returning by reference. $return = FALSE; - + if (FALSE !== ($object = $CI->load->is_loaded('form_validation'))) { if ( ! isset($CI->$object) OR ! is_object($CI->$object)) { return $return; } - + return $CI->$object; } - + return $return; } } diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index bd66bc2d0..080f622dd 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -1,4 +1,4 @@ -\n"; - // Cycle through the list elements. If an array is + // Cycle through the list elements. If an array is // encountered we will recursively call _list() static $_last_list_item = ''; @@ -244,7 +244,7 @@ if ( ! function_exists('img')) * Generates a page document type declaration * * Valid options are xhtml-11, xhtml-strict, xhtml-trans, xhtml-frame, - * html4-strict, html4-trans, and html4-frame. Values are saved in the + * html4-strict, html4-trans, and html4-frame. Values are saved in the * doctypes config file. * * @access public diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 2352b642e..c7c113b8a 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -1,4 +1,4 @@ -'), array('<?php', '<?PHP', '<?', '?>'), $str); + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); } } diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 22ca4df77..6d8889354 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -1,4 +1,4 @@ - $val) { // Keep duplicates from being used, which can happen if the - // mapping array contains multiple identical replacements. For example: + // mapping array contains multiple identical replacements. For example: // :-) and :) might be replaced with the same image so both smileys // will be in the array. if (isset($used[$smileys[$key][0]])) @@ -204,7 +204,7 @@ if ( ! function_exists('parse_smileys')) } // Add a trailing slash to the file path if needed - $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); + $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); foreach ($smileys as $key => $val) { @@ -231,13 +231,13 @@ if ( ! function_exists('_get_smiley_array')) { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } elseif (file_exists(APPPATH.'config/smileys.php')) { include(APPPATH.'config/smileys.php'); } - + if (isset($smileys) AND is_array($smileys)) { return $smileys; diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 9f730bd10..7765bba31 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,4 +1,4 @@ - $val) { - $x[] = ' '.$key.'="'; + $x[] = ' '.$key.'="'; for ($i = 0; $i < strlen($val); $i++) { $x[] = "|".ord(substr($val, $i, 1)); @@ -363,7 +363,7 @@ if ( ! function_exists('safe_mailto')) * * Automatically links URL and Email addresses. * Note: There's a bit of extra code here to deal with - * URLs or emails that end in a period. We'll strip these + * URLs or emails that end in a period. We'll strip these * off and add them after the link. * * @access public diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index 2219d662a..cdd81ad70 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -1,4 +1,4 @@ -","\"", "'", "-"), diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php index fe4276822..e3bd113cb 100644 --- a/system/language/english/email_lang.php +++ b/system/language/english/email_lang.php @@ -5,9 +5,9 @@ $lang['email_invalid_address'] = "Invalid email address: %s"; $lang['email_attachment_missing'] = "Unable to locate the following email attachment: %s"; $lang['email_attachment_unreadable'] = "Unable to open this attachment: %s"; $lang['email_no_recipients'] = "You must include recipients: To, Cc, or Bcc"; -$lang['email_send_failure_phpmail'] = "Unable to send email using PHP mail(). Your server might not be configured to send mail using this method."; -$lang['email_send_failure_sendmail'] = "Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method."; -$lang['email_send_failure_smtp'] = "Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method."; +$lang['email_send_failure_phpmail'] = "Unable to send email using PHP mail(). Your server might not be configured to send mail using this method."; +$lang['email_send_failure_sendmail'] = "Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method."; +$lang['email_send_failure_smtp'] = "Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method."; $lang['email_sent'] = "Your message has been successfully sent using the following protocol: %s"; $lang['email_no_socket'] = "Unable to open a socket to Sendmail. Please check settings."; $lang['email_no_hostname'] = "You did not specify a SMTP hostname."; diff --git a/system/language/english/imglib_lang.php b/system/language/english/imglib_lang.php index 0a56fe0a5..66505da07 100644 --- a/system/language/english/imglib_lang.php +++ b/system/language/english/imglib_lang.php @@ -4,20 +4,20 @@ $lang['imglib_source_image_required'] = "You must specify a source image in your $lang['imglib_gd_required'] = "The GD image library is required for this feature."; $lang['imglib_gd_required_for_props'] = "Your server must support the GD image library in order to determine the image properties."; $lang['imglib_unsupported_imagecreate'] = "Your server does not support the GD function required to process this type of image."; -$lang['imglib_gif_not_supported'] = "GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead."; +$lang['imglib_gif_not_supported'] = "GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead."; $lang['imglib_jpg_not_supported'] = "JPG images are not supported."; $lang['imglib_png_not_supported'] = "PNG images are not supported."; $lang['imglib_jpg_or_png_required'] = "The image resize protocol specified in your preferences only works with JPEG or PNG image types."; -$lang['imglib_copy_error'] = "An error was encountered while attempting to replace the file. Please make sure your file directory is writable."; +$lang['imglib_copy_error'] = "An error was encountered while attempting to replace the file. Please make sure your file directory is writable."; $lang['imglib_rotate_unsupported'] = "Image rotation does not appear to be supported by your server."; -$lang['imglib_libpath_invalid'] = "The path to your image library is not correct. Please set the correct path in your image preferences."; -$lang['imglib_image_process_failed'] = "Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct."; +$lang['imglib_libpath_invalid'] = "The path to your image library is not correct. Please set the correct path in your image preferences."; +$lang['imglib_image_process_failed'] = "Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct."; $lang['imglib_rotation_angle_required'] = "An angle of rotation is required to rotate the image."; $lang['imglib_writing_failed_gif'] = "GIF image."; $lang['imglib_invalid_path'] = "The path to the image is not correct."; $lang['imglib_copy_failed'] = "The image copy routine failed."; $lang['imglib_missing_font'] = "Unable to find a font to use."; -$lang['imglib_save_failed'] = "Unable to save the image. Please make sure the image and file directory are writable."; +$lang['imglib_save_failed'] = "Unable to save the image. Please make sure the image and file directory are writable."; /* End of file imglib_lang.php */ diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index 938c80857..61e7aa761 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -10,22 +10,22 @@ * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 - * @filesource + * @filesource */ // ------------------------------------------------------------------------ /** - * CodeIgniter Caching Class + * CodeIgniter Caching Class * * @package CodeIgniter * @subpackage Libraries * @category Core * @author ExpressionEngine Dev Team - * @link + * @link */ class CI_Cache extends CI_Driver_Library { - + protected $valid_drivers = array( 'cache_apc', 'cache_file', 'cache_memcached', 'cache_dummy' ); @@ -33,7 +33,7 @@ class CI_Cache extends CI_Driver_Library { protected $_cache_path = NULL; // Path of cache files (if file-based cache) protected $_adapter = 'dummy'; protected $_backup_driver; - + // ------------------------------------------------------------------------ /** @@ -52,16 +52,16 @@ class CI_Cache extends CI_Driver_Library { // ------------------------------------------------------------------------ /** - * Get + * Get * - * Look for a value in the cache. If it exists, return the data + * Look for a value in the cache. If it exists, return the data * if not, return FALSE * - * @param string + * @param string * @return mixed value that is stored/FALSE on failure */ public function get($id) - { + { return $this->{$this->_adapter}->get($id); } @@ -112,7 +112,7 @@ class CI_Cache extends CI_Driver_Library { * Cache Info * * @param string user/filehits - * @return mixed array on success, false on failure + * @return mixed array on success, false on failure */ public function cache_info($type = 'user') { @@ -120,7 +120,7 @@ class CI_Cache extends CI_Driver_Library { } // ------------------------------------------------------------------------ - + /** * Get Cache Metadata * @@ -131,7 +131,7 @@ class CI_Cache extends CI_Driver_Library { { return $this->{$this->_adapter}->get_metadata($id); } - + // ------------------------------------------------------------------------ /** @@ -139,11 +139,11 @@ class CI_Cache extends CI_Driver_Library { * * Initialize class properties based on the configuration array. * - * @param array + * @param array * @return void */ private function _initialize($config) - { + { $default_config = array( 'adapter', 'memcached' @@ -207,7 +207,7 @@ class CI_Cache extends CI_Driver_Library { return $obj; } - + // ------------------------------------------------------------------------ } // End Class diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index ea129eded..de75719c4 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -10,30 +10,30 @@ * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 - * @filesource + * @filesource */ // ------------------------------------------------------------------------ /** - * CodeIgniter APC Caching Class + * CodeIgniter APC Caching Class * * @package CodeIgniter * @subpackage Libraries * @category Core * @author ExpressionEngine Dev Team - * @link + * @link */ class CI_Cache_apc extends CI_Driver { /** - * Get + * Get * - * Look for a value in the cache. If it exists, return the data + * Look for a value in the cache. If it exists, return the data * if not, return FALSE * - * @param string + * @param string * @return mixed value that is stored/FALSE on failure */ public function get($id) @@ -43,8 +43,8 @@ class CI_Cache_apc extends CI_Driver { return (is_array($data)) ? $data[0] : FALSE; } - // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ + /** * Cache Save * @@ -58,7 +58,7 @@ class CI_Cache_apc extends CI_Driver { { return apc_store($id, array($data, time(), $ttl), $ttl); } - + // ------------------------------------------------------------------------ /** @@ -90,7 +90,7 @@ class CI_Cache_apc extends CI_Driver { * Cache Info * * @param string user/filehits - * @return mixed array on success, false on failure + * @return mixed array on success, false on failure */ public function cache_info($type = NULL) { @@ -137,13 +137,13 @@ class CI_Cache_apc extends CI_Driver { log_message('error', 'The APC PHP extension must be loaded to use APC Cache.'); return FALSE; } - + return TRUE; } // ------------------------------------------------------------------------ - + } // End Class diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php index 39dcd15c2..13e2d1af6 100644 --- a/system/libraries/Cache/drivers/Cache_file.php +++ b/system/libraries/Cache/drivers/Cache_file.php @@ -10,19 +10,19 @@ * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 - * @filesource + * @filesource */ // ------------------------------------------------------------------------ /** - * CodeIgniter Memcached Caching Class + * CodeIgniter Memcached Caching Class * * @package CodeIgniter * @subpackage Libraries * @category Core * @author ExpressionEngine Dev Team - * @link + * @link */ class CI_Cache_file extends CI_Driver { @@ -36,9 +36,9 @@ class CI_Cache_file extends CI_Driver { { $CI =& get_instance(); $CI->load->helper('file'); - + $path = $CI->config->item('cache_path'); - + $this->_cache_path = ($path == '') ? APPPATH.'cache/' : $path; } @@ -56,16 +56,16 @@ class CI_Cache_file extends CI_Driver { { return FALSE; } - + $data = read_file($this->_cache_path.$id); $data = unserialize($data); - - if (time() > $data['time'] + $data['ttl']) + + if (time() > $data['time'] + $data['ttl']) { unlink($this->_cache_path.$id); return FALSE; } - + return $data['data']; } @@ -76,22 +76,22 @@ class CI_Cache_file extends CI_Driver { * * @param string unique key * @param mixed data to store - * @param int length of time (in seconds) the cache is valid + * @param int length of time (in seconds) the cache is valid * - Default is 60 seconds * @return boolean true on success/false on failure */ public function save($id, $data, $ttl = 60) - { + { $contents = array( 'time' => time(), - 'ttl' => $ttl, + 'ttl' => $ttl, 'data' => $data ); - + if (write_file($this->_cache_path.$id, serialize($contents))) { @chmod($this->_cache_path.$id, 0777); - return TRUE; + return TRUE; } return FALSE; @@ -116,7 +116,7 @@ class CI_Cache_file extends CI_Driver { * Clean the Cache * * @return boolean false on failure/true on success - */ + */ public function clean() { return delete_files($this->_cache_path); @@ -151,10 +151,10 @@ class CI_Cache_file extends CI_Driver { { return FALSE; } - - $data = read_file($this->_cache_path.$id); + + $data = read_file($this->_cache_path.$id); $data = unserialize($data); - + if (is_array($data)) { $data = $data['data']; @@ -170,7 +170,7 @@ class CI_Cache_file extends CI_Driver { 'mtime' => $mtime ); } - + return FALSE; } @@ -180,7 +180,7 @@ class CI_Cache_file extends CI_Driver { * Is supported * * In the file driver, check to see that the cache directory is indeed writable - * + * * @return boolean */ public function is_supported() diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 7dcbaab47..df0fd6eeb 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -1,4 +1,4 @@ -local_time); + $year = date("Y", $this->local_time); if ($month == '') $month = date("m", $this->local_time); @@ -128,7 +128,7 @@ class CI_Calendar { // Set the starting day number $local_date = mktime(12, 0, 0, $month, 1, $year); $date = getdate($local_date); - $day = $start_day + 1 - $date["wday"]; + $day = $start_day + 1 - $date["wday"]; while ($day > 1) { @@ -157,8 +157,8 @@ class CI_Calendar { // "previous" month link if ($this->show_next_prev == TRUE) { - // Add a trailing slash to the URL if needed - $this->next_prev_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->next_prev_url); + // Add a trailing slash to the URL if needed + $this->next_prev_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->next_prev_url); $adjusted_date = $this->adjust_date($month - 1, $year); $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_previous_cell']); @@ -233,7 +233,7 @@ class CI_Calendar { $out .= $this->temp['cal_cell_blank']; } - $out .= ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end']; + $out .= ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end']; $day++; } @@ -287,7 +287,7 @@ class CI_Calendar { * Get Day Names * * Returns an array of day names (Sunday, Monday, etc.) based - * on the type. Options: long, short, abrev + * on the type. Options: long, short, abrev * * @access public * @param string @@ -404,7 +404,7 @@ class CI_Calendar { */ function default_template() { - return array ( + return array ( 'table_open' => '', 'heading_row_start' => '', 'heading_previous_cell' => '', @@ -451,7 +451,7 @@ class CI_Calendar { $today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today'); - foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today') as $val) + foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today') as $val) { if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match)) { diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index fbccfb3d9..7f65b48b9 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -1,4 +1,4 @@ -CI =& get_instance(); - // Are any config settings being passed manually? If so, set them + // Are any config settings being passed manually? If so, set them $config = array(); if (count($params) > 0) { @@ -148,7 +148,7 @@ class CI_Cart { // -------------------------------------------------------------------- - // Does the $items array contain an id, quantity, price, and name? These are required + // Does the $items array contain an id, quantity, price, and name? These are required if ( ! isset($items['id']) OR ! isset($items['qty']) OR ! isset($items['price']) OR ! isset($items['name'])) { log_message('error', 'The cart array must contain a product ID, quantity, price, and name.'); @@ -157,7 +157,7 @@ class CI_Cart { // -------------------------------------------------------------------- - // Prep the quantity. It can only be a number. Duh... + // Prep the quantity. It can only be a number. Duh... $items['qty'] = trim(preg_replace('/([^0-9])/i', '', $items['qty'])); // Trim any leading zeros $items['qty'] = trim(preg_replace('/(^[0]+)/i', '', $items['qty'])); @@ -175,7 +175,7 @@ class CI_Cart { // Note: These can be user-specified by setting the $this->product_id_rules variable. if ( ! preg_match("/^[".$this->product_id_rules."]+$/i", $items['id'])) { - log_message('error', 'Invalid product ID. The product ID can only contain alpha-numeric characters, dashes, and underscores'); + log_message('error', 'Invalid product ID. The product ID can only contain alpha-numeric characters, dashes, and underscores'); return FALSE; } @@ -191,7 +191,7 @@ class CI_Cart { // -------------------------------------------------------------------- - // Prep the price. Remove anything that isn't a number or decimal point. + // Prep the price. Remove anything that isn't a number or decimal point. $items['price'] = trim(preg_replace('/([^0-9\.])/i', '', $items['price'])); // Trim any leading zeros $items['price'] = trim(preg_replace('/(^[0]+)/i', '', $items['price'])); @@ -210,7 +210,7 @@ class CI_Cart { // Each row in the cart array, however, must have a unique index that identifies not only // a particular product, but makes it possible to store identical products with different options. // For example, what if someone buys two identical t-shirts (same product ID), but in - // different sizes? The product ID (and other attributes, like the name) will be identical for + // different sizes? The product ID (and other attributes, like the name) will be identical for // both sizes because it's the same shirt. The only difference will be the size. // Internally, we need to treat identical submissions, but with different options, as a unique product. // Our solution is to convert the options array to a string and MD5 it along with the product ID. @@ -271,7 +271,7 @@ class CI_Cart { } // You can either update a single product using a one-dimensional array, - // or multiple products using a multi-dimensional one. The way we + // or multiple products using a multi-dimensional one. The way we // determine the array type is by looking for a required array key named "id". // If it's not found we assume it's a multi-dimensional array $save_cart = FALSE; @@ -344,7 +344,7 @@ class CI_Cart { return FALSE; } - // Is the quantity zero? If so we will remove the item from the cart. + // Is the quantity zero? If so we will remove the item from the cart. // If the quantity is greater than zero we are updating if ($items['qty'] == 0) { @@ -392,7 +392,7 @@ class CI_Cart { $this->_cart_contents['total_items'] = count($this->_cart_contents); $this->_cart_contents['cart_total'] = $total; - // Is our cart empty? If so we delete it from the session + // Is our cart empty? If so we delete it from the session if (count($this->_cart_contents) <= 2) { $this->CI->session->unset_userdata('cart_contents'); diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index b90b5aba6..d1925c0ec 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -1,4 +1,4 @@ -_attach_name[] = $filename; $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); - $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters + $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters return $this; } @@ -600,7 +600,7 @@ class CI_Email { $from = str_replace(">", "", $from); $from = str_replace("<", "", $from); - return "<".uniqid('').strstr($from, '@').">"; + return "<".uniqid('').strstr($from, '@').">"; } // -------------------------------------------------------------------- @@ -660,15 +660,15 @@ class CI_Email { */ private function _get_content_type() { - if ($this->mailtype == 'html' && count($this->_attach_name) == 0) + if ($this->mailtype == 'html' && count($this->_attach_name) == 0) { return 'html'; } - elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) + elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) { return 'html-attach'; } - elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) + elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) { return 'plain-attach'; } @@ -881,7 +881,7 @@ class CI_Email { // Use PHP's native public function to do the initial wordwrap. // We set the cut flag to FALSE so that any individual words that are - // too long get left alone. In the next step we'll deal with them. + // too long get left alone. In the next step we'll deal with them. $str = wordwrap($str, $charlim, "\n", FALSE); // Split the string into individual lines of text and cycle through them @@ -999,7 +999,7 @@ class CI_Email { */ private function _build_message() { - if ($this->wordwrap === TRUE AND $this->mailtype != 'html') + if ($this->wordwrap === TRUE AND $this->mailtype != 'html') { $this->_body = $this->word_wrap($this->_body); } @@ -1135,7 +1135,7 @@ class CI_Email { return FALSE; } - $h = "--".$this->_atc_boundary.$this->newline; + $h = "--".$this->_atc_boundary.$this->newline; $h .= "Content-type: ".$ctype."; "; $h .= "name=\"".$basename."\"".$this->newline; $h .= "Content-Disposition: ".$this->_attach_disp[$i].";".$this->newline; @@ -1237,7 +1237,7 @@ class CI_Email { // encode = signs if ($ascii == '61') { - $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D + $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D } // If we're at the character limit, add the line to the output, @@ -1267,7 +1267,7 @@ class CI_Email { /** * Prep Q Encoding * - * Performs "Q Encoding" on a string for use in email headers. It's related + * Performs "Q Encoding" on a string for use in email headers. It's related * but not identical to quoted-printable, so it has its own method * * @access public @@ -1349,7 +1349,7 @@ class CI_Email { $this->reply_to($this->_headers['From']); } - if (( ! isset($this->_recipients) AND ! isset($this->_headers['To'])) AND + if (( ! isset($this->_recipients) AND ! isset($this->_headers['To'])) AND ( ! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND ( ! isset($this->_headers['Cc']))) { @@ -1359,7 +1359,7 @@ class CI_Email { $this->_build_headers(); - if ($this->bcc_batch_mode AND count($this->_bcc_array) > 0) + if ($this->bcc_batch_mode AND count($this->_bcc_array) > 0) { if (count($this->_bcc_array) > $this->bcc_batch_size) return $this->batch_bcc_send(); @@ -1380,7 +1380,7 @@ class CI_Email { // -------------------------------------------------------------------- /** - * Batch Bcc Send. Sends groups of BCCs in batches + * Batch Bcc Send. Sends groups of BCCs in batches * * @access public * @return bool @@ -1752,7 +1752,7 @@ class CI_Email { // -------------------------------------------------------------------- /** - * SMTP Authenticate + * SMTP Authenticate * * @access private * @return bool @@ -1764,7 +1764,7 @@ class CI_Email { return TRUE; } - if ($this->smtp_user == "" AND $this->smtp_pass == "") + if ($this->smtp_user == "" AND $this->smtp_pass == "") { $this->_set_error_message('lang:email_no_smtp_unpw'); return FALSE; diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 2f7db6623..b30a8cf0b 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -1,4 +1,4 @@ -_field_data) == 0) { - // No validation rules? We're done... + // No validation rules? We're done... if (count($this->_config_rules) == 0) { return FALSE; @@ -648,7 +648,7 @@ class CI_Form_validation { } } - // Did the rule test negatively? If so, grab the error. + // Did the rule test negatively? If so, grab the error. if ($result === FALSE) { if ( ! isset($this->_error_messages[$rule])) @@ -664,7 +664,7 @@ class CI_Form_validation { } // Is the parameter we are inserting into the error message the name - // of another field? If so we need to grab its "field label" + // of another field? If so we need to grab its "field label" if (isset($this->_field_data[$param]) AND isset($this->_field_data[$param]['label'])) { $param = $this->_translate_fieldname($this->_field_data[$param]['label']); @@ -704,7 +704,7 @@ class CI_Form_validation { // Grab the variable $line = substr($fieldname, 5); - // Were we able to translate the field name? If not we use $line + // Were we able to translate the field name? If not we use $line if (FALSE === ($fieldname = $this->CI->lang->line($line))) { return $line; @@ -735,7 +735,7 @@ class CI_Form_validation { } // If the data is an array output them one at a time. - // E.g: form_input('name[]', set_value('name[]'); + // E.g: form_input('name[]', set_value('name[]'); if (is_array($this->_field_data[$field]['postdata'])) { return array_shift($this->_field_data[$field]['postdata']); @@ -914,7 +914,7 @@ class CI_Form_validation { return FALSE; } - return TRUE; + return TRUE; } // -------------------------------------------------------------------- @@ -1207,7 +1207,7 @@ class CI_Form_validation { // -------------------------------------------------------------------- /** - * Is a Natural number (0,1,2,3, etc.) + * Is a Natural number (0,1,2,3, etc.) * * @access public * @param string @@ -1221,7 +1221,7 @@ class CI_Form_validation { // -------------------------------------------------------------------- /** - * Is a Natural number, but not a zero (1,2,3, etc.) + * Is a Natural number, but not a zero (1,2,3, etc.) * * @access public * @param string @@ -1354,7 +1354,7 @@ class CI_Form_validation { */ function encode_php_tags($str) { - return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); } } diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 859cc9c30..d7a8b3b02 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -1,4 +1,4 @@ -list_files($filepath); @@ -513,7 +513,7 @@ class CI_FTP { * Read a directory and recreate it remotely * * This function recursively reads a folder and everything it contains (including - * sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure + * sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure * of the original file path will be recreated on the server. * * @access public diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 099a238dd..8902f524d 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1,4 +1,4 @@ -source_image == '') { $this->set_error('imglib_source_image_required'); - return FALSE; + return FALSE; } /* * Is getimagesize() Available? * * We use it to determine the image properties (width/height). - * Note: We need to figure out how to determine image + * Note: We need to figure out how to determine image * properties using ImageMagick and NetPBM * */ @@ -189,7 +189,7 @@ class CI_Image_lib { // Set the Image Properties if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) { - return FALSE; + return FALSE; } /* @@ -197,7 +197,7 @@ class CI_Image_lib { * * If the user has set a "new_image" name it means * we are making a copy of the source image. If not - * it means we are altering the original. We'll + * it means we are altering the original. We'll * set the destination filename and path accordingly. * */ @@ -267,7 +267,7 @@ class CI_Image_lib { * * When creating thumbs or copies, the target width/height * might not be in correct proportion with the source - * image's width/height. We'll recalculate it here. + * image's width/height. We'll recalculate it here. * */ if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != '')) @@ -399,7 +399,7 @@ class CI_Image_lib { if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs)) { $this->set_error('imglib_rotation_angle_required'); - return FALSE; + return FALSE; } // Reassign the width and height @@ -469,8 +469,8 @@ class CI_Image_lib { // Let's set up our values based on the action if ($action == 'crop') { - // Reassign the source width/height if cropping - $this->orig_width = $this->width; + // Reassign the source width/height if cropping + $this->orig_width = $this->width; $this->orig_height = $this->height; // GD 2.0 has a cropping bug so we'll test for it @@ -487,19 +487,19 @@ class CI_Image_lib { $this->y_axis = 0; } - // Create the image handle + // Create the image handle if ( ! ($src_img = $this->image_create_gd())) { return FALSE; } - // Create The Image + // Create The Image // - // old conditional which users report cause problems with shared GD libs who report themselves as "2.0 or greater" - // it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment - // below should that ever prove inaccurate. + // old conditional which users report cause problems with shared GD libs who report themselves as "2.0 or greater" + // it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment + // below should that ever prove inaccurate. // - // if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) + // if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor')) { $create = 'imagecreatetruecolor'; @@ -521,7 +521,7 @@ class CI_Image_lib { $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); - // Show the image + // Show the image if ($this->dynamic_output == TRUE) { $this->image_display_gd($dst_img); @@ -535,7 +535,7 @@ class CI_Image_lib { } } - // Kill the file handles + // Kill the file handles imagedestroy($dst_img); imagedestroy($src_img); @@ -558,7 +558,7 @@ class CI_Image_lib { */ function image_process_imagemagick($action = 'resize') { - // Do we have a vaild library path? + // Do we have a vaild library path? if ($this->library_path == '') { $this->set_error('imglib_libpath_invalid'); @@ -593,7 +593,7 @@ class CI_Image_lib { $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; } - else // Resize + else // Resize { $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; } @@ -634,7 +634,7 @@ class CI_Image_lib { return FALSE; } - // Build the resizing command + // Build the resizing command switch ($this->image_type) { case 1 : @@ -684,7 +684,7 @@ class CI_Image_lib { @exec($cmd, $output, $retval); - // Did it work? + // Did it work? if ($retval > 0) { $this->set_error('imglib_image_process_failed'); @@ -711,7 +711,7 @@ class CI_Image_lib { */ function image_rotate_gd() { - // Create the image handle + // Create the image handle if ( ! ($src_img = $this->image_create_gd())) { return FALSE; @@ -724,10 +724,10 @@ class CI_Image_lib { $white = imagecolorallocate($src_img, 255, 255, 255); - // Rotate it! + // Rotate it! $dst_img = imagerotate($src_img, $this->rotation_angle, $white); - // Save the Image + // Save the Image if ($this->dynamic_output == TRUE) { $this->image_display_gd($dst_img); @@ -741,7 +741,7 @@ class CI_Image_lib { } } - // Kill the file handles + // Kill the file handles imagedestroy($dst_img); imagedestroy($src_img); @@ -769,14 +769,14 @@ class CI_Image_lib { return FALSE; } - $width = $this->orig_width; + $width = $this->orig_width; $height = $this->orig_height; if ($this->rotation_angle == 'hor') { for ($i = 0; $i < $height; $i++) { - $left = 0; + $left = 0; $right = $width-1; while ($left < $right) @@ -813,7 +813,7 @@ class CI_Image_lib { } } - // Show the image + // Show the image if ($this->dynamic_output == TRUE) { $this->image_display_gd($src_img); @@ -827,7 +827,7 @@ class CI_Image_lib { } } - // Kill the file handles + // Kill the file handles imagedestroy($src_img); // Set the file to 777 @@ -876,24 +876,24 @@ class CI_Image_lib { return FALSE; } - // Fetch source image properties + // Fetch source image properties $this->get_image_properties(); - // Fetch watermark image properties + // Fetch watermark image properties $props = $this->get_image_properties($this->wm_overlay_path, TRUE); $wm_img_type = $props['image_type']; $wm_width = $props['width']; $wm_height = $props['height']; - // Create two image resources - $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); + // Create two image resources + $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); $src_img = $this->image_create_gd($this->full_src_path); // Reverse the offset if necessary // When the image is positioned at the bottom // we don't want the vertical offset to push it - // further down. We want the reverse, so we'll - // invert the offset. Same with the horizontal + // further down. We want the reverse, so we'll + // invert the offset. Same with the horizontal // offset when the image is at the right $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); @@ -905,11 +905,11 @@ class CI_Image_lib { if ($this->wm_hor_alignment == 'R') $this->wm_hor_offset = $this->wm_hor_offset * -1; - // Set the base x and y axis values + // Set the base x and y axis values $x_axis = $this->wm_hor_offset + $this->wm_padding; $y_axis = $this->wm_vrt_offset + $this->wm_padding; - // Set the vertical position + // Set the vertical position switch ($this->wm_vrt_alignment) { case 'T': @@ -920,7 +920,7 @@ class CI_Image_lib { break; } - // Set the horizontal position + // Set the horizontal position switch ($this->wm_hor_alignment) { case 'L': @@ -931,7 +931,7 @@ class CI_Image_lib { break; } - // Build the finalized image + // Build the finalized image if ($wm_img_type == 3 AND function_exists('imagealphablending')) { @imagealphablending($src_img, TRUE); @@ -954,7 +954,7 @@ class CI_Image_lib { imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity); } - // Output the image + // Output the image if ($this->dynamic_output == TRUE) { $this->image_display_gd($src_img); @@ -994,7 +994,7 @@ class CI_Image_lib { return FALSE; } - // Fetch source image properties + // Fetch source image properties $this->get_image_properties(); // Set RGB values for text and shadow @@ -1015,8 +1015,8 @@ class CI_Image_lib { // Reverse the vertical offset // When the image is positioned at the bottom // we don't want the vertical offset to push it - // further down. We want the reverse, so we'll - // invert the offset. Note: The horizontal + // further down. We want the reverse, so we'll + // invert the offset. Note: The horizontal // offset flips itself automatically if ($this->wm_vrt_alignment == 'B') @@ -1033,13 +1033,13 @@ class CI_Image_lib { if ($this->wm_font_size == '') $this->wm_font_size = '17'; - $fontwidth = $this->wm_font_size-($this->wm_font_size/4); + $fontwidth = $this->wm_font_size-($this->wm_font_size/4); $fontheight = $this->wm_font_size; $this->wm_vrt_offset += $this->wm_font_size; } else { - $fontwidth = imagefontwidth($this->wm_font_size); + $fontwidth = imagefontwidth($this->wm_font_size); $fontheight = imagefontheight($this->wm_font_size); } @@ -1080,11 +1080,11 @@ class CI_Image_lib { case "C": if ($this->wm_use_drop_shadow) $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); - $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); + $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); break; } - // Add the text to the source image + // Add the text to the source image if ($this->wm_use_truetype) { if ($this->wm_use_drop_shadow) @@ -1098,7 +1098,7 @@ class CI_Image_lib { imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); } - // Output the final image + // Output the final image if ($this->dynamic_output == TRUE) { $this->image_display_gd($src_img); @@ -1366,7 +1366,7 @@ class CI_Image_lib { * Size calculator * * This function takes a known width x height and - * recalculates it to a new size. Only one + * recalculates it to a new size. Only one * new variable needs to be known * * $props = array( @@ -1374,7 +1374,7 @@ class CI_Image_lib { * 'height' => $height, * 'new_width' => 40, * 'new_height' => '' - * ); + * ); * * @access public * @param array @@ -1418,10 +1418,10 @@ class CI_Image_lib { * Explode source_image * * This is a helper function that extracts the extension - * from the source_image. This function lets us deal with - * source_images with multiple periods, like: my.cool.jpg + * from the source_image. This function lets us deal with + * source_images with multiple periods, like: my.cool.jpg * It returns an associative array with two elements: - * $array['ext'] = '.jpg'; + * $array['ext'] = '.jpg'; * $array['name'] = 'my.cool'; * * @access public diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index 9e42a4385..34e0d7001 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -1,4 +1,4 @@ -js =& $this->CI->$js_library_driver; - log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver"); + log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver"); } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- // Event Code // -------------------------------------------------------------------- @@ -378,7 +378,7 @@ class CI_Javascript { return $this->js->_unload($element, $js); } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- // Effects // -------------------------------------------------------------------- @@ -685,7 +685,7 @@ class CI_Javascript { return $str; } - + // -------------------------------------------------------------------- /** @@ -855,7 +855,7 @@ class CI_Javascript { } elseif (is_string($result) OR $is_key) { - return '"'.str_replace(array('\\', "\t", "\n", "\r", '"', '/'), array('\\\\', '\\t', '\\n', "\\r", '\"', '\/'), $result).'"'; + return '"'.str_replace(array('\\', "\t", "\n", "\r", '"', '/'), array('\\\\', '\\t', '\\n', "\\r", '\"', '\/'), $result).'"'; } elseif (is_scalar($result)) { diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 2505fc678..9f1db76ba 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -1,4 +1,4 @@ - '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); + protected $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); /** * Constructor @@ -84,11 +84,11 @@ class CI_Log { } $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; - $message = ''; + $message = ''; if ( ! file_exists($filepath)) { - $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; + $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; } if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index d9c22d501..cc62e660b 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -1,4 +1,4 @@ -cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1; - $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages; + $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages; - // Is pagination being used over GET or POST? If get, add a per_page query + // Is pagination being used over GET or POST? If get, add a per_page query // string. If post, add a trailing slash to the base URL if needed if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) { @@ -194,14 +194,14 @@ class CI_Pagination { $output = ''; // Render the "First" link - if ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1)) + if ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1)) { $first_url = ($this->first_url == '') ? $this->base_url : $this->first_url; $output .= $this->first_tag_open.'anchor_class.'href="'.$first_url.'">'.$this->first_link.''.$this->first_tag_close; } // Render the "previous" link - if ($this->prev_link !== FALSE AND $this->cur_page != 1) + if ($this->prev_link !== FALSE AND $this->cur_page != 1) { $i = $uri_page_number - $this->per_page; @@ -263,7 +263,7 @@ class CI_Pagination { $output .= $this->last_tag_open.'anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.''.$this->last_tag_close; } - // Kill double slashes. Note: Sometimes we can end up with a double slash + // Kill double slashes. Note: Sometimes we can end up with a double slash // in the penultimate link so we'll kill all double slashes. $output = preg_replace("#([^:])//+#", "\\1/", $output); diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index f48f2a7e5..d223da020 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -1,4 +1,4 @@ -'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; @@ -168,7 +168,7 @@ class CI_Profiler { if (count($dbs) == 0) { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; @@ -187,7 +187,7 @@ class CI_Profiler { // Key words we want bolded $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); - $output = "\n\n"; + $output = "\n\n"; $count = 0; @@ -249,7 +249,7 @@ class CI_Profiler { */ protected function _compile_get() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_get_data').'  '; @@ -298,7 +298,7 @@ class CI_Profiler { */ protected function _compile_post() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_post_data').'  '; @@ -347,7 +347,7 @@ class CI_Profiler { */ protected function _compile_uri_string() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_uri_string').'  '; @@ -376,7 +376,7 @@ class CI_Profiler { */ protected function _compile_controller_info() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_controller_info').'  '; @@ -400,7 +400,7 @@ class CI_Profiler { */ protected function _compile_memory_usage() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_memory_usage').'  '; @@ -431,7 +431,7 @@ class CI_Profiler { */ protected function _compile_http_headers() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_headers').'  ('.$this->CI->lang->line('profiler_section_show').')'; @@ -462,7 +462,7 @@ class CI_Profiler { */ protected function _compile_config() { - $output = "\n\n"; + $output = "\n\n"; $output .= '
'; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')'; diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 76525dbb8..2c8a80163 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -1,4 +1,4 @@ -CI->load->library('encrypt'); } - // Are we using a database? If so, load it + // Are we using a database? If so, load it if ($this->sess_use_database === TRUE AND $this->sess_table_name != '') { $this->CI->load->database(); } - // Set the "now" time. Can either be GMT or server time, based on the - // config prefs. We use this to set the "last activity" time + // Set the "now" time. Can either be GMT or server time, based on the + // config prefs. We use this to set the "last activity" time $this->now = $this->_get_time(); // Set the session length. If the session expiration is @@ -97,12 +97,12 @@ class CI_Session { { $this->sess_expiration = (60*60*24*365*2); } - + // Set the cookie name $this->sess_cookie_name = $this->cookie_prefix.$this->sess_cookie_name; // Run the Session routine. If a session doesn't exist we'll - // create a new one. If it does, we'll update it. + // create a new one. If it does, we'll update it. if ( ! $this->sess_read()) { $this->sess_create(); @@ -137,7 +137,7 @@ class CI_Session { // Fetch the cookie $session = $this->CI->input->cookie($this->sess_cookie_name); - // No cookie? Goodbye cruel world!... + // No cookie? Goodbye cruel world!... if ($session === FALSE) { log_message('debug', 'A session cookie was not found.'); @@ -155,8 +155,8 @@ class CI_Session { $hash = substr($session, strlen($session)-32); // get last 32 chars $session = substr($session, 0, strlen($session)-32); - // Does the md5 hash match? This is to prevent manipulation of session data in userspace - if ($hash !== md5($session.$this->encryption_key)) + // Does the md5 hash match? This is to prevent manipulation of session data in userspace + if ($hash !== md5($session.$this->encryption_key)) { log_message('error', 'The session cookie data did not match what was expected. This could be a possible hacking attempt.'); $this->sess_destroy(); @@ -212,14 +212,14 @@ class CI_Session { $query = $this->CI->db->get($this->sess_table_name); - // No result? Kill it! + // No result? Kill it! if ($query->num_rows() == 0) { $this->sess_destroy(); return FALSE; } - // Is there custom data? If so, add it to the main session array + // Is there custom data? If so, add it to the main session array $row = $query->row(); if (isset($row->user_data) AND $row->user_data != '') { @@ -252,7 +252,7 @@ class CI_Session { */ function sess_write() { - // Are we saving custom data to the DB? If not, all we do is update the cookie + // Are we saving custom data to the DB? If not, all we do is update the cookie if ($this->sess_use_database === FALSE) { $this->_set_cookie(); @@ -272,7 +272,7 @@ class CI_Session { $cookie_userdata[$val] = $this->userdata[$val]; } - // Did we find any custom data? If not, we turn the empty array into a string + // Did we find any custom data? If not, we turn the empty array into a string // since there's no reason to serialize and store an empty array in the DB if (count($custom_userdata) === 0) { @@ -288,7 +288,7 @@ class CI_Session { $this->CI->db->where('session_id', $this->userdata['session_id']); $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata)); - // Write the cookie. Notice that we manually pass the cookie data array to the + // Write the cookie. Notice that we manually pass the cookie data array to the // _set_cookie() function. Normally that function will store $this->userdata, but // in this case that array contains custom data, which we do not want in the cookie. $this->_set_cookie($cookie_userdata); @@ -535,7 +535,7 @@ class CI_Session { */ function keep_flashdata($key) { - // 'old' flashdata gets removed. Here we mark all + // 'old' flashdata gets removed. Here we mark all // flashdata as 'new' to preserve it from _flashdata_sweep() // Note the function will return FALSE if the $key // provided cannot be found diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index 04e07d1c1..1a657572b 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -1,4 +1,4 @@ -heading) == 0 AND count($this->rows) == 0) { return 'Undefined table data'; @@ -376,7 +376,7 @@ class CI_Table { // -------------------------------------------------------------------- /** - * Clears the table arrays. Useful if multiple tables are being generated + * Clears the table arrays. Useful if multiple tables are being generated * * @access public * @return void @@ -495,7 +495,7 @@ class CI_Table { */ function _default_template() { - return array ( + return array ( 'table_open' => '
<<
', 'thead_open' => '', diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index b0f8a9098..b0a767822 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -1,4 +1,4 @@ -","\"", "'", "-"), array("&", "<", ">", """, "'", "-"), diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 3ceb0b52b..734cec104 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -1,4 +1,4 @@ - tags if they exist. It's cheaper to do this separately since most content will + // match and yank
 tags if they exist.  It's cheaper to do this separately since most content will
 		// not contain 
 tags, and it keeps the PCRE patterns below simpler and faster
 		if (strpos($str, 'inline_elements.")([ >])#i", "{@TAG}\\1\\2\\3", $str);
 
-		// Split the string at every tag. This expression creates an array with this prototype:
+		// Split the string at every tag.  This expression creates an array with this prototype:
 		//
 		//	[array]
 		//	{
@@ -126,7 +126,7 @@ class CI_Typography {
 		//	}
 		$chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
 
-		// Build our finalized string. We cycle through the array, skipping tags, and processing the contained text
+		// Build our finalized string.  We cycle through the array, skipping tags, and processing the contained text
 		$str = '';
 		$process = TRUE;
 		$paragraph = FALSE;
@@ -143,7 +143,7 @@ class CI_Typography {
 			{
 				if (preg_match("#".$this->skip_elements."#", $match[2]))
 				{
-					$process = ($match[1] == '/') ? TRUE : FALSE;
+					$process =  ($match[1] == '/') ? TRUE : FALSE;
 				}
 
 				if ($match[1] == '')
@@ -161,17 +161,17 @@ class CI_Typography {
 				continue;
 			}
 
-			// Force a newline to make sure end tags get processed by _format_newlines()
+			//  Force a newline to make sure end tags get processed by _format_newlines()
 			if ($current_chunk == $total_chunks)
 			{
 				$chunk .= "\n";
 			}
 
-			// Convert Newlines into 

and
tags + // Convert Newlines into

and
tags $str .= $this->_format_newlines($chunk); } - // No opening block level tag? Add it if needed. + // No opening block level tag? Add it if needed. if ( ! preg_match("/^\s*<(?:".$this->block_elements.")/i", $str)) { $str = preg_replace("/^(.*?)<(".$this->block_elements.")/i", '

$1

<$2', $str); @@ -204,14 +204,14 @@ class CI_Typography { '#

<('.$this->block_elements.')#' => '<$1', // Clean up stray non-breaking spaces preceeding block elements - '#( \s*)+<('.$this->block_elements.')#' => ' <$2', + '#( \s*)+<('.$this->block_elements.')#' => ' <$2', // Replace the temporary markers we added earlier '/\{@TAG\}/' => '<', '/\{@DQ\}/' => '"', '/\{@SQ\}/' => "'", '/\{@DD\}/' => '--', - '/\{@NBS\}/' => ' ', + '/\{@NBS\}/' => ' ', // An unintended consequence of the _format_newlines function is that // some of the newlines get truncated, resulting in

tags @@ -296,7 +296,7 @@ class CI_Typography { '/(\w)\.{3}/' => '$1…', // double space after sentences - '/(\W) /' => '$1  ', + '/(\W) /' => '$1  ', // ampersands, if not a character entity '/&(?!#?[a-zA-Z0-9]{2,};)/' => '&' @@ -324,7 +324,7 @@ class CI_Typography { return $str; } - if (strpos($str, "\n") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required)) + if (strpos($str, "\n") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required)) { return $str; } @@ -341,7 +341,7 @@ class CI_Typography { // We trim off the right-side new line so that the closing

tag // will be positioned immediately following the string, matching // the behavior of the opening

tag - $str = '

'.rtrim($str).'

'; + $str = '

'.rtrim($str).'

'; } // Remove empty paragraphs if they are on the first line, as this @@ -367,7 +367,7 @@ class CI_Typography { */ function _protect_characters($match) { - return str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]); + return str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]); } // -------------------------------------------------------------------- diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index c9012f646..5bd7e801a 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -1,4 +1,4 @@ -set_error('upload_stopped_by_extension'); break; - default : $this->set_error('upload_no_file_selected'); + default : $this->set_error('upload_no_file_selected'); break; } @@ -290,7 +290,7 @@ class CI_Upload { /* * Run the file through the XSS hacking filter * This helps prevent malicious code from being - * embedded within a file. Scripts can easily + * embedded within a file. Scripts can easily * be disguised as images or other file types. */ if ($this->xss_clean) @@ -305,8 +305,8 @@ class CI_Upload { /* * Move the file to the final destination * To deal with different server configurations - * we'll attempt to use copy() first. If that fails - * we'll use move_uploaded_file(). One of the two should + * we'll attempt to use copy() first. If that fails + * we'll use move_uploaded_file(). One of the two should * reliably work in most environments */ if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name)) @@ -321,7 +321,7 @@ class CI_Upload { /* * Set the finalized image dimensions * This sets the image width/height (assuming the - * file was an image). We use this information + * file was an image). We use this information * in the "data" function. */ $this->set_image_properties($this->upload_path.$this->file_name); @@ -518,7 +518,7 @@ class CI_Upload { $this->image_width = $D['0']; $this->image_height = $D['1']; $this->image_type = ( ! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']]; - $this->image_size_str = $D['3']; // string containing height and width + $this->image_size_str = $D['3']; // string containing height and width } } } @@ -551,7 +551,7 @@ class CI_Upload { // IE will sometimes return odd mime-types during upload, so here we just standardize all // jpegs or pngs to the same file type. - $png_mimes = array('image/x-png'); + $png_mimes = array('image/x-png'); $jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg'); if (in_array($this->file_type, $png_mimes)) @@ -642,7 +642,7 @@ class CI_Upload { */ public function is_allowed_filesize() { - if ($this->max_size != 0 AND $this->file_size > $this->max_size) + if ($this->max_size != 0 AND $this->file_size > $this->max_size) { return FALSE; } @@ -721,7 +721,7 @@ class CI_Upload { return FALSE; } - $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); + $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); return TRUE; } @@ -834,7 +834,7 @@ class CI_Upload { $current = ini_get('memory_limit') * 1024 * 1024; // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output - // into scientific notation. number_format() ensures this number is an integer + // into scientific notation. number_format() ensures this number is an integer // http://bugs.php.net/bug.php?id=43053 $new_memory = number_format(ceil(filesize($file) + $current), 0, '.', ''); @@ -844,8 +844,8 @@ class CI_Upload { // If the file being uploaded is an image, then we should have no problem with XSS attacks (in theory), but // IE can be fooled into mime-type detecting a malformed image as an html file, thus executing an XSS attack on anyone - // using IE who looks at the image. It does this by inspecting the first 255 bytes of an image. To get around this - // CI will itself look at the first 255 bytes of an image to determine its relative safety. This can save a lot of + // using IE who looks at the image. It does this by inspecting the first 255 bytes of an image. To get around this + // CI will itself look at the first 255 bytes of an image to determine its relative safety. This can save a lot of // processor power and time if it is actually a clean image, as it will be in nearly all instances _except_ an // attempted XSS attack. @@ -933,7 +933,7 @@ class CI_Upload { /** * List of Mime Types * - * This is a list of mime types. We use it to validate + * This is a list of mime types. We use it to validate * the "allowed types" set by the developer * * @param string diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 543d1d5a3..016102a2a 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -1,4 +1,4 @@ -xmlrpcerr['unknown_method'] = '1'; $this->xmlrpcstr['unknown_method'] = 'This is not a known method for this XML-RPC Server'; $this->xmlrpcerr['invalid_return'] = '2'; - $this->xmlrpcstr['invalid_return'] = 'The XML data received was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; + $this->xmlrpcstr['invalid_return'] = 'The XML data received was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; $this->xmlrpcerr['incorrect_params'] = '3'; $this->xmlrpcstr['incorrect_params'] = 'Incorrect parameters were passed to method'; $this->xmlrpcerr['introspect_unknown'] = '4'; @@ -129,7 +129,7 @@ class CI_Xmlrpc { //------------------------------------- - // Initialize Prefs + // Initialize Prefs //------------------------------------- function initialize($config = array()) @@ -148,7 +148,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Take URL and parse it + // Take URL and parse it //------------------------------------- function server($url, $port=80) @@ -172,7 +172,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Set Timeout + // Set Timeout //------------------------------------- function timeout($seconds=5) @@ -185,7 +185,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Set Methods + // Set Methods //------------------------------------- function method($function) @@ -195,7 +195,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Take Array of Data and Create Objects + // Take Array of Data and Create Objects //------------------------------------- function request($incoming) @@ -216,7 +216,7 @@ class CI_Xmlrpc { //------------------------------------- - // Set Debug + // Set Debug //------------------------------------- function set_debug($flag = TRUE) @@ -225,7 +225,7 @@ class CI_Xmlrpc { } //------------------------------------- - // Values Parsing + // Values Parsing //------------------------------------- function values_parsing($value, $return = FALSE) @@ -268,7 +268,7 @@ class CI_Xmlrpc { //------------------------------------- - // Sends XML-RPC Request + // Sends XML-RPC Request //------------------------------------- function send_request() @@ -294,7 +294,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Returns Error + // Returns Error //------------------------------------- function display_error() @@ -304,7 +304,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Returns Remote Server Response + // Returns Remote Server Response //------------------------------------- function display_response() @@ -314,7 +314,7 @@ class CI_Xmlrpc { // END //------------------------------------- - // Sends an Error Message for Server Request + // Sends an Error Message for Server Request //------------------------------------- function send_error_message($number, $message) @@ -325,7 +325,7 @@ class CI_Xmlrpc { //------------------------------------- - // Send Response for Server Request + // Send Response for Server Request //------------------------------------- function send_response($response) @@ -399,7 +399,7 @@ class XML_RPC_Client extends CI_Xmlrpc } $r = "\r\n"; - $op = "POST {$this->path} HTTP/1.0$r"; + $op = "POST {$this->path} HTTP/1.0$r"; $op .= "Host: {$this->server}$r"; $op .= "Content-Type: text/xml$r"; $op .= "User-Agent: {$this->xmlrpcName}$r"; @@ -447,7 +447,7 @@ class XML_RPC_Response else if ( ! is_object($val)) { // programmer error, not an object - error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); + error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); $this->val = new XML_RPC_Values(); } else @@ -504,7 +504,7 @@ class XML_RPC_Response function decode($array=FALSE) { $CI =& get_instance(); - + if ($array !== FALSE && is_array($array)) { while (list($key) = each($array)) @@ -541,7 +541,7 @@ class XML_RPC_Response //------------------------------------- - // XML-RPC Object to PHP Types + // XML-RPC Object to PHP Types //------------------------------------- function xmlrpc_decoder($xmlrpc_val) @@ -581,7 +581,7 @@ class XML_RPC_Response //------------------------------------- - // ISO-8601 time to server or UTC time + // ISO-8601 time to server or UTC time //------------------------------------- function iso8601_decode($time, $utc=0) @@ -630,7 +630,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // Create Payload to Send + // Create Payload to Send //------------------------------------- function createPayload() @@ -650,7 +650,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // Parse External XML-RPC Server's Response + // Parse External XML-RPC Server's Response //------------------------------------- function parseResponse($fp) @@ -663,7 +663,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // DISPLAY HTTP CONTENT for DEBUGGING + // DISPLAY HTTP CONTENT for DEBUGGING //------------------------------------- if ($this->debug === TRUE) @@ -674,7 +674,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // Check for data + // Check for data //------------------------------------- if ($data == "") @@ -686,7 +686,7 @@ class XML_RPC_Message extends CI_Xmlrpc //------------------------------------- - // Check for HTTP 200 Response + // Check for HTTP 200 Response //------------------------------------- if (strncmp($data, 'HTTP', 4) == 0 && ! preg_match('/^HTTP\/[0-9\.]+ 200 /', $data)) @@ -697,7 +697,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // Create and Set Up XML Parser + // Create and Set Up XML Parser //------------------------------------- $parser = xml_parser_create($this->xmlrpc_defencoding); @@ -718,7 +718,7 @@ class XML_RPC_Message extends CI_Xmlrpc //------------------------------------- - // GET HEADERS + // GET HEADERS //------------------------------------- $lines = explode("\r\n", $data); @@ -734,7 +734,7 @@ class XML_RPC_Message extends CI_Xmlrpc //------------------------------------- - // PARSE XML DATA + // PARSE XML DATA //------------------------------------- if ( ! xml_parse($parser, $data, count($data))) @@ -750,7 +750,7 @@ class XML_RPC_Message extends CI_Xmlrpc xml_parser_free($parser); // --------------------------------------- - // Got Ourselves Some Badness, It Seems + // Got Ourselves Some Badness, It Seems // --------------------------------------- if ($this->xh[$parser]['isf'] > 1) @@ -772,7 +772,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // DISPLAY XML CONTENT for DEBUGGING + // DISPLAY XML CONTENT for DEBUGGING //------------------------------------- if ($this->debug === TRUE) @@ -797,7 +797,7 @@ class XML_RPC_Message extends CI_Xmlrpc } //------------------------------------- - // SEND RESPONSE + // SEND RESPONSE //------------------------------------- $v = $this->xh[$parser]['value']; @@ -826,21 +826,21 @@ class XML_RPC_Message extends CI_Xmlrpc } // ------------------------------------ - // Begin Return Message Parsing section + // Begin Return Message Parsing section // ------------------------------------ // quick explanation of components: - // ac - used to accumulate values - // isf - used to indicate a fault - // lv - used to indicate "looking for a value": implements + // ac - used to accumulate values + // isf - used to indicate a fault + // lv - used to indicate "looking for a value": implements // the logic to allow values with no types to be strings - // params - used to store parameters in method calls - // method - used to store method name + // params - used to store parameters in method calls + // method - used to store method name // stack - array with parent tree of the xml element, // used to validate the nesting of elements //------------------------------------- - // Start Element Handler + // Start Element Handler //------------------------------------- function open_tag($the_parser, $name, $attrs) @@ -942,7 +942,7 @@ class XML_RPC_Message extends CI_Xmlrpc //------------------------------------- - // End Element Handler + // End Element Handler //------------------------------------- function closing_tag($the_parser, $name) @@ -951,7 +951,7 @@ class XML_RPC_Message extends CI_Xmlrpc // Remove current element from stack and set variable // NOTE: If the XML validates, then we do not have to worry about - // the opening and closing of elements. Nesting is checked on the opening + // the opening and closing of elements. Nesting is checked on the opening // tag so we be safe there as well. $curr_elem = array_shift($this->xh[$the_parser]['stack']); @@ -1080,13 +1080,13 @@ class XML_RPC_Message extends CI_Xmlrpc // We're all good kids with nuthin' to do break; default: - // End of an Invalid Element. Taken care of during the opening tag though + // End of an Invalid Element. Taken care of during the opening tag though break; } } //------------------------------------- - // Parses Character Data + // Parses Character Data //------------------------------------- function character_data($the_parser, $data) @@ -1116,7 +1116,7 @@ class XML_RPC_Message extends CI_Xmlrpc function output_parameters($array=FALSE) { $CI =& get_instance(); - + if ($array !== FALSE && is_array($array)) { while (list($key) = each($array)) diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 88af60693..9cd332147 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -1,4 +1,4 @@ -parseRequest(); - $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; + $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; $payload .= $this->debug_msg; $payload .= $r->prepare_response(); @@ -156,7 +156,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc function add_to_map($methodname, $function, $sig, $doc) { $this->methods[$methodname] = array( - 'function' => $function, + 'function' => $function, 'signature' => $sig, 'docstring' => $doc ); @@ -176,7 +176,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc global $HTTP_RAW_POST_DATA; //------------------------------------- - // Get Data + // Get Data //------------------------------------- if ($data == '') @@ -185,7 +185,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Set up XML Parser + // Set up XML Parser //------------------------------------- $parser = xml_parser_create($this->xmlrpc_defencoding); @@ -207,7 +207,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc //------------------------------------- - // PARSE + PROCESS XML DATA + // PARSE + PROCESS XML DATA //------------------------------------- if ( ! xml_parse($parser, $data, 1)) @@ -235,7 +235,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc { if ($this->debug === TRUE) { - $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; + $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; } $m->addParam($parser_object->xh[$parser]['params'][$i]); @@ -252,7 +252,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // SET DEBUGGING MESSAGE + // SET DEBUGGING MESSAGE //------------------------------------- if ($this->debug === TRUE) @@ -285,7 +285,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Valid Method + // Valid Method //------------------------------------- if ( ! isset($this->methods[$methName]['function'])) @@ -294,7 +294,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Check for Method (and Object) + // Check for Method (and Object) //------------------------------------- $method_parts = explode(".", $this->methods[$methName]['function']); @@ -320,7 +320,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Checking Methods Signature + // Checking Methods Signature //------------------------------------- if (isset($this->methods[$methName]['signature'])) @@ -353,7 +353,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc } //------------------------------------- - // Calls the Function + // Calls the Function //------------------------------------- if ($objectCall === TRUE) @@ -381,11 +381,11 @@ 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 @@ -409,11 +409,11 @@ 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 @@ -458,7 +458,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Server Function: Doc String for Method + * Server Function: Doc String for Method * * @access public * @param mixed @@ -480,11 +480,11 @@ 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 @@ -528,7 +528,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Multi-call Function: Error Handling + * Multi-call Function: Error Handling * * @access public * @param mixed @@ -536,7 +536,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc */ function multicall_error($err) { - $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); + $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); $struct['faultCode'] = new XML_RPC_Values($code, 'int'); @@ -548,7 +548,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc // -------------------------------------------------------------------- /** - * Multi-call Function: Processes method + * Multi-call Function: Processes method * * @access public * @param mixed diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 1ae3e7f25..666327d5c 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -1,4 +1,4 @@ -CI =& get_instance(); + $this->CI =& get_instance(); extract($params); if ($autoload === TRUE) { - $this->script(); + $this->script(); } - + log_message('debug', "Jquery Class Initialized"); } - - // -------------------------------------------------------------------- + + // -------------------------------------------------------------------- // Event Code - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- /** * Blur @@ -65,9 +65,9 @@ class CI_Jquery extends CI_Javascript { { return $this->_add_event($element, $js, 'blur'); } - + // -------------------------------------------------------------------- - + /** * Change * @@ -82,9 +82,9 @@ class CI_Jquery extends CI_Javascript { { return $this->_add_event($element, $js, 'change'); } - + // -------------------------------------------------------------------- - + /** * Click * @@ -112,7 +112,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Double Click * @@ -129,7 +129,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Error * @@ -146,7 +146,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Focus * @@ -163,7 +163,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Hover * @@ -185,7 +185,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Keydown * @@ -202,7 +202,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Keyup * @@ -216,10 +216,10 @@ class CI_Jquery extends CI_Javascript { function _keyup($element = 'this', $js = '') { return $this->_add_event($element, $js, 'keyup'); - } + } // -------------------------------------------------------------------- - + /** * Load * @@ -233,10 +233,10 @@ class CI_Jquery extends CI_Javascript { function _load($element = 'this', $js = '') { return $this->_add_event($element, $js, 'load'); - } - + } + // -------------------------------------------------------------------- - + /** * Mousedown * @@ -253,7 +253,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Mouse Out * @@ -270,7 +270,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Mouse Over * @@ -321,7 +321,7 @@ class CI_Jquery extends CI_Javascript { { $array_js = array($array_js); } - + foreach ($array_js as $js) { $this->jquery_code_for_compile[] = "\t$js\n"; @@ -361,7 +361,7 @@ class CI_Jquery extends CI_Javascript { { return $this->_add_event($element, $js, 'scroll'); } - + // -------------------------------------------------------------------- /** @@ -379,10 +379,10 @@ class CI_Jquery extends CI_Javascript { return $this->_add_event($element, $js, 'unload'); } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- // Effects - // -------------------------------------------------------------------- - + // -------------------------------------------------------------------- + /** * Add Class * @@ -395,7 +395,7 @@ class CI_Jquery extends CI_Javascript { function _addClass($element = 'this', $class='') { $element = $this->_prep_element($element); - $str = "$({$element}).addClass(\"$class\");"; + $str = "$({$element}).addClass(\"$class\");"; return $str; } @@ -416,9 +416,9 @@ class CI_Jquery extends CI_Javascript { { $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + $animations = "\t\t\t"; - + foreach ($params as $param=>$value) { $animations .= $param.': \''.$value.'\', '; @@ -430,19 +430,19 @@ class CI_Jquery extends CI_Javascript { { $speed = ', '.$speed; } - + if ($extra != '') { $extra = ', '.$extra; } - - $str = "$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; - + + $str = "$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; + return $str; } // -------------------------------------------------------------------- - + /** * Fade In * @@ -456,21 +456,21 @@ class CI_Jquery extends CI_Javascript { */ function _fadeIn($element = 'this', $speed = '', $callback = '') { - $element = $this->_prep_element($element); + $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).fadeIn({$speed}{$callback});"; - + + $str = "$({$element}).fadeIn({$speed}{$callback});"; + return $str; } - + // -------------------------------------------------------------------- - + /** * Fade Out * @@ -486,14 +486,14 @@ class CI_Jquery extends CI_Javascript { { $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).fadeOut({$speed}{$callback});"; - + + $str = "$({$element}).fadeOut({$speed}{$callback});"; + return $str; } @@ -512,19 +512,19 @@ class CI_Jquery extends CI_Javascript { */ function _hide($element = 'this', $speed = '', $callback = '') { - $element = $this->_prep_element($element); + $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).hide({$speed}{$callback});"; + + $str = "$({$element}).hide({$speed}{$callback});"; return $str; } - + // -------------------------------------------------------------------- /** @@ -539,12 +539,12 @@ class CI_Jquery extends CI_Javascript { function _removeClass($element = 'this', $class='') { $element = $this->_prep_element($element); - $str = "$({$element}).removeClass(\"$class\");"; + $str = "$({$element}).removeClass(\"$class\");"; return $str; } // -------------------------------------------------------------------- - + /** * Slide Up * @@ -558,21 +558,21 @@ class CI_Jquery extends CI_Javascript { */ function _slideUp($element = 'this', $speed = '', $callback = '') { - $element = $this->_prep_element($element); + $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).slideUp({$speed}{$callback});"; - + + $str = "$({$element}).slideUp({$speed}{$callback});"; + return $str; } - + // -------------------------------------------------------------------- - + /** * Slide Down * @@ -588,19 +588,19 @@ class CI_Jquery extends CI_Javascript { { $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).slideDown({$speed}{$callback});"; - + + $str = "$({$element}).slideDown({$speed}{$callback});"; + return $str; } // -------------------------------------------------------------------- - + /** * Slide Toggle * @@ -616,19 +616,19 @@ class CI_Jquery extends CI_Javascript { { $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).slideToggle({$speed}{$callback});"; - + + $str = "$({$element}).slideToggle({$speed}{$callback});"; + return $str; } - + // -------------------------------------------------------------------- - + /** * Toggle * @@ -641,12 +641,12 @@ class CI_Jquery extends CI_Javascript { function _toggle($element = 'this') { $element = $this->_prep_element($element); - $str = "$({$element}).toggle();"; + $str = "$({$element}).toggle();"; return $str; } - + // -------------------------------------------------------------------- - + /** * Toggle Class * @@ -659,12 +659,12 @@ class CI_Jquery extends CI_Javascript { function _toggleClass($element = 'this', $class='') { $element = $this->_prep_element($element); - $str = "$({$element}).toggleClass(\"$class\");"; + $str = "$({$element}).toggleClass(\"$class\");"; return $str; } - + // -------------------------------------------------------------------- - + /** * Show * @@ -678,16 +678,16 @@ class CI_Jquery extends CI_Javascript { */ function _show($element = 'this', $speed = '', $callback = '') { - $element = $this->_prep_element($element); + $element = $this->_prep_element($element); $speed = $this->_validate_speed($speed); - + if ($callback != '') { $callback = ", function(){\n{$callback}\n}"; } - - $str = "$({$element}).show({$speed}{$callback});"; - + + $str = "$({$element}).show({$speed}{$callback});"; + return $str; } @@ -696,7 +696,7 @@ class CI_Jquery extends CI_Javascript { /** * Updater * - * An Ajax call that populates the designated DOM node with + * An Ajax call that populates the designated DOM node with * returned content * * @access private @@ -705,13 +705,13 @@ class CI_Jquery extends CI_Javascript { * @param string optional parameters * @return string */ - + function _updater($container = 'this', $controller, $options = '') - { + { $container = $this->_prep_element($container); - + $controller = (strpos('://', $controller) === FALSE) ? $controller : $this->CI->config->site_url($controller); - + // ajaxStart and ajaxStop are better choices here... but this is a stop gap if ($this->CI->config->item('javascript_ajax_img') == '') { @@ -721,7 +721,7 @@ class CI_Jquery extends CI_Javascript { { $loading_notifier = 'CI->config->slash_item('base_url') . $this->CI->config->item('javascript_ajax_img') . '\' alt=\'Loading\' />'; } - + $updater = "$($container).empty();\n"; // anything that was in... get it out $updater .= "\t\t$($container).prepend(\"$loading_notifier\");\n"; // to replace with an image @@ -741,7 +741,7 @@ class CI_Jquery extends CI_Javascript { // -------------------------------------------------------------------- // Pre-written handy stuff // -------------------------------------------------------------------- - + /** * Zebra tables * @@ -753,8 +753,8 @@ class CI_Jquery extends CI_Javascript { function _zebraTables($class = '', $odd = 'odd', $hover = '') { $class = ($class != '') ? '.'.$class : ''; - - $zebra = "\t\$(\"table{$class} tbody tr:nth-child(even)\").addClass(\"{$odd}\");"; + + $zebra = "\t\$(\"table{$class} tbody tr:nth-child(even)\").addClass(\"{$odd}\");"; $this->jquery_code_for_compile[] = $zebra; @@ -771,7 +771,7 @@ class CI_Jquery extends CI_Javascript { // -------------------------------------------------------------------- // Plugins // -------------------------------------------------------------------- - + /** * Corner Plugin * @@ -793,7 +793,7 @@ class CI_Jquery extends CI_Javascript { return "$(" . $this->_prep_element($element) . ").corner(".$corner_style.");"; } - + // -------------------------------------------------------------------- /** @@ -805,7 +805,7 @@ class CI_Jquery extends CI_Javascript { * @return void */ function modal($src, $relative = FALSE) - { + { $this->jquery_code_for_load[] = $this->external($src, $relative); } @@ -897,7 +897,7 @@ class CI_Jquery extends CI_Javascript { { $this->jquery_code_for_compile[] = "\t$(" . $this->_prep_element($table) . ").tablesorter($options);\n"; } - + // -------------------------------------------------------------------- // Class functions // -------------------------------------------------------------------- @@ -912,7 +912,7 @@ class CI_Jquery extends CI_Javascript { * @param string The code to execute * @param string The event to pass * @return string - */ + */ function _add_event($element, $js, $event) { if (is_array($js)) @@ -953,15 +953,15 @@ class CI_Jquery extends CI_Javascript { $script = '$(document).ready(function() {' . "\n"; $script .= implode('', $this->jquery_code_for_compile); $script .= '});'; - + $output = ($script_tags === FALSE) ? $script : $this->inline($script); $this->CI->load->vars(array($view_var => $output)); } - + // -------------------------------------------------------------------- - + /** * Clear Compile * @@ -976,7 +976,7 @@ class CI_Jquery extends CI_Javascript { } // -------------------------------------------------------------------- - + /** * Document Ready * @@ -992,7 +992,7 @@ class CI_Jquery extends CI_Javascript { $js = array ($js); } - + foreach ($js as $script) { $this->jquery_code_for_compile[] = $script; @@ -1016,7 +1016,7 @@ class CI_Jquery extends CI_Javascript { $this->jquery_code_for_load[] = $library_src; return $library_src; } - + // -------------------------------------------------------------------- /** @@ -1036,10 +1036,10 @@ class CI_Jquery extends CI_Javascript { { $element = '"'.$element.'"'; } - + return $element; } - + // -------------------------------------------------------------------- /** @@ -1050,7 +1050,7 @@ class CI_Jquery extends CI_Javascript { * @access private * @param string * @return string - */ + */ function _validate_speed($speed) { if (in_array($speed, array('slow', 'normal', 'fast'))) @@ -1061,7 +1061,7 @@ class CI_Jquery extends CI_Javascript { { $speed = ''; } - + return $speed; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8469a599e..76f9e5dd9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,14 +65,14 @@ Change Log
  • Security
      -
    • An improvement was made to the MySQL and MySQLi drivers to prevent exposing a potential vector for SQL injection on sites using multi-byte character sets in the database client connection.

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

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

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

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

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

  • General Changes
    • Fixed a bug where there was a misspelling within a code comment in the index.php file.
    • -
    • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
    • +
    • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
    • Removed internal usage of the EXT constant.
    • -
    • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
    • +
    • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
  • Helpers @@ -149,7 +149,7 @@ Hg Tag: v2.0.1

  • 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.
  • Added an ENVIRONMENT constant in index.php, which affects PHP error reporting settings, and optionally, - which configuration files are loaded (see below). Read more on the Handling Environments page.
  • + which configuration files are loaded (see below). Read more on the Handling Environments page.
  • Added support for environment-specific configuration files.
@@ -186,15 +186,15 @@ Hg Tag: v2.0.0

  • PHP 4 support is removed. CodeIgniter now requires PHP 5.1.6.
  • 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.
  • +
  • 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.
  • +
  • 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.
  • -
  • Added the ability to set config values (or override config values) directly from data set in the main index.php file. This allows a single application to be used with multiple front controllers, each having its own config values.
  • +
  • Added the ability to set config values (or override config values) directly from data set in the main index.php file. This allows a single application to be used with multiple front controllers, each having its own config values.
  • Added $config['directory_trigger'] to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.
  • -
  • Added ability to set "Package" paths - specific paths where the Loader and Config classes should try to look first for a requested file. This allows distribution of sub-applications with their own libraries, models, config files, etc. in a single "package" directory. See the Loader class documentation for more details.
  • +
  • Added ability to set "Package" paths - specific paths where the Loader and Config classes should try to look first for a requested file. This allows distribution of sub-applications with their own libraries, models, config files, etc. in a single "package" directory. See the Loader class documentation for more details.
  • In-development code is now hosted at BitBucket.
  • Removed the deprecated Validation Class.
  • Added CI_ Prefix to all core classes.
  • @@ -261,7 +261,7 @@ Hg Tag: v2.0.0

  • Added convert_accented_characters() function to text helper.
  • Added accept-charset to the list of inserted attributes of form_open() in the Form Helper.
  • Deprecated the dohash() function in favour of do_hash() for naming consistency.
  • -
  • Non-backwards compatible change made to get_dir_file_info() in the File Helper. No longer recurses +
  • Non-backwards compatible change made to get_dir_file_info() in the File Helper. No longer recurses by default so as to encourage responsible use (this function can cause server performance issues when used without caution).
  • Modified the second parameter of directory_map() in the Directory Helper to accept an integer to specify recursion depth.
  • Modified delete_files() in the File Helper to return FALSE on failure.
  • @@ -280,7 +280,7 @@ Hg Tag: v2.0.0

  • Other Changes
    • Added an optional second parameter to show_404() to disable logging.
    • -
    • Updated loader to automatically apply the sub-class prefix as an option when loading classes. Class names can be prefixed with the standard "CI_" or the same prefix as the subclass prefix, or no prefix at all.
    • +
    • Updated loader to automatically apply the sub-class prefix as an option when loading classes. Class names can be prefixed with the standard "CI_" or the same prefix as the subclass prefix, or no prefix at all.
    • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
    • Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE where files and not directories are being operated on.
    • get_mime_by_extension() is now case insensitive.
    • @@ -490,15 +490,15 @@ Hg Tag: 1.7.0

      • Libraries
          -
        • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
        • +
        • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
        • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
        • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
        • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
        • Added controller class/method info to Profiler class and support for multiple database connections.
        • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
        • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
        • -
        • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
        • -
        • Added max_filename option to set a file name length limit in the File Upload Class.
        • +
        • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
        • +
        • Added max_filename option to set a file name length limit in the File Upload Class.
        • Added set_status_header() function to Output class.
        • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
        • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
        • @@ -506,8 +506,8 @@ Hg Tag: 1.7.0

        • Database
            -
          • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
          • -
          • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
          • +
          • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
          • +
          • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
          • Added Active Record caching feature to "update" and "delete" functions.
          • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
          • Added port support to MySQL, MySQLi, and MS SQL database drivers.
          • @@ -516,10 +516,10 @@ Hg Tag: 1.7.0

          • Helpers
              -
            • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
            • -
            • Added current_url() and uri_segments() to URL helper.
            • +
            • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
            • +
            • Added current_url() and uri_segments() to URL helper.
            • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
            • -
            • Added meta() function to HTML helper.
            • +
            • Added meta() function to HTML helper.
            • Improved accuracy of calculations in Number helper.
            • Removed added newlines ("\n") from most form and html helper functions.
            • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
            • @@ -561,10 +561,10 @@ Hg Tag: 1.7.0

            • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
            • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
            • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
            • -
            • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
            • +
            • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
            • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
            • -
            • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
            • -
            • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
            • +
            • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
            • +
            • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
            • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
            • Fixed DB backup bug in which field names were not being escaped.
            • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
            • @@ -805,8 +805,8 @@ Hg Tag: 1.6.1

              • Added protect_identifiers() in Active Record.
              • All AR queries are backticked if appropriate to the database.
              • -
              • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
              • -
              • Added support for limit() into update() and delete() statements in Active Record.
              • +
              • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
              • +
              • Added support for limit() into update() and delete() statements in Active Record.
              • Added empty_table() and truncate_table() to Active Record.
              • Added the ability to pass an array of tables to the delete() statement in Active Record.
              • Added count_all_results() function to Active Record.
              • @@ -825,7 +825,7 @@ Hg Tag: 1.6.1

              • Added $this->db->dbprefix() to manually add database prefixes.
              • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
              • Added a check for NULL fields in the MySQL database backup utility.
              • -
              • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
              • +
              • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
              • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
              • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
              • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
              • @@ -944,7 +944,7 @@ Hg Tag: 1.6.1

              • Fixed a bug in Validation where valid_ip() wasn't called properly.
              • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
              • Fixed a bug in captcha calling an invalid PHP function.
              • -
              • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
              • +
              • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
              • Fixed a bug that was making validation callbacks required even when not set as such.
              • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
              • Fixed an example of comma-separated emails in the email library documentation.
              • @@ -956,7 +956,7 @@ Hg Tag: 1.6.1

              • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
              • Fixed a typo in the String Helper (uniquid changed to uniqid).
              • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
              • -
              • Added a stripslashes() into the Upload Library.
              • +
              • Added a stripslashes() into the Upload Library.
              • Fixed a series of grammatical and spelling errors in the language files.
              • Fixed assorted user guide typos.
              @@ -968,10 +968,10 @@ Hg Tag: 1.6.1

            • Added array to string into the profiler.
            • Added some additional mime types in application/config/mimes.php.
            • Added filename_security() method to Input library.
            • -
            • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
            • -
            • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
            • +
            • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
            • +
            • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
            • Fixed MSSQL insert_id().
            • -
            • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
            • +
            • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
            • Fixed a bug that was allowing multiple load attempts on extended classes.
            • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
            • Fixed a bug in the escape_str() function in the MySQL driver.
            • @@ -987,7 +987,7 @@ Hg Tag: 1.6.1

            • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
            • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
            • Fixed various doc typos.
            • -
            • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
            • +
            • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
            • Docs now validate to XHTML 1 transitional
            • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
            • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
            • @@ -995,7 +995,7 @@ Hg Tag: 1.6.1

            • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
            • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
            • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
            • -
            • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
            • +
            • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
            • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

            Version 1.5.3

            @@ -1021,7 +1021,7 @@ Hg Tag: 1.6.1

          • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
          • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
          • Removed unescaped variables in error messages of Input and Router classes
          • -
          • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
          • +
          • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
          • Fixed a bug in the form helper that gave textarea a value attribute
          • Fixed a bug in the Image Library that was ignoring resizing the same size image
          • Fixed some doc typos.
          • @@ -1074,10 +1074,10 @@ Hg Tag: 1.6.1

          • Added $query->free_result() to database class.
          • Added $query->list_fields() function to database class
          • Added $this->db->platform() function
          • -
          • Added new File Helper: get_filenames()
          • -
          • Added new helper: Smiley Helper
          • -
          • Added support for <ul> and <ol> lists in the HTML Helper
          • -
          • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
          • +
          • Added new File Helper: get_filenames()
          • +
          • Added new helper: Smiley Helper
          • +
          • Added support for <ul> and <ol> lists in the HTML Helper
          • +
          • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
          • Added the ability to rename or relocate the "application" folder.
          • Added more thorough initialization in the upload class so that all class variables are reset.
          • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
          • @@ -1085,7 +1085,7 @@ Hg Tag: 1.6.1

          • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
          • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
          • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
          • -
          • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
          • +
          • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
          • Fixed a bug in the Email class related to SMTP Helo data.
          • Fixed a bug in the word wrapping helper and function in the email class.
          • Fixed a bug in the validation class.
          • @@ -1096,9 +1096,9 @@ Hg Tag: 1.6.1

          • Fixed a pagination bug that was permitting negative values in the URL.
          • Fixed an oversight in which the Loader class was not allowed to be extended.
          • Changed _get_config() to get_config() since the function is not a private one.
          • -
          • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
          • -
          • Deprecated $this->db->field_names() USE $this->db->list_fields()
          • -
          • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
          • +
          • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
          • +
          • Deprecated $this->db->field_names() USE $this->db->list_fields()
          • +
          • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
          @@ -1109,10 +1109,10 @@ Hg Tag: 1.6.1

          • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
          • -
          • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
          • +
          • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
          • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
          • Added $this->output->set_header() function, which allows you to set server headers.
          • -
          • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
          • +
          • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
          • Added Inflector helper.
          • Added element() function in the array helper.
          • Added RAND() to active record orderby() function.
          • @@ -1128,8 +1128,8 @@ Hg Tag: 1.6.1

          • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
          • Added some code to allow email attachments to be reset when sending batches of email.
          • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own -libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
          • -
          • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
          • +libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore. +
          • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
          • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
          @@ -1140,7 +1140,7 @@ Hg Tag: 1.6.1

          • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
          • -
          • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
          • +
          • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
          • Added regular expressions support for routing rules.
          • Added the ability to remap function calls within your controllers.
          • Added the ability to replace core system classes with your own classes.
          • @@ -1155,7 +1155,7 @@ Hg Tag: 1.6.1

          • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
          • Updated the form_open() helper to allow the GET method to be used.
          • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
          • -
          • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
          • +
          • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
          • Updated the Models loader function to allow multiple loads of the same model.
          • Updated the MS SQL driver so that single quotes are escaped.
          • Updated the Postgres and ODBC drivers for better compatibility.
          • @@ -1163,7 +1163,7 @@ Hg Tag: 1.6.1

          • Removed some references that were interfering with PHP 4.4.1 compatibility.
          • Removed backticks from Postgres class since these are not needed.
          • Renamed display() to _display() in the Output class to make it clear that it's a private function.
          • -
          • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
          • +
          • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
          • Fixed an bug that was preventing the input class from unsetting GET variables.
          • Fixed a router bug that was making it too greedy when matching end segments.
          • Fixed a bug that was preventing multiple discrete database calls.
          • @@ -1197,11 +1197,11 @@ Hg Tag: 1.6.1

            • Models do not connect automatically to the database as of this version. More info here.
            • -
            • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
            • +
            • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
            • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
            • Fixed a bug in the active record "having" function.
            • Fixed a problem in the validation class which was making checkboxes be ignored when required.
            • -
            • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
            • +
            • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
            • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
            • Fixed a validation bug that was preventing rules from being set twice in one controller.
            • Fixed a calendar bug that was not letting it use dynamically loaded languages.
            • @@ -1219,7 +1219,7 @@ Hg Tag: 1.6.1

              • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
              • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
              • -
              • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
              • +
              • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
              • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
              • Fixed a couple bugs in the Model class.
              • Fixed some documentation typos and errata.
              • @@ -1232,8 +1232,8 @@ Hg Tag: 1.6.1

                • Added a Unit Testing Library.
                • -
                • Added the ability to pass objects to the insert() and update() database functions. -This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
                • +
                • Added the ability to pass objects to the insert() and update() database functions. +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
                • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
                • Added getwhere function to Active Record class.
                • Added count_all function to Active Record class.
                • @@ -1257,10 +1257,10 @@ This feature enables you to (among other things) use your Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
                • Added a feature to the database class that lets you run custom function calls.
                • -
                • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
                • +
                • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
                • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
                • -
                • Added support for running standard query string URLs. These can be optionally enabled in your config file.
                • -
                • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
                • +
                • Added support for running standard query string URLs. These can be optionally enabled in your config file.
                • +
                • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
                • Added a new error template for use with native PHP errors.
                • Added "alternator" function in the string helpers.
                • Removed slashing from the input class. After much debate we decided to kill this feature.
                • @@ -1271,7 +1271,7 @@ all controller methods are prefixed with _ci to avoid controller coll
                • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
                • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
                • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
                • -
                • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
                • +
                • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
                • Fixed some typos in the default calendar template
                • Fixed some typos in the user guide
                @@ -1289,12 +1289,12 @@ all controller methods are prefixed with _ci to avoid controller coll
                • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
                • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
                • -
                • Added new File Helper: delete_files()
                • -
                • Added new URL Helpers: base_url(), index_page()
                • +
                • Added new File Helper: delete_files()
                • +
                • Added new URL Helpers: base_url(), index_page()
                • Added the ability to create your own core libraries and store them in your local application directory.
                • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
                • Added Javascript Calendar plugin.
                • -
                • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
                • +
                • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
                • Updated the parser class so that it allows tag pars within other tag pairs.
                • Fixed a bug in the DB "where" function.
                • Fixed a bug that was preventing custom config files to be auto-loaded.
                • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 566b260c9..62833813c 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -59,12 +59,12 @@ Active Record

                  CodeIgniter uses a modified version of the Active Record Database Pattern. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. In some cases only one or two lines of code are necessary to perform a database action. -CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

                  +CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

                  Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax -is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

                  +is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

                  -

                  Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

                  +

                  Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

                  • Selecting Data
                  • @@ -84,7 +84,7 @@ is generated by each database adapter. It also allows for safer queries, since t

                    $this->db->get();

                    -

                    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

                    +

                    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

                    $query = $this->db->get('mytable');

                    @@ -126,7 +126,7 @@ $this->db->select('title, content, date');
                    $query = $this->db->get('mytable');

                    // Produces: SELECT title, content, date FROM mytable

                    -

                    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

                    +

                    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

                    $this->db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. This is useful if you need a compound select statement.

                    $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE);
                    @@ -278,7 +278,7 @@ $this->db->or_where('id >', $id);

                    $this->db->where_in();

                    -

                    Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate

                    +

                    Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate

                    $names = array('Frank', 'Todd', 'James');
                    $this->db->where_in('username', $names);
                    @@ -322,7 +322,7 @@ $this->db->or_where('id >', $id); $this->db->like('title', 'match');
                    $this->db->like('body', 'match');

                    - // WHERE title LIKE '%match%' AND body LIKE '%match%
                    + // WHERE title LIKE '%match%' AND body LIKE '%match%
                    If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default). $this->db->like('title', 'match', 'before');
                    @@ -340,7 +340,7 @@ $this->db->or_where('id >', $id); $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

                    $this->db->like($array); -

                    // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'
                    +

                    // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'
                    @@ -351,7 +351,7 @@ $this->db->or_where('id >', $id); $this->db->like('title', 'match');
                    $this->db->or_like('body', $match);
                    -
                    // WHERE title LIKE '%match%' OR body LIKE '%match%' +
                    // WHERE title LIKE '%match%' OR body LIKE '%match%' @@ -367,7 +367,7 @@ $this->db->or_like('body', $match); $this->db->like('title', 'match');
                    $this->db->or_not_like('body', 'match');

                    -// WHERE title LIKE '%match% OR body NOT LIKE '%match%'
                    +// WHERE title LIKE '%match% OR body NOT LIKE '%match%'

                    $this->db->group_by();

                    Permits you to write the GROUP BY portion of your query:

                    @@ -385,7 +385,7 @@ $this->db->or_not_like('body', 'match');

                    $this->db->distinct();

                    -

                    Adds the "DISTINCT" keyword to a query

                    +

                    Adds the "DISTINCT" keyword to a query

                    $this->db->distinct();
                    $this->db->get('table');

                    @@ -397,7 +397,7 @@ $this->db->or_not_like('body', 'match');

                    // Produces: HAVING user_id = 45

                    -$this->db->having('user_id', 45);
                    +$this->db->having('user_id', 45);
                    // Produces: HAVING user_id = 45

                    @@ -409,16 +409,16 @@ $this->db->having('user_id', 45);

                    // Produces: HAVING title = 'My Title', id < 45

                    If you are using a database that CodeIgniter escapes queries for, you can prevent escaping content by passing an optional third argument, and setting it to FALSE.

                    -

                    $this->db->having('user_id', 45);
                    +

                    $this->db->having('user_id', 45);
                    // Produces: HAVING `user_id` = 45 in some databases such as MySQL
                    - $this->db->having('user_id', 45, FALSE);
                    + $this->db->having('user_id', 45, FALSE);
                    // Produces: HAVING user_id = 45

                    $this->db->or_having();

                    Identical to having(), only separates multiple clauses with "OR".

                    $this->db->order_by();

                    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. -The second parameter lets you set the direction of the result. Options are asc or desc, or random.

                    +The second parameter lets you set the direction of the result. Options are asc or desc, or random.

                    $this->db->order_by("title", "desc");
                    @@ -455,12 +455,12 @@ $this->db->limit(10);
                    $this->db->limit(10, 20);

                    -// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
                    +// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

                    $this->db->count_all_results();

                    -

                    Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:

                    +

                    Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:

                    echo $this->db->count_all_results('my_table');
                    // Produces an integer, like 25
                    @@ -472,7 +472,7 @@ echo $this->db->count_all_results();

                    $this->db->count_all();

                    -

                    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

                    +

                    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

                    echo $this->db->count_all('my_table');

                    @@ -485,7 +485,7 @@ echo $this->db->count_all_results();

                    $this->db->insert();

                    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:

                    +array or an object to the function. Here is an example using an array:

                    $data = array(
                    @@ -505,9 +505,9 @@ $this->db->insert('mytable', $data); /*
                        class Myclass {
                    -        var $title = 'My Title';
                    -        var $content = 'My Content';
                    -        var $date = 'My Date';
                    +        var $title = 'My Title';
                    +        var $content = 'My Content';
                    +        var $date = 'My Date';
                        }
                    */

                    @@ -523,7 +523,7 @@ $this->db->insert('mytable', $object);

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

                    +array or an object to the function. Here is an example using an array:

                    $data = array(
                    @@ -541,7 +541,7 @@ $data = array(

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

                    -// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')
                    +// 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.

                    @@ -588,9 +588,9 @@ $this->db->insert('mytable'); /*
                        class Myclass {
                    -        var $title = 'My Title';
                    -        var $content = 'My Content';
                    -        var $date = 'My Date';
                    +        var $title = 'My Title';
                    +        var $content = 'My Content';
                    +        var $date = 'My Date';
                        }
                    */

                    @@ -606,7 +606,7 @@ $this->db->insert('mytable');

                    Updating Data

                    $this->db->update();

                    -

                    Generates an update string and runs the query based on the data you supply. You can pass an +

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

                    @@ -630,9 +630,9 @@ $this->db->update('mytable', $data); /*
                        class Myclass {
                    -        var $title = 'My Title';
                    -        var $content = 'My Content';
                    -        var $date = 'My Date';
                    +        var $title = 'My Title';
                    +        var $content = 'My Content';
                    +        var $date = 'My Date';
                        }
                    */

                    @@ -711,7 +711,7 @@ $this->db->truncate('mytable');

                     Method Chaining

                    -

                    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

                    +

                    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

                    $this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
                    @@ -752,14 +752,14 @@ $this->db->get('tablename');
                    $this->db->select('field2');
                    $this->db->get('tablename');

                    -//Generates: SELECT `field1`, `field2` FROM (`tablename`)
                    +//Generates: SELECT `field1`, `field2` FROM (`tablename`)

                    $this->db->flush_cache();

                    $this->db->select('field2');
                    $this->db->get('tablename');

                    -//Generates: SELECT `field2` FROM (`tablename`)

                    +//Generates: SELECT `field2` FROM (`tablename`)

                    Note: The following statements can be cached: select, from, join, where, like, group_by, having, order_by, set

                     

                    diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 76a91216d..3f4ef2bc3 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -62,7 +62,7 @@ Database Caching Class

                    The Database Caching Class permits you to cache your queries as text files for reduced database load.

                    Important:  This class is initialized automatically by the database driver -when caching is enabled. Do NOT load this class manually.

                    +when caching is enabled. Do NOT load this class manually.

                    Also note:  Not all query result functions are available when you use caching. Please read this page carefully.

                    @@ -84,12 +84,12 @@ when caching is enabled. Do NOT load this class manually.

                    CodeIgniter's query caching system happens dynamically when your pages are viewed. When caching is enabled, the first time a web page is loaded, the query result object will be serialized and stored in a text file on your server. The next time the page is loaded the cache file will be used instead of -accessing your database. Your database usage can effectively be reduced to zero for any pages that have been cached.

                    +accessing your database. Your database usage can effectively be reduced to zero for any pages that have been cached.

                    Only read-type (SELECT) queries can be cached, since these are the only type of queries that produce a result. Write-type (INSERT, UPDATE, etc.) queries, since they don't generate a result, will not be cached by the system.

                    -

                    Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system +

                    Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system permits you clear caches associated with individual pages, or you can delete the entire collection of cache files. Typically you'll want to use the housekeeping functions described below to delete cache files after certain events take place, like when you've added new information to your database.

                    @@ -99,33 +99,33 @@ events take place, like when you've added new information to your database.

                    Getting a performance gain as a result of caching depends on many factors. If you have a highly optimized database under very little load, you probably won't see a performance boost. If your database is under heavy use you probably will see an improved response, assuming your file-system is not -overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database +overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database operation to a file-system one.

                    In some clustered server environments, for example, caching may be detrimental since file-system operations are so intense. On single servers in shared environments, caching will probably be beneficial. Unfortunately there is no -single answer to the question of whether you should cache your database. It really depends on your situation.

                    +single answer to the question of whether you should cache your database. It really depends on your situation.

                    How are Cache Files Stored?

                    -

                    CodeIgniter places the result of EACH query into its own cache file. Sets of cache files are further organized into -sub-folders corresponding to your controller functions. To be precise, the sub-folders are named identically to the +

                    CodeIgniter places the result of EACH query into its own cache file. Sets of cache files are further organized into +sub-folders corresponding to your controller functions. To be precise, the sub-folders are named identically to the first two segments of your URI (the controller class name and function name).

                    For example, let's say you have a controller called blog with a function called comments that -contains three queries. The caching system will create a cache folder +contains three queries. The caching system will create a cache folder called blog+comments, into which it will write three cache files.

                    If you use dynamic queries that change based on information in your URI (when using pagination, for example), each instance of -the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have +the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have queries.

                    Managing your Cache Files

                    -

                    Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog -that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the -controller function that serves up your comments. You'll find two delete functions described below that help you +

                    Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog +that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the +controller function that serves up your comments. You'll find two delete functions described below that help you clear data.

                    @@ -155,8 +155,8 @@ pertain to run-time operations.

                    $this->db->cache_on()  /   $this->db->cache_off()

                    -

                    Manually enables/disables caching. This can be useful if you want to -keep certain queries from being cached. Example:

                    +

                    Manually enables/disables caching. This can be useful if you want to +keep certain queries from being cached. Example:

                    // Turn caching on
                    @@ -177,9 +177,9 @@ $query = $this->db->query("SELECT * FROM another_table");

                    Deletes the cache files associated with a particular page. This is useful if you need to clear caching after you update your database.

                    -

                    The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing +

                    The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing a page at example.com/index.php/blog/comments, the caching system will put all cache files associated with it in a folder -called blog+comments. To delete those particular cache files you will use:

                    +called blog+comments. To delete those particular cache files you will use:

                    $this->db->cache_delete('blog', 'comments'); @@ -188,7 +188,7 @@ called blog+comments. To delete those particular cache files you will

                    $this->db->cache_delete_all()

                    -

                    Clears all existing cache files. Example:

                    +

                    Clears all existing cache files. Example:

                    $this->db->cache_delete_all(); diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 7f294401e..3e0c78d3d 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -63,13 +63,13 @@ Custom Function Calls

                    This function enables you to call PHP database functions that are not natively included in CodeIgniter, in a platform independent manner. For example, lets say you want to call the mysql_get_client_info() function, which is not natively supported -by CodeIgniter. You could do so like this: +by CodeIgniter. You could do so like this:

                    $this->db->call_function('get_client_info'); -

                    You must supply the name of the function, without the mysql_ prefix, in the first parameter. The prefix is added -automatically based on which database driver is currently being used. This permits you to run the same function on different database platforms. +

                    You must supply the name of the function, without the mysql_ prefix, in the first parameter. The prefix is added +automatically based on which database driver is currently being used. This permits you to run the same function on different database platforms. Obviously not all function calls are identical between platforms, so there are limits to how useful this function can be in terms of portability.

                    Any parameters needed by the function you are calling will be added to the second parameter.

                    @@ -77,7 +77,7 @@ Obviously not all function calls are identical between platforms, so there are l $this->db->call_function('some_function', $param1, $param2, etc..); -

                    Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:

                    +

                    Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:

                    $this->db->conn_id; diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index b34705410..51d11c9f2 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -74,7 +74,7 @@ $db['default']['dbprefix'] = "";
                    $db['default']['pconnect'] = TRUE;
                    $db['default']['db_debug'] = FALSE;
                    $db['default']['cache_on'] = FALSE;
                    -$db['default']['cachedir'] = "";
                    +$db['default']['cachedir'] = "";
                    $db['default']['char_set'] = "utf8";
                    $db['default']['dbcollat'] = "utf8_general_ci";
                    $db['default']['swap_pre'] = "";
                    @@ -82,7 +82,7 @@ $db['default']['autoinit'] = TRUE;
                    $db['default']['stricton'] = FALSE;

                    The reason we use a multi-dimensional array rather than a more simple one is to permit you to optionally store -multiple sets of connection values. If, for example, you run multiple environments (development, production, test, etc.) +multiple sets of connection values. If, for example, you run multiple environments (development, production, test, etc.) under a single installation, you can set up a connection group for each, then switch between groups as needed. For example, to set up a "test" environment you would do this:

                    @@ -95,7 +95,7 @@ $db['test']['dbprefix'] = "";
                    $db['test']['pconnect'] = TRUE;
                    $db['test']['db_debug'] = FALSE;
                    $db['test']['cache_on'] = FALSE;
                    -$db['test']['cachedir'] = "";
                    +$db['test']['cachedir'] = "";
                    $db['test']['char_set'] = "utf8";
                    $db['test']['dbcollat'] = "utf8_general_ci";
                    $db['test']['swap_pre'] = "";
                    @@ -107,7 +107,7 @@ $db['test']['stricton'] = FALSE;
                    $active_group = "test"; -

                    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" +

                    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" for the primary connection, but it too can be renamed to something more relevant to your project.

                    Active Record

                    @@ -126,21 +126,21 @@ for the primary connection, but it too can be renamed to something more relevant
                  • password - The password used to connect to the database.
                  • database - The name of the database you want to connect to.
                  • dbdriver - The database type. ie: mysql, postgres, odbc, etc. Must be specified in lower case.
                  • -
                  • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
                  • +
                  • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
                  • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
                  • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
                  • cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
                  • cachedir - The absolute server path to your database query cache directory.
                  • char_set - The character set used in communicating with the database.
                  • -
                  • dbcollat - The character collation used in communicating with the database.

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

                  • -
                  • swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
                  • +
                  • dbcollat - The character collation used in communicating with the database.

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

                  • +
                  • swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
                  • autoinit - Whether or not to automatically connect to the database when the library loads. If set to false, the connection will take place prior to executing the first query.
                  • stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
                  • -
                  • port - The database port number. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432; +
                  • port - The database port number. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;

                  Note: Depending on what database platform you are using (MySQL, Postgres, etc.) -not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and +not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL.

                  diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 1a74f5571..bb1b401f9 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -84,8 +84,8 @@ to the group specified in your database config file. For most people, this is th
                  1. The database connection values, passed either as an array or a DSN string.
                  2. -
                  3. TRUE/FALSE (boolean). Whether to return the connection ID (see Connecting to Multiple Databases below).
                  4. -
                  5. TRUE/FALSE (boolean). Whether to enable the Active Record class. Set to TRUE by default.
                  6. +
                  7. TRUE/FALSE (boolean). Whether to return the connection ID (see Connecting to Multiple Databases below).
                  8. +
                  9. TRUE/FALSE (boolean). Whether to enable the Active Record class. Set to TRUE by default.
                  @@ -148,7 +148,7 @@ you can pass the connection values as indicated above).

                  By setting the second parameter to TRUE (boolean) the function will return the database object.

                  -

                  When you connect this way, you will use your object name to issue commands rather than the syntax used throughout this guide. In other words, rather than issuing commands with:

                  +

                  When you connect this way, you will use your object name to issue commands rather than the syntax used throughout this guide. In other words, rather than issuing commands with:

                  $this->db->query();
                  $this->db->result();
                  etc...

                  diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 6bb8beb32..535fa3177 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -61,7 +61,7 @@ Database Example Code

                  Database Quick Start: Example Code

                  -

                  The following page contains example code showing how the database class is used. For complete details please +

                  The following page contains example code showing how the database class is used. For complete details please read the individual pages describing each function.

                  @@ -73,7 +73,7 @@ read the individual pages describing each function.

                  Once loaded the class is ready to be used as described below.

                  -

                  Note: If all your pages require database access you can connect automatically. See the connecting page for details.

                  +

                  Note: If all your pages require database access you can connect automatically. See the connecting page for details.

                  Standard Query With Multiple Results (Object Version)

                  @@ -90,7 +90,7 @@ foreach ($query->result() as $row)
                  echo 'Total Results: ' . $query->num_rows(); -

                  The above result() function returns an array of objects. Example: $row->title

                  +

                  The above result() function returns an array of objects. Example: $row->title

                  Standard Query With Multiple Results (Array Version)

                  @@ -104,7 +104,7 @@ foreach ($query->result_array() as $row)
                      echo $row['email'];
                  } -

                  The above result_array() function returns an array of standard array indexes. Example: $row['title']

                  +

                  The above result_array() function returns an array of standard array indexes. Example: $row['title']

                  Testing for Results

                  @@ -137,7 +137,7 @@ $row = $query->row();
                  echo $row->name;
                  -

                  The above row() function returns an object. Example: $row->name

                  +

                  The above row() function returns an object. Example: $row->name

                  Standard Query With Single Result (Array version)

                  @@ -148,7 +148,7 @@ $row = $query->row_array();
                  echo $row['name'];
                  -

                  The above row_array() function returns an array. Example: $row['name']

                  +

                  The above row_array() function returns an array. Example: $row['name']

                  Standard Insert

                  diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index b20436129..04d8b8096 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -92,7 +92,7 @@ foreach ($query->list_fields() as $field)

                  $this->db->field_exists()

                  Sometimes it's helpful to know whether a particular field exists before performing an action. -Returns a boolean TRUE/FALSE. Usage example:

                  +Returns a boolean TRUE/FALSE. Usage example:

                  if ($this->db->field_exists('field_name', 'table_name'))
                  @@ -101,7 +101,7 @@ if ($this->db->field_exists('field_name', 'table_name'))
                  }
                  -

                  Note: Replace field_name with the name of the column you are looking for, and replace +

                  Note: Replace field_name with the name of the column you are looking for, and replace table_name with the name of the table you are looking for.

                  diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index bbef053e4..cad2cf26f 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -151,7 +151,7 @@ already be running, since the forge class relies on it.

                                                            ),
                                  );

                  -

                  After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

                  +

                  After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

                  $this->dbforge->add_field()

                  The add fields function will accept the above array.

                  Passing strings as fields

                  @@ -164,7 +164,7 @@ already be running, since the forge class relies on it.

                  // gives id INT(9) NOT NULL AUTO_INCREMENT

                  Adding Keys

                  Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().

                  -

                  Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.

                  +

                  Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.

                  $this->dbforge->add_key('blog_id', TRUE);
                  // gives PRIMARY KEY `blog_id` (`blog_id`)

                  @@ -187,7 +187,7 @@ already be running, since the forge class relies on it.

                  Dropping a table

                  Executes a DROP TABLE sql

                  $this->dbforge->drop_table('table_name');
                  - // gives DROP TABLE IF EXISTS table_name

                  + // gives DROP TABLE IF EXISTS table_name

                  Renaming a table

                  Executes a TABLE rename

                  $this->dbforge->rename_table('old_table_name', 'new_table_name');
                  @@ -200,7 +200,7 @@ already be running, since the forge class relies on it.

                  );
                  $this->dbforge->add_column('table_name', $fields);

                  -// gives ALTER TABLE table_name ADD preferences TEXT

                  +// gives ALTER TABLE table_name ADD preferences TEXT

                  $this->dbforge->drop_column()

                  Used to remove a column from a table.

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

                  @@ -214,7 +214,7 @@ $this->dbforge->add_column('table_name', $fields);
                  );
                  $this->dbforge->modify_column('table_name', $fields);

                  - // gives ALTER TABLE table_name CHANGE old_name new_name TEXT

                  + // gives ALTER TABLE table_name CHANGE old_name new_name TEXT

                   

                  diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 650dd7a0b..107d2ed85 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -67,12 +67,12 @@ Query Helpers

                  $this->db->affected_rows()

                  Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).

                  -

                  Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the -correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

                  +

                  Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the +correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

                  $this->db->count_all();

                  -

                  Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

                  +

                  Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

                  echo $this->db->count_all('my_table');

                  // Produces an integer, like 25 @@ -90,11 +90,11 @@ correct number of affected rows. By default this hack is enabled but it can be t

                  $this->db->last_query();

                  -

                  Returns the last query that was run (the query string, not the result). Example:

                  +

                  Returns the last query that was run (the query string, not the result). Example:

                  $str = $this->db->last_query();

                  -// Produces: SELECT * FROM sometable.... +// Produces: SELECT * FROM sometable....
                  @@ -109,7 +109,7 @@ correct number of affected rows. By default this hack is enabled but it can be t $str = $this->db->insert_string('table_name', $data);
                  -

                  The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:

                  +

                  The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:

                  INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com')

                  Note: Values are automatically escaped, producing safer queries.

                  diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 594de80dd..fa3548cf1 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -63,7 +63,7 @@ Database Library structures and Active Record patterns. The database functions offer clear, simple syntax.

                    -
                  • Quick Start: Usage Examples
                  • +
                  • Quick Start: Usage Examples
                  • Database Configuration
                  • Connecting to a Database
                  • Running Queries
                  • diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 685da43dc..f9f96803f 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -68,14 +68,14 @@ Queries $this->db->query('YOUR QUERY HERE');

                    The query() function returns a database result object when "read" type queries are run, -which you can use to show your results. When "write" type queries are run it simply returns TRUE or FALSE -depending on success or failure. When retrieving data you will typically assign the query to your own variable, like this:

                    +which you can use to show your results. When "write" type queries are run it simply returns TRUE or FALSE +depending on success or failure. When retrieving data you will typically assign the query to your own variable, like this:

                    $query = $this->db->query('YOUR QUERY HERE');

                    $this->db->simple_query();

                    -

                    This is a simplified version of the $this->db->query() function. It ONLY returns TRUE/FALSE on success or failure. +

                    This is a simplified version of the $this->db->query() function. It ONLY returns TRUE/FALSE on success or failure. It DOES NOT return a database result set, nor does it set the query timer, or compile bind data, or store your query for debugging. It simply lets you submit a query. Most users will rarely use this function.

                    @@ -100,16 +100,16 @@ CodeIgniter has three methods that help you do this:

                    1. $this->db->escape() This function determines the data type so that it -can escape only string data. It also automatically adds single quotes around the data so you don't have to: +can escape only string data. It also automatically adds single quotes around the data so you don't have to: $sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
                    2. -
                    3. $this->db->escape_str() This function escapes the data passed to it, regardless of type. +
                    4. $this->db->escape_str() This function escapes the data passed to it, regardless of type. Most of the time you'll use the above function rather than this one. Use the function like this: $sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
                    5. -
                    6. $this->db->escape_like_str() This method should be used when strings are to be used in LIKE +
                    7. $this->db->escape_like_str() This method should be used when strings are to be used in LIKE conditions so that LIKE wildcards ('%', '_') in the string are also properly escaped. $search = '20% raise';
                      @@ -130,7 +130,7 @@ $this->db->query($sql, array(3, 'live', 'Rick'));

                      The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.

                      -

                      The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.

                      +

                      The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.

                      diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 0b82752a7..8ad6a1986 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -112,7 +112,7 @@ Query Results

                      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:

                      +

                      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:

                      $query = $this->db->query("YOUR QUERY");

                      @@ -126,8 +126,8 @@ Query Results

                      row()

                      -

                      This function returns a single result row. If your query has more than one row, it returns only the first row. - The result is returned as an object. Here's a usage example:

                      +

                      This function returns a single result row. If your query has more than one row, it returns only the first row. + The result is returned as an object. Here's a usage example:

                      $query = $this->db->query("YOUR QUERY");

                      @@ -157,7 +157,7 @@ Query Results

                      row_array()

                      -

                      Identical to the above row() function, except it returns an array. Example:

                      +

                      Identical to the above row() function, except it returns an array. Example:

                      $query = $this->db->query("YOUR QUERY");
                      @@ -209,7 +209,7 @@ echo $query->num_rows();

                      $query->num_fields()

                      -

                      The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:

                      +

                      The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:

                      $query = $this->db->query('SELECT * FROM my_table');

                      echo $query->num_fields(); @@ -218,9 +218,9 @@ echo $query->num_fields();

                      $query->free_result()

                      -

                      It frees the memory associated with the result and deletes the result resource ID. Normally PHP frees its memory automatically at the end of script -execution. However, if you are running a lot of queries in a particular script you might want to free the result after each query result has been -generated in order to cut down on memory consumptions. Example: +

                      It frees the memory associated with the result and deletes the result resource ID. Normally PHP frees its memory automatically at the end of script +execution. However, if you are running a lot of queries in a particular script you might want to free the result after each query result has been +generated in order to cut down on memory consumptions. Example:

                      $query = $this->db->query('SELECT title FROM my_table');

                      @@ -228,12 +228,12 @@ foreach ($query->result() as $row)
                      {
                         echo $row->title;
                      }
                      -$query->free_result(); // The $query result object will no longer be available
                      +$query->free_result(); // The $query result object will no longer be available

                      $query2 = $this->db->query('SELECT name FROM some_table');

                      $row = $query2->row();
                      echo $row->name;
                      -$query2->free_result(); // The $query2 result object will no longer be available +$query2->free_result(); // The $query2 result object will no longer be available
                      diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 631e3b9d1..a2aaa99a8 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -65,7 +65,7 @@ Table Data

                      $this->db->list_tables();

                      -

                      Returns an array containing the names of all the tables in the database you are currently connected to. Example:

                      +

                      Returns an array containing the names of all the tables in the database you are currently connected to. Example:

                      $tables = $this->db->list_tables();

                      @@ -79,7 +79,7 @@ foreach ($tables as $table)

                      $this->db->table_exists();

                      Sometimes it's helpful to know whether a particular table exists before running an operation on it. -Returns a boolean TRUE/FALSE. Usage example:

                      +Returns a boolean TRUE/FALSE. Usage example:

                      if ($this->db->table_exists('table_name'))
                      @@ -88,7 +88,7 @@ if ($this->db->table_exists('table_name'))
                      }
                      -

                      Note: Replace table_name with the name of the table you are looking for.

                      +

                      Note: Replace table_name with the name of the table you are looking for.

                      diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 68d76dff6..74945d434 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -61,18 +61,18 @@ Transactions

                      Transactions

                      -

                      CodeIgniter's database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you'll need -to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively.

                      +

                      CodeIgniter's database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you'll need +to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively.

                      If you are not familiar with -transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you +transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you have a basic understanding of transactions.

                      CodeIgniter's Approach to Transactions

                      -

                      CodeIgniter utilizes an approach to transactions that is very similar to the process used by the popular database class ADODB. We've chosen that approach -because it greatly simplifies the process of running transactions. In most cases all that is required are two lines of code.

                      +

                      CodeIgniter utilizes an approach to transactions that is very similar to the process used by the popular database class ADODB. We've chosen that approach +because it greatly simplifies the process of running transactions. In most cases all that is required are two lines of code.

                      Traditionally, transactions have required a fair amount of work to implement since they demand that you to keep track of your queries and determine whether to commit or rollback based on the success or failure of your queries. This is particularly cumbersome with @@ -98,7 +98,7 @@ of any given query.

                      Strict Mode

                      -

                      By default CodeIgniter runs all transactions in Strict Mode. When strict mode is enabled, if you are running multiple groups of +

                      By default CodeIgniter runs all transactions in Strict Mode. When strict mode is enabled, if you are running multiple groups of transactions, if one group fails all groups will be rolled back. If strict mode is disabled, each group is treated independently, meaning a failure of one group will not affect any others.

                      @@ -127,7 +127,7 @@ if ($this->db->trans_status() === FALSE)

                      Enabling Transactions

                      -

                      Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you +

                      Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you can do so using $this->db->trans_off():

                      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index ec45f2688..c488180a8 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -105,7 +105,7 @@ foreach ($dbs as $db)

                      $this->dbutil->database_exists();

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

                      +Returns a boolean TRUE/FALSE. Usage example:

                      if ($this->dbutil->database_exists('database_name'))
                      @@ -114,7 +114,7 @@ if ($this->dbutil->database_exists('database_name'))
                      }
                      -

                      Note: Replace database_name with the name of the table you are looking for. This function is case sensitive.

                      +

                      Note: Replace database_name with the name of the table you are looking for. This function is case sensitive.

                      @@ -184,7 +184,7 @@ echo $this->dbutil->csv_from_result($query);

                      The second and third parameters allows you to -set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:

                      +set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:

                      $delimiter = ",";
                      @@ -193,14 +193,14 @@ $newline = "\r\n";
                      echo $this->dbutil->csv_from_result($query, $delimiter, $newline);
                      -

                      Important:  This function will NOT write the CSV file for you. It simply creates the CSV layout. +

                      Important:  This function will NOT write the CSV file for you. It simply creates the CSV layout. If you need to write the file use the File Helper.

                      $this->dbutil->xml_from_result($db_result)

                      Permits you to generate an XML file from a query result. The first parameter expects a query result object, the second -may contain an optional array of config parameters. Example:

                      +may contain an optional array of config parameters. Example:

                      $this->load->dbutil();
                      @@ -217,18 +217,18 @@ $config = array (
                      echo $this->dbutil->xml_from_result($query, $config);
                      -

                      Important:  This function will NOT write the XML file for you. It simply creates the XML layout. +

                      Important:  This function will NOT write the XML file for you. It simply creates the XML layout. If you need to write the file use the File Helper.

                      $this->dbutil->backup()

                      -

                      Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

                      +

                      Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

                      Note:  This features is only available for MySQL databases.

                      Note: Due to the limited execution time and memory available to PHP, backing up very large -databases may not be possible. If your database is very large you might need to backup directly from your SQL server +databases may not be possible. If your database is very large you might need to backup directly from your SQL server via the command line, or have your server admin do it for you if you do not have root privileges.

                      Usage Example

                      @@ -278,7 +278,7 @@ $this->dbutil->backup($prefs);
- + diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index e25503200..d59d5e4ed 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -51,7 +51,7 @@ Foo Class

Foo Class

-

Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

+

Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

Important:  This is an important note with EMPHASIS.

diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 574ab35d7..abd5845ff 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -58,19 +58,19 @@ Alternate PHP Syntax

Alternate PHP Syntax for View Files

If you do not utilize CodeIgniter's template engine, you'll be using pure PHP -in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use -PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, +in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use +PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, and eliminate "echo" statements.

Automatic Short Tag Support

Note: If you find that the syntax described in this page does not work on your server it might be that "short tags" are disabled in your PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, -allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your +allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your config/config.php file.

Please note that if you do use this feature, if PHP errors are encountered -in your view files, the error message and line number will not be accurately shown. Instead, all errors +in your view files, the error message and line number will not be accurately shown. Instead, all errors will be shown as eval() errors.

@@ -89,7 +89,7 @@ will be shown as eval() errors.

Alternative Control Structures

Controls structures, like if, for, foreach, and while can be -written in a simplified format as well. Here is an example using foreach:

+written in a simplified format as well. Here is an example using foreach:

<ul>
@@ -102,14 +102,14 @@ written in a simplified format as well. Here is an example using foreach:


</ul>
-

Notice that there are no braces. Instead, the end brace is replaced with endforeach. +

Notice that there are no braces. Instead, the end brace is replaced with endforeach. Each of the control structures listed above has a similar closing syntax: endif, endfor, endforeach, and endwhile

-

Also notice that instead of using a semicolon after each structure (except the last one), there is a colon. This is +

Also notice that instead of using a semicolon after each structure (except the last one), there is a colon. This is important!

-

Here is another example, using if/elseif/else. Notice the colons:

+

Here is another example, using if/elseif/else. Notice the colons:

<?php if ($username == 'sally'): ?>
diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 405dda30f..fae0b5fd9 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -75,7 +75,7 @@ consider auto-loading them for convenience.

loaded to the autoload array. You'll find instructions in that file corresponding to each type of item.

-

Note: Do not include the file extension (.php) when adding items to the autoload array.

+

Note: Do not include the file extension (.php) when adding items to the autoload array.

diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index abfe6ded9..c77f9a15d 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -68,8 +68,8 @@ 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 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.

+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.

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

Deleting Caches

-

If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: -Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you +

If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: +Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you will need to manually delete it from your cache folder.

diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 3c7a5df9e..bfac32685 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -68,7 +68,7 @@ Auto-loading Resources     $str = quoted_printable_encode($str);
}
-

Returns boolean TRUE if the installed version of PHP is equal to or greater than the supplied version number. Returns FALSE if the installed version of PHP is lower than the supplied version number.

+

Returns boolean TRUE if the installed version of PHP is equal to or greater than the supplied version number. Returns FALSE if the installed version of PHP is lower than the supplied version number.

is_really_writable('path/to/file')

@@ -92,10 +92,10 @@ else

set_status_header(code, 'text');

-

Permits you to manually set a server status header. Example:

+

Permits you to manually set a server status header. Example:

set_status_header(401);
-// Sets the header as: Unauthorized
+// Sets the header as: Unauthorized

See here for a full list of headers.

diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 01ef3d1ff..c90916472 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -91,7 +91,7 @@ Controllers

Let's try it:  Hello World!

-

Let's create a simple controller so you can see it in action. Using your text editor, create a file called blog.php, and put the following code in it:

+

Let's create a simple controller so you can see it in action. Using your text editor, create a file called blog.php, and put the following code in it:

-

If you visit your site using the URL you did earlier you should see your new view. The URL was similar to this:

+

If you visit your site using the URL you did earlier you should see your new view. The URL was similar to this:

example.com/index.php/blog/

Loading multiple views

-

CodeIgniter will intelligently handle multiple calls to $this->load->view from within a controller. If more than one call happens they will be appended together. For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look something like this:

+

CodeIgniter will intelligently handle multiple calls to $this->load->view from within a controller. If more than one call happens they will be appended together. For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look something like this:

<?php

class Page extends CI_Controller {

   function index()
   {
-      $data['page_title'] = 'Your title';
+      $data['page_title'] = 'Your title';
      $this->load->view('header');
      $this->load->view('menu');
      $this->load->view('content', $data);
@@ -132,8 +132,8 @@ class Page extends CI_Controller {

?>

In the example above, we are using "dynamically added data", which you will see below.

Storing Views within Sub-folders

-

Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need -to include the folder name loading the view. Example:

+

Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need +to include the folder name loading the view. Example:

$this->load->view('folder_name/file_name'); @@ -159,7 +159,7 @@ $this->load->view('blogview', $data);

Note: If you use an object, the class variables will be turned into array elements.

-

Let's try it with your controller file. Open it add this code:

+

Let's try it with your controller file. Open it add this code:

-

Note: You'll notice that in the example above we are using PHP's alternative syntax. If you +

Note: You'll notice that in the example above we are using PHP's alternative syntax. If you are not familiar with it you can read about it here.

Returning views as data

There is a third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

+rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

$string = $this->load->view('myfile', '', true); diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 88e8384d5..a19621453 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -70,8 +70,8 @@ Array Helper

element()

-

Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If -a value exists it is returned. If a value does not exist it returns FALSE, or whatever you've specified as the default value via the third parameter. Example:

+

Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If +a value exists it is returned. If a value does not exist it returns FALSE, or whatever you've specified as the default value via the third parameter. Example:

$array = array('color' => 'red', 'shape' => 'round', 'size' => '');
@@ -86,7 +86,7 @@ echo element('size', $array, NULL);

random_element()

-

Takes an array as input and returns a random element from it. Usage example:

+

Takes an array as input and returns a random element from it. Usage example:

$quotes = array(
            "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",
@@ -102,8 +102,8 @@ echo random_element($quotes);

elements()

-

Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist -it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:

+

Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist +it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:

$array = array(
@@ -142,7 +142,7 @@ array(
);
-

This is useful when sending the $_POST array to one of your Models. This prevents users from +

This is useful when sending the $_POST array to one of your Models. This prevents users from sending additional POST data to be entered into your tables:

diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 3c6fa1188..2fd5a5549 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -83,7 +83,7 @@ CAPTCHA Helper <img src="http://example.com/captcha/12345.jpg" width="140" height="50" />

The "time" is the micro timestamp used as the image name without the file - extension. It will be a number like this: 1139612155.3422

+ extension. It will be a number like this: 1139612155.3422

The "word" is the word that appears in the captcha image, which if not supplied to the function, will be a random string.

@@ -109,13 +109,13 @@ echo $cap['image'];
  • The captcha function requires the GD image library.
  • Only the img_path and img_url are required.
  • If a "word" is not supplied, the function will generate a random - ASCII string. You might put together your own word library that + ASCII string. You might put together your own word library that you can draw randomly from.
  • If you do not specify a path to a TRUE TYPE font, the native ugly GD font will be used.
  • The "captcha" folder must be writable (666, or 777)
  • The "expiration" (in seconds) signifies how long an image will - remain in the captcha folder before it will be deleted. The default + remain in the captcha folder before it will be deleted. The default is two hours.
  • @@ -137,7 +137,7 @@ echo $cap['image'];
     KEY `word` (`word`)
    ); -

    Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:

    +

    Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:

    $this->load->helper('captcha');
    $vals = array(
    diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 9879653c1..34faadbcc 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -70,20 +70,20 @@ Cookie Helper

    set_cookie()

    -

    This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().

    +

    This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().

    get_cookie()

    -

    This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().

    +

    This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().

    delete_cookie()

    -

    Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:

    +

    Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:

    delete_cookie("name"); -

    This function is otherwise identical to set_cookie(), except that it does not have the value and expiration parameters. You can submit an array +

    This function is otherwise identical to set_cookie(), except that it does not have the value and expiration parameters. You can submit an array of values in the first parameter or you can set discrete parameters.

    delete_cookie($name, $domain, $path, $prefix) diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index a2933420c..44096ff46 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -72,7 +72,7 @@ Date Helper

    now()

    Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference" -setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you +setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP's time() function.

    @@ -82,10 +82,10 @@ run a site that lets each user set their own timezone settings) there is no bene

    mdate()

    This function is identical to PHPs date() function, except that it lets you -use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

    +use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

    The benefit of doing dates this way is that you don't have to worry about escaping any characters that -are not date codes, as you would normally have to do with the date() function. Example:

    +are not date codes, as you would normally have to do with the date() function. Example:

    $datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
    $time = time();
    @@ -149,7 +149,7 @@ echo standard_date($format, $time);
    - + @@ -170,7 +170,7 @@ echo standard_date($format, $time);

    local_to_gmt()

    -

    Takes a Unix timestamp as input and returns it as GMT. Example:

    +

    Takes a Unix timestamp as input and returns it as GMT. Example:

    $now = time();

    @@ -180,11 +180,11 @@ $gmt = local_to_gmt($now);

    gmt_to_local()

    Takes a Unix timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the -timezone and Daylight Saving time submitted. Example:

    +timezone and Daylight Saving time submitted. Example:

    $timestamp = '1140153693';
    -$timezone = 'UM8';
    +$timezone = 'UM8';
    $daylight_saving = TRUE;

    echo gmt_to_local($timestamp, $timezone, $daylight_saving);
    @@ -208,7 +208,7 @@ $unix = mysql_to_unix($mysql);

    This can be useful if you need to display a date in a form field for submission.

    -

    The time can be formatted with or without seconds, and it can be set to European or US format. If only +

    The time can be formatted with or without seconds, and it can be set to European or US format. If only the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples:

    $now = time();
    @@ -222,9 +222,9 @@ echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds

    human_to_unix()

    -

    The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is -useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if -the date string passed to it is not formatted as indicated above. Example:

    +

    The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is +useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if +the date string passed to it is not formatted as indicated above. Example:

    $now = time();

    @@ -242,9 +242,9 @@ $unix = human_to_unix($human);
    1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes -

    The first parameter must contain a Unix timestamp. The second parameter must contain a -timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose -for this function is to show how much time has elapsed from some point in time in the past to now. Example:

    +

    The first parameter must contain a Unix timestamp. The second parameter must contain a +timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose +for this function is to show how much time has elapsed from some point in time in the past to now. Example:

    $post_date = '1079621429';
    $now = time();
    @@ -256,7 +256,7 @@ echo timespan($post_date, $now);

    days_in_month()

    -

    Returns the number of days in a given month/year. Takes leap years into account. Example:

    +

    Returns the number of days in a given month/year. Takes leap years into account. Example:

    echo days_in_month(06, 2005);

    If the second parameter is empty, the current year will be used.

    @@ -304,7 +304,7 @@ echo timespan($post_date, $now);

    This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.

    -

    The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

    +

    The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

    echo timezone_menu('UM8'); diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 2086fe1f3..1a2f28d7d 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -78,12 +78,12 @@ and builds an array representation of it and all its contained files. Example:Note: Paths are almost always relative to your main index.php file.

    -

    Sub-folders contained within the directory will be mapped as well. If you wish to control the recursion depth, +

    Sub-folders contained within the directory will be mapped as well. If you wish to control the recursion depth, you can do so using the second parameter (integer). A depth of 1 will only map the top level directory:

    $map = directory_map('./mydirectory/', 1); -

    By default, hidden files will not be included in the returned array. To override this behavior, +

    By default, hidden files will not be included in the returned array. To override this behavior, you may set a third parameter to true (boolean):

    $map = directory_map('./mydirectory/', FALSE, TRUE); diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 2d06fa25b..c37235424 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -69,11 +69,11 @@ File Helper

    read_file('path')

    -

    Returns the data contained in the file specified in the path. Example:

    +

    Returns the data contained in the file specified in the path. Example:

    $string = read_file('./path/to/file.php'); -

    The path can be a relative or full server path. Returns FALSE (boolean) on failure.

    +

    The path can be a relative or full server path. Returns FALSE (boolean) on failure.

    Note: The path is relative to your main site index.php file, NOT your controller or view files. CodeIgniter uses a front controller so paths are always relative to the main site index.

    @@ -83,7 +83,7 @@ might not work if you are trying to access a file above the calling script.

    write_file('path', $data)

    -

    Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

    +

    Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

    $data = 'Some file data';
    @@ -101,7 +101,7 @@ else
    write_file('./path/to/file.php', $data, 'r+'); -

    The default mode is wb. Please see the PHP user guide for mode options.

    +

    The default mode is wb. Please see the PHP user guide for mode options.

    Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.). If the file does not already exist, the directory containing it must be writable.

    @@ -111,7 +111,7 @@ CodeIgniter uses a front controller so paths are always relative to the main sit

    delete_files('path')

    -

    Deletes ALL files contained in the supplied path. Example:

    +

    Deletes ALL files contained in the supplied path. Example:

    delete_files('./path/to/directory/');

    If the second parameter is set to true, any directories contained within the supplied root path will be deleted as well. Example:

    @@ -127,12 +127,12 @@ can optionally be added to the file names by setting the second parameter to TRU

    get_dir_file_info('path/to/directory/', $top_level_only = TRUE)

    -

    Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced +

    Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced by sending the second parameter, $top_level_only to FALSE, as this can be an intensive operation.

    get_file_info('path/to/file', $file_information)

    -

    Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.

    +

    Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.

    Note: The "writable" uses the PHP function is_writable() which is known to have issues on the IIS webserver. Consider using fileperms instead, which returns information from PHP's fileperms() function.

    get_mime_by_extension('file')

    @@ -142,7 +142,7 @@ can optionally be added to the file names by setting the second parameter to TRU $file = "somefile.png";
    echo $file . ' is has a mime type of ' . get_mime_by_extension($file);

    -

    Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.

    +

    Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.

    symbolic_permissions($perms)

    diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index b4a5730f2..87e3c28b0 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -72,7 +72,7 @@ Form Helper

    form_open()

    -

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you +

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you add form attributes and hidden input fields, and will always add the attribute accept-charset based on the charset value in your config file.

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable @@ -122,7 +122,7 @@ which is necessary if you would like to use the form to upload files with.

    form_hidden()

    -

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    +

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    form_hidden('username', 'johndoe');

    @@ -149,7 +149,7 @@ echo form_hidden($data);

    form_input()

    -

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first +

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first and second parameter:

    echo form_input('username', 'johndoe'); @@ -196,9 +196,9 @@ example, you will instead specify "rows" and "cols".

    form_dropdown()

    -

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, +

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, the second parameter will contain an associative array of options, and the third parameter will contain the -value you wish to be selected. You can also pass an array of multiple items through the third parameter, and CodeIgniter will create a multiple select for you. Example:

    +value you wish to be selected. You can also pass an array of multiple items through the third parameter, and CodeIgniter will create a multiple select for you. Example:

    $options = array(
                      'small'  => 'Small Shirt',
    @@ -215,7 +215,7 @@ echo form_dropdown('shirts', $options, 'large');

    <select name="shirts">
    <option value="small">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    +<option value="med">Medium Shirt</option>
    <option value="large" selected="selected">Large Shirt</option>
    <option value="xlarge">Extra Large Shirt</option>
    </select>
    @@ -226,7 +226,7 @@ echo form_dropdown('shirts', $options, $shirts_on_sale);

    <select name="shirts" multiple="multiple">
    <option value="small" selected="selected">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    +<option value="med">Medium Shirt</option>
    <option value="large" selected="selected">Large Shirt</option>
    <option value="xlarge">Extra Large Shirt</option>
    </select>
    @@ -243,9 +243,9 @@ echo form_dropdown('shirts', $options, 'large', $js);

    form_multiselect()

    -

    Lets you create a standard multiselect field. The first parameter will contain the name of the field, +

    Lets you create a standard multiselect field. The first parameter will contain the name of the field, the second parameter will contain an associative array of options, and the third parameter will contain the -value or values you wish to be selected. The parameter usage is identical to using form_dropdown() above, +value or values you wish to be selected. The parameter usage is identical to using form_dropdown() above, except of course that the name of the field will need to use POST array syntax, e.g. foo[].

    @@ -267,7 +267,7 @@ echo form_fieldset_close(); </fieldset>

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    - echo form_fieldset('Address Information', $attributes);
    + echo form_fieldset('Address Information', $attributes);
    echo "<p>fieldset content here</p>\n";
    echo form_fieldset_close();

    @@ -277,8 +277,8 @@ echo form_fieldset_close();
    <p>form content here</p>
    </fieldset>

    form_fieldset_close()

    -

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it - which will be added below the tag. For example:

    +

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it + which will be added below the tag. For example:

    $string = "</div></div>";

    echo form_fieldset_close($string);
    @@ -309,7 +309,7 @@ echo form_checkbox($data);
    // Would produce:

    <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    -

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the +

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the fourth parameter:

    $js = 'onClick="some_function()"';
    @@ -330,7 +330,7 @@ fourth parameter:


    <input type="submit" name="mysubmit" value="Submit Post!" />

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. - The third parameter lets you add extra data to your form, like JavaScript.

    + The third parameter lets you add extra data to your form, like JavaScript.

    form_label()

    Lets you generate a <label>. Simple example:

    echo form_label('What is your Name', 'username');
    @@ -338,13 +338,13 @@ fourth parameter:

    // Would produce:
    <label for="username">What is your Name</label>
    -

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    +

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    $attributes = array(
        'class' => 'mycustomclass',
        'style' => 'color: #000;',
    );
    - echo form_label('What is your Name', 'username', $attributes);
    -
    + echo form_label('What is your Name', 'username', $attributes);
    +
    // Would produce:
    <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    form_reset()

    @@ -386,8 +386,8 @@ echo form_button('mybutton', 'Click Me', $js);

    form_close()

    -

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it -which will be added below the tag. For example:

    +

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it +which will be added below the tag. For example:

    $string = "</div></div>";

    @@ -404,7 +404,7 @@ echo form_close($string);

    form_prep()

    -

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    +

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    $string = 'Here is a string containing "quoted" text.';

    @@ -431,7 +431,7 @@ The second (optional) parameter allows you to set a default value for the form.

    set_select()

    -

    If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +

    If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter must contain the name of the select menu, the second parameter must contain the value of each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

    @@ -439,16 +439,16 @@ each item, and the third (optional) parameter lets you set an item as the defaul <select name="myselect">
    -<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
    -<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
    -<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
    +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
    +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
    +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
    </select>

    set_checkbox()

    -

    Permits you to display a checkbox in the state it was submitted. The first parameter +

    Permits you to display a checkbox in the state it was submitted. The first parameter must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

    <input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
    @@ -459,8 +459,8 @@ must contain the name of the checkbox, the second parameter must contain its val

    Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

    -<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
    -<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
    +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
    +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 665081fb6..308013d51 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -84,10 +84,10 @@ HTML Helper

    The above would produce: <br /><br /><br />

    heading()

    -

    Lets you create HTML <h1> tags. The first parameter will contain the data, the -second the size of the heading. Example:

    +

    Lets you create HTML <h1> tags. The first parameter will contain the data, the +second the size of the heading. Example:

    echo heading('Welcome!', 3); -

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

    +

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

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

    echo heading('Welcome!', 3, 'class="pink"') @@ -95,7 +95,7 @@ second the size of the heading. Example:

    img()

    -

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

    +

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

    echo img('images/picture.jpg');
    // gives <img src="http://site.com/images/picture.jpg" />

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    @@ -116,7 +116,7 @@ second the size of the heading. Example:

    // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    link_tag()

    -

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. +

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. echo link_tag('css/mystyles.css');
    // gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    Further examples:

    @@ -271,20 +271,20 @@ echo ul($list, $attributes);

    meta()

    -

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    +

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    echo meta('description', 'My Great site');
    -// Generates: <meta name="description" content="My Great Site" />
    +// Generates: <meta name="description" content="My Great Site" />


    -echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    -// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    +echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    +// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />


    echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    -// Generates: <meta name="robots" content="no-cache" />
    +// Generates: <meta name="robots" content="no-cache" />


    @@ -298,7 +298,7 @@ $meta = array(

    echo meta($meta);
    -// Generates:
    +// Generates:
    // <meta name="robots" content="no-cache" />
    // <meta name="description" content="My Great Site" />
    // <meta name="keywords" content="love, passion, intrigue, deception" />
    @@ -319,7 +319,7 @@ echo doctype('html4-trans');
    // <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    -

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    +

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    Options Description
    tablesempty arrayNoneAn array of tables you want backed up. If left blank all tables will be exported.tablesempty arrayNoneAn array of tables you want backed up. If left blank all tables will be exported.
    ignoreempty arrayNoneAn array of tables you want the backup routine to ignore.
    DATE_RFC1123 RFC 1123Sun, 14 Aug 2005 16:13:03 UTCSun, 14 Aug 2005 16:13:03 UTC
    DATE_RFC2822
    diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 087675454..221c05907 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -71,7 +71,7 @@ Inflector Helper

    singular()

    -

    Changes a plural word to singular. Example:

    +

    Changes a plural word to singular. Example:

    $word = "dogs";
    @@ -81,7 +81,7 @@ echo singular($word); // Returns "dog"

    plural()

    -

    Changes a singular word to plural. Example:

    +

    Changes a singular word to plural. Example:

    $word = "dog";
    @@ -94,7 +94,7 @@ echo plural($word); // Returns "dogs" echo plural($word, TRUE); // Returns "passes"

    camelize()

    -

    Changes a string of words separated by spaces or underscores to camel case. Example:

    +

    Changes a string of words separated by spaces or underscores to camel case. Example:

    $word = "my_dog_spot";
    @@ -104,7 +104,7 @@ echo camelize($word); // Returns "myDogSpot"

    underscore()

    -

    Takes multiple words separated by spaces and underscores them. Example:

    +

    Takes multiple words separated by spaces and underscores them. Example:

    $word = "my dog spot";
    @@ -114,7 +114,7 @@ echo underscore($word); // Returns "my_dog_spot"

    humanize()

    -

    Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:

    +

    Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:

    $word = "my_dog_spot";
    diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index e10733baf..3b3b87da9 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -73,7 +73,7 @@ Language Helper

    This function returns a line of text from a loaded language file with simplified syntax that may be more desirable for view files than calling $this->lang->line(). - The optional second parameter will also output a form label for you. Example:

    + The optional second parameter will also output a form label for you. Example:

    echo lang('language_key', 'form_item_id');
    // becomes <label for="form_item_id">language_key</label>
    diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index a04f37c86..51a4521a6 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -71,7 +71,7 @@ Number Helper

    byte_format()

    -

    Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:

    +

    Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:

    echo byte_format(456); // Returns 456 Bytes
    diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 49e0365d1..e0cace325 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -71,19 +71,19 @@ Security Helper

    xss_clean()

    -

    Provides Cross Site Script Hack filtering. This function is an alias to the one in the -Input class. More info can be found there.

    +

    Provides Cross Site Script Hack filtering. This function is an alias to the one in the +Input class. More info can be found there.

    sanitize_filename()

    -

    Provides protection against directory traversal. This function is an alias to the one in the -Security class. More info can be found there.

    +

    Provides protection against directory traversal. This function is an alias to the one in the +Security class. More info can be found there.

    do_hash()

    -

    Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

    +

    Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

    $str = do_hash($str); // SHA1
    @@ -91,13 +91,13 @@ $str = do_hash($str); // SHA1
    $str = do_hash($str, 'md5'); // MD5
    -

    Note: This function was formerly named dohash(), which has been deprecated in favour of do_hash().

    +

    Note: This function was formerly named dohash(), which has been deprecated in favour of do_hash().

    strip_image_tags()

    -

    This is a security function that will strip image tags from a string. It leaves the image URL as plain text.

    +

    This is a security function that will strip image tags from a string. It leaves the image URL as plain text.

    $string = strip_image_tags($string); diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 4668f106e..408df17c9 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -83,7 +83,7 @@ Your users can click a desired smiley and with the help of some JavaScript it wi requires that you first download and install the smiley images, then create a controller and the View as described.

    Important: Before you begin, please download the smiley images and put them in -a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at +a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at application/config/smileys.php

    @@ -166,7 +166,7 @@ you can give your smiley links a generic name that will be tied to a specific id

    get_clickable_smileys()

    -

    Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder +

    Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder and a field id or field alias.

    $image_array = get_smiley_links("http://example.com/images/smileys/", "comment"); @@ -187,10 +187,10 @@ This function is designed to be placed into the <head> area of your web pa

    parse_smileys()

    Takes a string of text as input and replaces any contained plain text smileys into the image -equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:

    +equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:

    -$str = 'Here are some simileys: :-) ;-)'; +$str = 'Here are some simileys: :-) ;-)'; $str = parse_smileys($str, "http://example.com/images/smileys/"); diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 6fc2cf5f7..169ee4ebb 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -70,9 +70,9 @@ String Helper

    random_string()

    -

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    +

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    -

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    +

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
      @@ -92,7 +92,7 @@ String Helper

      alternator()

      -

      Allows two or more items to be alternated between, when cycling through a loop. Example:

      +

      Allows two or more items to be alternated between, when cycling through a loop. Example:

      for ($i = 0; $i < 10; $i++)
      {
      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 3c83f3d42..f71d87840 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -71,22 +71,22 @@ Text Helper

      word_limiter()

      -

      Truncates a string to the number of words specified. Example:

      +

      Truncates a string to the number of words specified. Example:

      $string = "Here is a nice text string consisting of eleven words.";

      $string = word_limiter($string, 4);

      -// Returns: Here is a nice… +// Returns: Here is a nice…
      -

      The third parameter is an optional suffix added to the string. By default it adds an ellipsis.

      +

      The third parameter is an optional suffix added to the string. By default it adds an ellipsis.

      character_limiter()

      -

      Truncates a string to the number of characters specified. It maintains the integrity +

      Truncates a string to the number of characters specified. It maintains the integrity of words so the character count may be slightly more or less then what you specify. Example:

      @@ -94,7 +94,7 @@ $string = "Here is a nice text string consisting of eleven words.";

      $string = character_limiter($string, 20);

      -// Returns: Here is a nice text string… +// Returns: Here is a nice text string…

      The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis.

      @@ -125,9 +125,9 @@ part it should correctly identify characters outside the normal range (like acce

      word_censor()

      -

      Enables you to censor words within a text string. The first parameter will contain the original string. The -second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value -for the words. If not specified they are replaced with pound signs: ####. Example:

      +

      Enables you to censor words within a text string. The first parameter will contain the original string. The +second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value +for the words. If not specified they are replaced with pound signs: ####. Example:

      $disallowed = array('darn', 'shucks', 'golly', 'phooey');
      @@ -137,7 +137,7 @@ $string = word_censor($string, $disallowed, 'Beep!');

      highlight_code()

      -

      Colorizes a string of code (PHP, HTML, etc.). Example:

      +

      Colorizes a string of code (PHP, HTML, etc.). Example:

      $string = highlight_code($string); @@ -146,9 +146,9 @@ $string = word_censor($string, $disallowed, 'Beep!');

      highlight_phrase()

      -

      Will highlight a phrase within a text string. The first parameter will contain the original string, the second will -contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags -you would like the phrase wrapped in. Example:

      +

      Will highlight a phrase within a text string. The first parameter will contain the original string, the second will +contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags +you would like the phrase wrapped in. Example:

      $string = "Here is a nice text string about nothing in particular.";
      @@ -164,7 +164,7 @@ $string = highlight_phrase($string, "nice text", '<span style="color:#990000"

      word_wrap()

      -

      Wraps text at the specified character count while maintaining complete words. Example:

      +

      Wraps text at the specified character count while maintaining complete words. Example:

      $string = "Here is a simple string of text that will help us demonstrate this function.";

      @@ -180,8 +180,8 @@ function

      ellipsize()

      This function will strip tags from a string, split it at a defined maximum length, and insert an ellipsis.

      -

      The first parameter is the string to ellipsize, the second is the number of characters in the final string. The third parameter is where in the string the ellipsis should appear from 0 - 1, left to right. For example. a value of 1 will place the ellipsis at the right of the string, .5 in the middle, and 0 at the left.

      -

      An optional forth parameter is the kind of ellipsis. By default, &hellip; will be inserted.

      +

      The first parameter is the string to ellipsize, the second is the number of characters in the final string. The third parameter is where in the string the ellipsis should appear from 0 - 1, left to right. For example. a value of 1 will place the ellipsis at the right of the string, .5 in the middle, and 0 at the left.

      +

      An optional forth parameter is the kind of ellipsis. By default, &hellip; will be inserted.

      $str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';

      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index e75528fbb..00686a340 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -71,7 +71,7 @@ Typography Helper

      auto_typography()

      -

      Formats text so that it is semantically and typographically correct HTML. Please see the Typography Class for more info.

      +

      Formats text so that it is semantically and typographically correct HTML. Please see the Typography Class for more info.

      Usage example:

      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 0bcf1e7ae..d20f1b1e2 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -69,13 +69,13 @@ URL Helper

      site_url()

      -

      Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your +

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

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

      -

      Segments can be optionally passed to the function as a string or an array. Here is a string example:

      +

      Segments can be optionally passed to the function as a string or an array. Here is a string example:

      echo site_url("news/local/123"); @@ -90,7 +90,7 @@ echo site_url($segments);

      base_url()

      -

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

      +

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

      echo base_url(); @@ -99,7 +99,7 @@ echo site_url($segments);

      uri_string()

      -

      Returns the URI segments of any page that contains this function. For example, if your URL was this:

      +

      Returns the URI segments of any page that contains this function. For example, if your URL was this:

      http://some-site.com/blog/comments/123

      The function would return:

      @@ -107,7 +107,7 @@ echo site_url($segments);

      index_page()

      -

      Returns your site "index" page, as specified in your config file. Example:

      +

      Returns your site "index" page, as specified in your config file. Example:

      echo index_page(); @@ -122,15 +122,15 @@ echo site_url($segments); anchor(uri segments, text, attributes) -

      The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, +

      The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, segments can be a string or an array.

      -

      Note:  If you are building links that are internal to your application do not include the base URL (http://...). This +

      Note:  If you are building links that are internal to your application do not include the base URL (http://...). This will be added automatically from the information specified in your config file. Include only the URI segments you wish appended to the URL.

      -

      The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

      +

      The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

      -

      The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

      +

      The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

      Here are some examples:

      @@ -148,7 +148,7 @@ will be added automatically from the information specified in your config file.

      Nearly identical to the anchor() function except that it opens the URL in a new window. You can specify JavaScript window attributes in the third parameter to control how the window is opened. If -the third parameter is not set it will simply open a new window with your own browser settings. Here is an example +the third parameter is not set it will simply open a new window with your own browser settings. Here is an example with attributes:

      @@ -173,7 +173,7 @@ If you want the function to use all of its defaults simply pass an empty array i

      mailto()

      -

      Creates a standard HTML email link. Usage example:

      +

      Creates a standard HTML email link. Usage example:

      echo mailto('me@my-site.com', 'Click Here to Contact Me'); @@ -188,12 +188,12 @@ written with JavaScript to help prevent the email address from being harvested b

      auto_link()

      -

      Automatically turns URLs and email addresses contained in a string into links. Example:

      +

      Automatically turns URLs and email addresses contained in a string into links. Example:

      $string = auto_link($string); -

      The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both -if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.

      +

      The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both +if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.

      Converts only URLs:

      $string = auto_link($string, 'url'); @@ -201,42 +201,42 @@ if the parameter is not specified. Email links are encoded as safe_mailto() as s

      Converts only Email addresses:

      $string = auto_link($string, 'email'); -

      The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

      +

      The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

      $string = auto_link($string, 'both', TRUE);

      url_title()

      Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog -in which you'd like to use the title of your entries in the URL. Example:

      +in which you'd like to use the title of your entries in the URL. Example:

      $title = "What's wrong with CSS?";

      $url_title = url_title($title);

      -// Produces: Whats-wrong-with-CSS +// Produces: Whats-wrong-with-CSS
      -

      The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

      +

      The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

      $title = "What's wrong with CSS?";

      $url_title = url_title($title, 'underscore');

      -// Produces: Whats_wrong_with_CSS +// Produces: Whats_wrong_with_CSS
      -

      The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean TRUE/FALSE:

      +

      The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean TRUE/FALSE:

      $title = "What's wrong with CSS?";

      $url_title = url_title($title, 'underscore', TRUE);

      -// Produces: whats_wrong_with_css +// Produces: whats_wrong_with_css

      prep_url()

      -

      This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:

      +

      This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:

      $url = "example.com";

      $url = prep_url($url);
      @@ -250,7 +250,7 @@ $url = prep_url($url);
      to the controller you want to direct to will create the link. The function will build the URL based on your config file values.

      The optional second parameter allows you to choose between the "location" -method (default) or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code - this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with 'location' redirects, and not 'refresh'. Examples:

      +method (default) or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code - this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with 'location' redirects, and not 'refresh'. Examples:

      if ($logged_in == FALSE)
      {
      @@ -262,7 +262,7 @@ redirect('/article/13', 'location', 301);

      Note: In order for this function to work it must be used before anything is outputted to the browser since it utilizes server headers.
      -Note: For very fine grained control over headers, you should use the Output Library's set_header() function.

      +Note: For very fine grained control over headers, you should use the Output Library's set_header() function.

      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index b3d408c7d..ded9aaa35 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -78,7 +78,7 @@ Less then and greater than characters: < >
      Single and double quotes: '  "
      Dashes: -

      -

      This function ignores ampersands if they are part of existing character entities. Example:

      +

      This function ignores ampersands if they are part of existing character entities. Example:

      $string = xml_convert($string); diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index f62aadb5e..87da5189f 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -61,24 +61,24 @@ Installation Instructions
      1. Unzip the package.
      2. -
      3. Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
      4. -
      5. Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
      6. +
      7. Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
      8. +
      9. Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
      10. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.

      If you wish to increase security by hiding the location of your CodeIgniter files you can rename the system and application folders -to something more private. If you do rename them, you must open your main index.php file and set the $system_folder and $application_folder +to something more private. If you do rename them, you must open your main index.php file and set the $system_folder and $application_folder variables at the top of the file with the new name you've chosen.

      -

      For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn't abide by the .htaccess.

      +

      For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn't abide by the .htaccess.

      After moving them, open your main index.php file and set the $system_folder and $application_folder variables, preferably with a full path, e.g. '/www/MyUser/system'.

      - One additional measure to take in production environments is to disable - PHP error reporting and any other development-only functionality. In CodeIgniter, - this can be done by setting the ENVIRONMENT constant, which is - more fully described on the security page. + One additional measure to take in production environments is to disable + PHP error reporting and any other development-only functionality. In CodeIgniter, + this can be done by setting the ENVIRONMENT constant, which is + more fully described on the security page.

      That's it!

      diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index f99fc0a32..2a50b8dbf 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -61,8 +61,8 @@ Trouble Shooting does not support the PATH_INFO variable needed to serve search-engine friendly URLs. As a first step, open your application/config/config.php file and look for the URI Protocol -information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need -to force CodeIgniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:

      +information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need +to force CodeIgniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:

      $config['index_page'] = "index.php"; diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index e6bb9480e..f7ffac74e 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -57,7 +57,7 @@ Upgrading from 1.2 to 1.3

      Upgrading from 1.2 to 1.3

      -

      Note: The instructions on this page assume you are running version 1.2. If you +

      Note: The instructions on this page assume you are running version 1.2. If you have not upgraded to that version please do so first.

      @@ -72,8 +72,8 @@ with a static one.

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

        -
      • application/models/   (new for 1.3)
      • -
      • codeigniter   (new for 1.3)
      • +
      • application/models/   (new for 1.3)
      • +
      • codeigniter   (new for 1.3)
      • drivers
      • helpers
      • init
      • @@ -109,7 +109,7 @@ replace this folder:

        Step 3: Update your index.php file

        -

        Please open your main index.php file (located at your root). At the very bottom of the file, change this:

        +

        Please open your main index.php file (located at your root). At the very bottom of the file, change this:

        require_once BASEPATH.'libraries/Front_controller'.EXT; diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index a7025f2a7..7541a83ec 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -57,7 +57,7 @@ Upgrading from 1.3 to 1.3.1

        Upgrading from 1.3 to 1.3.1

        -

        Note: The instructions on this page assume you are running version 1.3. If you +

        Note: The instructions on this page assume you are running version 1.3. If you have not upgraded to that version please do so first.

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

        diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 3b71594dc..4fcbb46b9 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -57,7 +57,7 @@ Upgrading from 1.3.1 to 1.3.2

        Upgrading from 1.3.1 to 1.3.2

        -

        Note: The instructions on this page assume you are running version 1.3.1. If you +

        Note: The instructions on this page assume you are running version 1.3.1. If you have not upgraded to that version please do so first.

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

        diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index a81f67bf5..c63465955 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -57,7 +57,7 @@ Upgrading from 1.3.2 to 1.3.3

        Upgrading from 1.3.2 to 1.3.3

        -

        Note: The instructions on this page assume you are running version 1.3.2. If you +

        Note: The instructions on this page assume you are running version 1.3.2. If you have not upgraded to that version please do so first.

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

        @@ -83,9 +83,9 @@ have not upgraded to that version please do so first.

        If you are NOT using CodeIgniter's Models feature disregard this step.

        -

        As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This -allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting -to your database prior to a model being loaded you will have to update your code. There are several options for connecting, +

        As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This +allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting +to your database prior to a model being loaded you will have to update your code. There are several options for connecting, as described here.

        diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 234e2f5b3..2049628a6 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -57,7 +57,7 @@ Upgrading from 1.3.3 to 1.4.0

        Upgrading from 1.3.3 to 1.4.0

        -

        Note: The instructions on this page assume you are running version 1.3.3. If you +

        Note: The instructions on this page assume you are running version 1.3.3. If you have not upgraded to that version please do so first.

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

        @@ -95,7 +95,7 @@ have not upgraded to that version please do so first.

        |-------------------------------------------------------------------------- | | 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. +| setting this variable to TRUE (boolean). See the user guide for details. | */ $config['enable_hooks'] = FALSE; @@ -111,7 +111,7 @@ $config['enable_hooks'] = FALSE; | get a warning message. | | As a security measure you are STRONGLY encouraged to restrict URLs to -| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- +| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 79e51e4ab..c19143c64 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -56,7 +56,7 @@ Upgrading from 1.4.0 to 1.4.1

        Upgrading from 1.4.0 to 1.4.1

        -

        Note: The instructions on this page assume you are running version 1.4.0. If you +

        Note: The instructions on this page assume you are running version 1.4.0. If you have not upgraded to that version please do so first.

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

        @@ -88,16 +88,16 @@ have not upgraded to that version please do so first.

        | Output Compression |-------------------------------------------------------------------------- | -| Enables Gzip output compression for faster page loads. When enabled, +| Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | -| VERY IMPORTANT: If you are getting a blank page when compression is enabled it +| VERY IMPORTANT: If you are getting a blank page when compression is enabled it | 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 +| 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; diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 9cd0089c0..342d486df 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -57,7 +57,7 @@ Upgrading from 1.4.1 to 1.5.0

        Upgrading from 1.4.1 to 1.5.0

        -

        Note: The instructions on this page assume you are running version 1.4.1. If you +

        Note: The instructions on this page assume you are running version 1.4.1. If you have not upgraded to that version please do so first.

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

        @@ -105,7 +105,7 @@ $db['default']['cachedir'] = ''; |-------------------------------------------------------------------------- | | This item allows you to set the filename/classname prefix when extending -| native libraries. For more information please see the user guide: +| native libraries. For more information please see the user guide: | | http://codeigniter.com/user_guide/general/core_classes.html | http://codeigniter.com/user_guide/general/creating_libraries.html @@ -120,7 +120,7 @@ $config['subclass_prefix'] = 'MY_'; | | If your PHP installation does not have short tag support enabled CI | can rewrite the tags on-the-fly, enabling you to utilize that syntax -| in your view files. Options are TRUE or FALSE (boolean) +| in your view files. Options are TRUE or FALSE (boolean) | */ $config['rewrite_short_tags'] = FALSE; @@ -136,7 +136,7 @@ $config['rewrite_short_tags'] = FALSE; |-------------------------------------------------------------------------- | | If you would like errors or debug messages logged set this variable to -| TRUE (boolean). Note: You must set the file permissions on the "logs" folder +| TRUE (boolean). Note: You must set the file permissions on the "logs" folder | such that it is writable. | */ diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 136e3090b..f601a252e 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -57,7 +57,7 @@ Upgrading from 1.5.0 to 1.5.2

        Upgrading from 1.5.0 to 1.5.2

        -

        Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you +

        Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you have not upgraded to that version please do so first.

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

        diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index 2adeff379..d06f58ec9 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -84,16 +84,16 @@ Upgrading from 1.5.4 to 1.6.0

        Add the following to application/config/autoload.php

        /*
        | -------------------------------------------------------------------
        - | Auto-load Model files
        + | Auto-load Model files
        | -------------------------------------------------------------------
        | Prototype:
        |
        - | $autoload['model'] = array('my_model');
        + | $autoload['model'] = array('my_model');
        |
        */

        $autoload['model'] = array();

        -

        Step 4: Add to your database.php

        +

        Step 4: Add to your database.php

        Make the following changes to your application/config/database.php file:

        Add the following variable above the database configuration options, with $active_group

        $active_record = TRUE;

        diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 6fd92f52a..01597a416 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -88,14 +88,14 @@ Here is an example of what this column might look like for MySQL:

        ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL -

        You'll find more information regarding the new Session functionality in the Session class page.

        +

        You'll find more information regarding the new Session functionality in the Session class page.

        Step 3: Update your Validation Syntax

        -

        This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which -deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to -migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.

        +

        This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which +deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to +migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.

        diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index cd39d924d..0b24079ef 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -69,8 +69,8 @@ Upgrading from 1.7.2 to 2.0.0

        Step 2: Adjust get_dir_file_info() where necessary

        -

        Version 2.0.0 brings a non-backwards compatible change to get_dir_file_info() in the File Helper. Non-backwards compatible changes are extremely rare - in CodeIgniter, but this one we feel was warranted due to how easy it was to create serious server performance issues. If you need +

        Version 2.0.0 brings a non-backwards compatible change to get_dir_file_info() in the File Helper. Non-backwards compatible changes are extremely rare + in CodeIgniter, but this one we feel was warranted due to how easy it was to create serious server performance issues. If you need recursiveness where you are using this helper function, change such instances, setting the second parameter, $top_level_only to FALSE:

        get_dir_file_info('/path/to/directory', FALSE); @@ -79,7 +79,7 @@ Upgrading from 1.7.2 to 2.0.0

        Step 3: Convert your Plugins to Helpers

        -

        2.0.0 gets rid of the "Plugin" system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of: +

        2.0.0 gets rid of the "Plugin" system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of: $this->load->plugin('foo'); @@ -94,7 +94,7 @@ to

        Note: If your application does not use the Encryption library, does not store Encrypted data permanently, or is on an environment that does not support Mcrypt, you may skip this step.

        The Encryption library has had a number of improvements, some for encryption strength and some for performance, that has an unavoidable consequence of - making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has + making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has been added, encode_from_legacy() that will decode the data with the original algorithm and return a re-encoded string using the improved methods. This will enable you to easily replace stale encrypted data with fresh in your applications, either on the fly or en masse.

        @@ -104,7 +104,7 @@ to

        The compatibility helper has been removed from the CodeIgniter core. All methods in it should be natively available in supported PHP versions.

        Step 6: Update Class extension

        -

        All core classes are now prefixed with CI_. Update Models and Controllers to extend CI_Model and CI_Controller, respectively.

        +

        All core classes are now prefixed with CI_. Update Models and Controllers to extend CI_Model and CI_Controller, respectively.

        Step 7: Update Parent Constructor calls

        All native CodeIgniter classes now use the PHP 5 __construct() convention. Please update extended libraries to call parent::__construct().

        diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html index 93c537227..d457d8bbb 100644 --- a/user_guide/installation/upgrade_202.html +++ b/user_guide/installation/upgrade_202.html @@ -76,7 +76,7 @@ Upgrading from 2.0.1 to 2.0.2

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

        -

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

        +

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

        diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index d1c9a940f..7dbc907ea 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -69,7 +69,7 @@ Upgrading from 2.0.2 to 2.0.3

        Step 2: Update CodeIgniter files

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

        - +

        Step 3: Update your main index.php file

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

        @@ -81,7 +81,7 @@ Upgrading from 2.0.2 to 2.0.3

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

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

        -

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

        +

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

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

        @@ -101,10 +101,10 @@ Upgrading from 2.0.2 to 2.0.3 CREATE INDEX last_activity_idx ON ci_sessions(last_activity); ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120); - - - - + + + + diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index d2fc20d18..add7228c8 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -61,7 +61,7 @@ Upgrading from Beta 1.0 to Beta 1.1

        Step 1: Replace your index file

        -

        Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.

        +

        Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.

        Step 2: Relocate your config folder

        @@ -91,7 +91,7 @@ the following item to your version: language/english/calendar_lang.phpStep 5: Edit your config file -

        The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:

        +

        The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:

        $conf['cookie_prefix'] = "";
        $conf['cookie_domain'] = "";
        @@ -112,7 +112,7 @@ $config['cookie_path'] = "/";
        |------------------------------------------------
        |
        | This item determines which server global
        -| should be used to retrieve the URI string. The
        +| should be used to retrieve the 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:
        diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 4dadf6b83..c29acb7b2 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -83,7 +83,7 @@ timing of the entire system execution to be shown.

        Using the Benchmark Class

        -

        The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:

        +

        The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:

        1. Mark a start point
        2. @@ -101,7 +101,7 @@ $this->benchmark->mark('code_end');

          echo $this->benchmark->elapsed_time('code_start', 'code_end'); -

          Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can +

          Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can use any words you want, and you can set multiple sets of markers. Consider this example:

          $this->benchmark->mark('dog');
          @@ -154,8 +154,8 @@ is sent to the browser, simply place this in one of your view templates:

          <?php echo $this->benchmark->elapsed_time();?>

          You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are -not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final -output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

          +not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final +output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

          An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

          {elapsed_time} diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index 3fa9fa6a4..190232e4b 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -58,7 +58,7 @@ Caching Driver

          Caching Driver

          -

          CodeIgniter features wrappers around some of the most popular forms of fast and dynamic caching. All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.

          +

          CodeIgniter features wrappers around some of the most popular forms of fast and dynamic caching. All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.

          Table of Contents

            @@ -97,7 +97,7 @@ echo $foo;

            is_supported(driver['string'])

            -

            This function is automatically called when accessing drivers via $this->cache->get(). However, if the individual drivers are used, make sure to call this function to ensure the driver is supported in the hosting environment.

            +

            This function is automatically called when accessing drivers via $this->cache->get(). However, if the individual drivers are used, make sure to call this function to ensure the driver is supported in the hosting environment.

            if ($this->cache->apc->is_supported())
            @@ -111,23 +111,23 @@ if ($this->cache->apc->is_supported())

            get(id['string'])

            -

            This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return FALSE.

            +

            This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return FALSE.

            $foo = $this->cache->get('my_cached_item');

            save(id['string'], data['mixed'], ttl['int'])

            -

            This function will save an item to the cache store. If saving fails, the function will return FALSE.

            +

            This function will save an item to the cache store. If saving fails, the function will return FALSE.

            The optional third parameter (Time To Live) defaults to 60 seconds.

            $this->cache->save('cache_item_id', 'data_to_cache');

            delete(id['string'])

            -

            This function will delete a specific item from the cache store. If item deletion fails, the function will return FALSE.

            +

            This function will delete a specific item from the cache store. If item deletion fails, the function will return FALSE.

            $this->cache->delete('cache_item_id');

            clean()

            -

            This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return FALSE.

            +

            This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return FALSE.

            $this->cache->clean(); @@ -154,7 +154,7 @@ if ($this->cache->apc->is_supported())

            File-based Caching

            -

            Unlike caching from the Output Class, the driver file-based caching allows for pieces of view files to be cached. Use this with care, and make sure to benchmark your application, as a point can come where disk I/O will negate positive gains by caching.

            +

            Unlike caching from the Output Class, the driver file-based caching allows for pieces of view files to be cached. Use this with care, and make sure to benchmark your application, as a point can come where disk I/O will negate positive gains by caching.

            All of the functions listed above can be accessed without passing a specific adapter to the driver loader as follows:

            $this->load->driver('cache');
            @@ -172,7 +172,7 @@ if ($this->cache->apc->is_supported())

            Dummy Cache

            -

            This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't support your chosen cache.

            +

            This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't support your chosen cache.

            diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 06dfec71e..e1af71cc9 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -86,13 +86,13 @@ To show a calendar for a specific month and year you will pass this information
            echo $this->calendar->generate(2006, 6);
            -

            The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

            +

            The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

            Passing Data to your Calendar Cells

            To add data to your calendar cells involves creating an associative array in which the keys correspond to the days -you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar -generating function. Consider this example:

            +you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar +generating function. Consider this example:

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

            @@ -114,7 +114,7 @@ how data passed to your cells is handled so you can pass different types of info

            Setting Display Preferences

            -

            There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an +

            There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an array of preferences in the second parameter of the loading function. Here is an example:

            @@ -129,7 +129,7 @@ $this->load->library('calendar', $prefs);

            echo $this->calendar->generate();
            -

            The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information +

            The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information regarding preferences below.

            @@ -180,7 +180,7 @@ echo $this->calendar->generate($this->uri->segment(3), $this->ur
            • You must set the "show_next_prev" to TRUE.
            • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
            • -
            • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
            • +
            • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
            diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 433bd5089..f084d5dcf 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -61,13 +61,13 @@ Shopping Cart Class

            The Cart Class permits items to be added to a session that stays active while a user is browsing your site. These items can be retrieved and displayed in a standard "shopping cart" format, allowing the user to update the quantity or remove items from the cart.

            -

            Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

            +

            Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

            Initializing the Shopping Cart Class

            Important: The Cart class utilizes CodeIgniter's -Session Class to save the cart information to a database, so before using the Cart class you must set up a database table +Session Class to save the cart information to a database, so before using the Cart class you must set up a database table as indicated in the Session Documentation , and set the session preferences in your application/config/config.php file to utilize a database.

            To initialize the Shopping Cart Class in your controller constructor, use the $this->load->library function:

            @@ -106,19 +106,19 @@ It is intended to be used in cases where your product has options associated wit
          • qty - The quantity being purchased.
          • price - The price of the item.
          • name - The name of the item. -
          • options - Any additional attributes that are needed to identify the product. These must be passed via an array. +
          • options - Any additional attributes that are needed to identify the product. These must be passed via an array.
          -

          In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so +

          In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so please do NOT use those words as index names when inserting data into the cart.

          -

          Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among +

          Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among all your products in order to make displaying the information in a table easier.

          Adding Multiple Items to The Cart

          -

          By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow +

          By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow people to select from among several items on the same page.

          @@ -170,10 +170,10 @@ $this->cart->insert($data); <table cellpadding="6" cellspacing="1" style="width:100%" border="0"> <tr> - <th>QTY</th> - <th>Item Description</th> - <th style="text-align:right">Item Price</th> - <th style="text-align:right">Sub-Total</th> + <th>QTY</th> + <th>Item Description</th> + <th style="text-align:right">Item Price</th> + <th style="text-align:right">Sub-Total</th> </tr> <?php $i = 1; ?> @@ -183,8 +183,8 @@ $this->cart->insert($data); <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?> <tr> - <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td> - <td> + <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td> + <td> <?php echo $items['name']; ?> <?php if ($this->cart->has_options($items['rowid']) == TRUE): ?> @@ -199,9 +199,9 @@ $this->cart->insert($data); <?php endif; ?> - </td> - <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> - <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> + </td> + <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> + <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> </tr> <?php $i++; ?> @@ -209,9 +209,9 @@ $this->cart->insert($data); <?php endforeach; ?> <tr> - <td colspan="2"> </td> - <td class="right"><strong>Total</strong></td> - <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td> + <td colspan="2"> </td> + <td class="right"><strong>Total</strong></td> + <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td> </tr> </table> @@ -265,11 +265,11 @@ $this->cart->update($data);
          -

          What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a +

          What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a unique ID is created is so that identical products with different options can be managed by the cart.

          -

          For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be -identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this +

          For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be +identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this difference so that the two sizes of shirts can be managed independently. It does so by creating a unique "row ID" based on the product ID and any options associated with it.

          In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself @@ -311,7 +311,7 @@ function when the update form is submitted. Please examine the construction of t

          $this->cart->has_options(rowid);

          -

          Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

          +

          Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

          $this->cart->product_options(rowid);

          @@ -322,7 +322,7 @@ function when the update form is submitted. Please examine the construction of t

          $this->cart->destroy();

          -

          Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

          +

          Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

          diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index c0192ca0a..2433ec4ad 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -58,7 +58,7 @@ Config Class

          Config Class

          -

          The Config class provides a means to retrieve configuration preferences. These preferences can +

          The Config class provides a means to retrieve configuration preferences. These preferences can come from the default config file (application/config/config.php) or from your own custom config files.

          Note: This class is initialized automatically by the system so there is no need to do it manually.

          @@ -66,7 +66,7 @@ come from the default config file (application/config/config.php) o

          Anatomy of a Config File

          -

          By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using +

          By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using your text editor you'll see that config items are stored in an array called $config.

          You can add your own config items to @@ -74,7 +74,7 @@ this file, or if you prefer to keep your configuration items separate (assuming simply create your own file and save it in config folder.

          Note: If you do create your own config files use the same format as the primary one, storing your items in -an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though +an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though the array has the same name (assuming an array index is not named the same as another).

          Loading a Config File

          @@ -92,12 +92,12 @@ so you will only need to load a config file if you have created your own.

          Where filename is the name of your config file, without the .php file extension.

          -

          If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if -you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE +

          If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if +you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE and each config file will be stored in an array index corresponding to the name of the config file. Example:

          -// Stored in an array with this prototype: $this->config['blog_settings'] = $config
          +// Stored in an array with this prototype: $this->config['blog_settings'] = $config
          $this->config->load('blog_settings', TRUE);

          Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.

          @@ -109,7 +109,7 @@ $this->config->load('blog_settings', TRUE);
        3. Auto-loading -

          If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, +

          If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, open the autoload.php file, located at application/config/autoload.php, and add your config file as indicated in the file.

        4. @@ -129,7 +129,7 @@ indicated in the file.

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

          If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index -you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

          +you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

          // Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
          @@ -154,32 +154,32 @@ $site_name = $blog_config['site_name'];

          Environments

          - You may load different configuration files depending on the current environment. - The ENVIRONMENT constant is defined in index.php, and is described - in detail in the Handling Environments - section. + You may load different configuration files depending on the current environment. + The ENVIRONMENT constant is defined in index.php, and is described + in detail in the Handling Environments + section.

          - To create an environment-specific configuration file, - create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php + To create an environment-specific configuration file, + create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php

          For example, to create a production-only config.php, you would:

            -
          1. Create the directory application/config/production/
          2. -
          3. Copy your existing config.php into the above directory
          4. -
          5. Edit application/config/production/config.php so it contains your production settings
          6. +
          7. Create the directory application/config/production/
          8. +
          9. Copy your existing config.php into the above directory
          10. +
          11. Edit application/config/production/config.php so it contains your production settings

          - When you set the ENVIRONMENT constant to 'production', the settings - for your new production-only config.php will be loaded. + When you set the ENVIRONMENT constant to 'production', the settings + for your new production-only config.php will be loaded.

          You can place the following configuration files in environment-specific folders:

          - +
          • Default CodeIgniter configuration files
          • Your own custom configuration files
          • diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 61e139187..5a8814d59 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -78,7 +78,7 @@ Email Class

            Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

            -

            Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your +

            Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your controllers.

            $this->load->library('email');
            @@ -103,7 +103,7 @@ echo $this->email->print_debugger();

            There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually as described here, or automatically via preferences stored in your config file, described below:

            -

            Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

            +

            Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

            $config['protocol'] = 'sendmail';
            $config['mailpath'] = '/usr/sbin/sendmail';
            @@ -117,7 +117,7 @@ $this->email->initialize($config);
            >

            Setting Email Preferences in a Config File

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

            @@ -156,13 +156,13 @@ will NOT need to use the $this->email->initialize() function if you s
    - + - + - + @@ -188,12 +188,12 @@ will NOT need to use the $this->email->initialize() function if you s $this->email->from('you@example.com', 'Your Name');

    $this->email->reply_to()

    -

    Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

    +

    Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

    $this->email->reply_to('you@example.com', 'Your Name');

    $this->email->to()

    -

    Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

    +

    Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

    $this->email->to('someone@example.com');$this->email->to('one@example.com, two@example.com, three@example.com'); @@ -221,14 +221,14 @@ $this->email->to($list);

    Sets the alternative email message body:

    $this->email->set_alt_message('This is the alternative message'); -

    This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative +

    This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative message with no HTML formatting which is added to the header string for people who do not accept HTML email. If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.

    $this->email->clear()

    -

    Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function +

    Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function in a loop, permitting the data to be reset between cycles.

    foreach ($list as $name => $address)
    {
    @@ -268,13 +268,13 @@ $this->email->send();

    $this->email->print_debugger()

    -

    Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

    +

    Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

    Overriding Word Wrapping

    If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can -get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override +get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override word wrapping within part of your message like this:

    The text of your email that
    diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 96ad54bc0..60099312c 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -58,9 +58,9 @@ Encryption Class

    Encryption Class

    -

    The Encryption Class provides two-way data encryption. It uses a scheme that either compiles +

    The Encryption Class provides two-way data encryption. It uses a scheme that either compiles the message using a randomly hashed bitwise XOR encoding scheme, or is encrypted using -the Mcrypt library. If Mcrypt is not available on your server the encoded message will +the Mcrypt library. If Mcrypt is not available on your server the encoded message will still provide a reasonable degree of security for encrypted sessions or other such "light" purposes. If Mcrypt is available, you'll be provided with a high degree of security appropriate for storage.

    @@ -72,7 +72,7 @@ In fact, the key you chose will provide the only means to decod so not only must you choose the key carefully, you must never change it if you intend use it for persistent data.

    It goes without saying that you should guard your key carefully. -Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control +Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control it's impossible to ensure key security so you may want to think carefully before using it for anything that requires high security, like storing credit card numbers.

    @@ -91,9 +91,9 @@ storage mechanism and pass the key dynamically when encoding/decoding.

    Message Length

    It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original -message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up +message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in -64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, +64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, for example, can only hold 4K of information.

    @@ -124,7 +124,7 @@ $encrypted_string = $this->encrypt->encode($msg, $key);

    $this->encrypt->decode()

    -

    Decrypts an encoded string. Example:

    +

    Decrypts an encoded string. Example:

    $encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
    @@ -142,9 +142,9 @@ $encrypted_string = $this->encrypt->decode($msg, $key);

    $this->encrypt->set_cipher();

    -

    Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

    +

    Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

    $this->encrypt->set_cipher(MCRYPT_BLOWFISH); -

    Please visit php.net for a list of available ciphers.

    +

    Please visit php.net for a list of available ciphers.

    If you'd like to manually test whether your server supports Mcrypt you can use:

    echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; @@ -152,13 +152,13 @@ $encrypted_string = $this->encrypt->decode($msg, $key);

    $this->encrypt->set_mode();

    -

    Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:

    +

    Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:

    $this->encrypt->set_mode(MCRYPT_MODE_CFB); -

    Please visit php.net for a list of available modes.

    +

    Please visit php.net for a list of available modes.

    $this->encrypt->sha1();

    -

    SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

    +

    SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

    $hash = $this->encrypt->sha1('Some string');

    Many PHP installations have SHA1 support by default so if all you need is to encode a hash it's simpler to use the native @@ -169,12 +169,12 @@ function:

    If your server does not support SHA1 you can use the provided function.

    $this->encrypt->encode_from_legacy($orig_data, $legacy_mode = MCRYPT_MODE_ECB, $key = '');

    -

    Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only - necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption - such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be +

    Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only + necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption + such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be destroyed since data encrypted prior to 2.x will not be decoded.

    -

    Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in +

    Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in the Encryption library have improved in CodeIgniter 2.x both for performance and security, and we do not wish to encourage continued use of the older methods. You can of course extend the Encryption library if you wish and replace the new methods with the old and retain seamless compatibility with CodeIgniter 1.x encrypted data, but this a decision that a developer should make cautiously and deliberately, if at all.

    @@ -195,13 +195,13 @@ function:

    - - +
    wrapchars76 Character count to wrap at.
    mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
    charsetutf-8Character set (utf-8, iso-8859-1, etc.).
    validateFALSETRUE or FALSE (boolean)Whether to validate the email address.validateFALSETRUE or FALSE (boolean)Whether to validate the email address.
    priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.
    crlf
    $legacy_mode MCRYPT_MODE_ECBThe Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will + The Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will assume that to be the case unless overridden by this parameter.
    $key n/aThe encryption key. This it typically specified in your config file as outlined above.The encryption key. This it typically specified in your config file as outlined above.
    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index a248267ae..e4e842e5f 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -58,7 +58,7 @@ File Uploading Class

    File Uploading Class

    -

    CodeIgniter's File Uploading Class permits files to be uploaded. You can set various +

    CodeIgniter's File Uploading Class permits files to be uploaded. You can set various preferences, restricting the type and size of the files.

    @@ -80,7 +80,7 @@ preferences, restricting the type and size of the files.

    -

    Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ +

    Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ folder:

    @@ -106,8 +106,8 @@ folder:

    </body> </html> -

    You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper -creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event +

    You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper +creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event the user does something wrong.

    @@ -138,7 +138,7 @@ In it, place this code and save it to your applications/views/ fold

    The Controller

    -

    Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ +

    Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ folder:

    @@ -162,8 +162,8 @@ class Upload extends CI_Controller { $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; - $config['max_width'] = '1024'; - $config['max_height'] = '768'; + $config['max_width'] = '1024'; + $config['max_height'] = '768'; $this->load->library('upload', $config); @@ -186,7 +186,7 @@ class Upload extends CI_Controller {

    The Upload Folder

    -

    You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called +

    You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called uploads and set its file permissions to 777.

    @@ -215,26 +215,26 @@ controller is correct it should work.

    Setting Preferences

    -

    Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you +

    Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you built above you set the following preferences:

    $config['upload_path'] = './uploads/';
    $config['allowed_types'] = 'gif|jpg|png';
    $config['max_size'] = '100';
    -$config['max_width'] = '1024';
    -$config['max_height'] = '768';
    +$config['max_width'] = '1024';
    +$config['max_height'] = '768';

    $this->load->library('upload', $config);

    -// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
    +// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
    $this->upload->initialize($config);
    -

    The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

    +

    The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

    Preferences

    -

    The following preferences are available. The default value indicates what will be used if you do not specify that preference.

    +

    The following preferences are available. The default value indicates what will be used if you do not specify that preference.

    @@ -248,14 +248,14 @@ $this->upload->initialize($config); - + - + @@ -264,7 +264,7 @@ $this->upload->initialize($config); @@ -280,28 +280,28 @@ $this->upload->initialize($config); - + - + - + - + @@ -323,7 +323,7 @@ $this->upload->initialize($config);

    Setting preferences in a config file

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

    @@ -335,7 +335,7 @@ will NOT need to use the $this->upload->initialize function if you sa

    $this->upload->do_upload()

    -

    Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field +

    Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field called userfile, and the form must be a "multipart type:

    <form method="post" action="some_action" enctype="multipart/form-data" /> @@ -349,11 +349,11 @@ $this->upload->do_upload($field_name)

    $this->upload->display_errors()

    -

    Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it +

    Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it returns the data so you can assign it however you need.

    Formatting Errors

    -

    By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

    +

    By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

    $this->upload->display_errors('<p>', '</p>'); @@ -403,7 +403,7 @@ Here is the array prototype:

    - + @@ -415,7 +415,7 @@ Here is the array prototype:

    - + @@ -424,10 +424,10 @@ Here is the array prototype:

    - + - +
    upload_path None NoneThe path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.The path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.
    allowed_types None NoneThe mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.
    None Desired file name -

    If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.

    +

    If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.

    max_size 0 NoneThe maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.The maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.
    max_width 0 NoneThe maximum width (in pixels) that the file can be. Set to zero for no limit.The maximum width (in pixels) that the file can be. Set to zero for no limit.
    max_height 0 NoneThe maximum height (in pixels) that the file can be. Set to zero for no limit.The maximum height (in pixels) that the file can be. Set to zero for no limit.
    max_filename 0 NoneThe maximum length that a file name can be. Set to zero for no limit.The maximum length that a file name can be. Set to zero for no limit.
    The file name without the extension
    orig_nameThe original file name. This is only useful if you use the encrypted name option.
    The original file name. This is only useful if you use the encrypted name option.
    client_name The file name as supplied by the client user agent, prior to any file name preparation or incrementing.
    The file size in kilobytes
    is_imageWhether the file is an image or not. 1 = image. 0 = not.
    Whether the file is an image or not. 1 = image. 0 = not.
    image_width Image width.
    Image height
    image_typeImage type. Typically the file extension without the period.
    Image type. Typically the file extension without the period.
    image_size_strA string containing the width and height. Useful to put into an image tag.
    A string containing the width and height. Useful to put into an image tag.
    diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 54908d41d..8fdcd1446 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -113,10 +113,10 @@ along with an error message describing the problem.
    1. Check for required data.
    2. Verify that the data is of the correct type, and meets the correct criteria. For example, if a username is submitted -it must be validated to contain only permitted characters. It must be of a minimum length, +it must be validated to contain only permitted characters. It must be of a minimum length, and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.
    3. Sanitize the data for security.
    4. -
    5. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    6. +
    7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    8. Prep the data for insertion in the database.
    @@ -150,7 +150,7 @@ Form validation, while simple to create, is generally very messy and tedious to

    The Form

    -

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ +

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ folder:

    @@ -191,7 +191,7 @@ folder:

    The Success Page

    -

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ +

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ folder:

    @@ -215,7 +215,7 @@ folder:

    The Controller

    -

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ +

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ folder:

    @@ -248,10 +248,10 @@ class Form extends CI_Controller { example.com/index.php/form/ -

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation +

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation rules yet.

    -

    Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() +

    Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() function only returns TRUE if it has successfully applied your rules without any of them failing.

    @@ -263,8 +263,8 @@ function only returns TRUE if it has successfully applied your rules
    1. It uses a form helper to create the form opening. -Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper -is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
    2. +Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper +is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
    3. At the top of the form you'll notice the following function call: <?php echo validation_errors(); ?> @@ -341,7 +341,7 @@ class Form extends CI_Controller { If you submit the form with all the fields populated you'll see your success page.

      Note: The form fields are not yet being re-populated with the data when -there is an error. We'll get to that shortly.

      +there is an error. We'll get to that shortly.

      @@ -387,7 +387,7 @@ $this->form_validation->set_rules($config);

      Cascading Rules

      -

      CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

      +

      CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

      $this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
      @@ -427,7 +427,7 @@ $this->form_validation->set_rules('email', 'Email', 'trim|required|va the "xss_clean" function, which removes malicious data.

      Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, -trim, MD5, etc.

      +trim, MD5, etc.

      Note: You will generally want to use the prepping functions after the validation rules so if there is an error, the original data will be shown in the form.

      @@ -438,7 +438,7 @@ the validation rules so if there is an error, the original data will be shown in

      Re-populating the form

      -

      Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions +

      Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions that permit you to do this. The one you will use most commonly is:

      set_value('field name') @@ -481,13 +481,13 @@ that permit you to do this. The one you will use most commonly is:

      -

      Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

      +

      Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

      Note: The Function Reference section below contains functions that permit you to re-populate <select> menus, radio buttons, and checkboxes.

      -

      Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

      +

      Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

      <input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" /> @@ -500,16 +500,16 @@ permit you to re-populate <select> menus, radio buttons, and checkboxes.

      Callbacks: Your own Validation Functions

      -

      The validation system supports callbacks to your own validation functions. This permits you to extend the validation class -to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can -create a callback function that does that. Let's create a example of this.

      +

      The validation system supports callbacks to your own validation functions. This permits you to extend the validation class +to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can +create a callback function that does that. Let's create a example of this.

      In your controller, change the "username" rule to this:

      $this->form_validation->set_rules('username', 'Username', 'callback_username_check'); -

      Then add a new function called username_check to your controller. Here's how your controller should now look:

      +

      Then add a new function called username_check to your controller. Here's how your controller should now look:

      -

      Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your +

      Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your callback function for you to process.

      To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

      -

      You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE +

      You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE it is assumed that the data is your newly processed form data.

      @@ -568,7 +568,7 @@ it is assumed that the data is your newly processed form data.

      Setting Error Messages

      -

      All of the native error messages are located in the following language file: language/english/form_validation_lang.php

      +

      All of the native error messages are located in the following language file: language/english/form_validation_lang.php

      To set your own custom message you can either edit that file, or use the following function:

      @@ -582,7 +582,7 @@ it is assumed that the data is your newly processed form data.

      $this->form_validation->set_message('username_check') -

      You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

      +

      You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

      $this->form_validation->set_message('required', 'Your custom message here'); @@ -669,9 +669,9 @@ individually.

      <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" /> -

      If there are no errors, nothing will be shown. If there is an error, the message will appear.

      +

      If there are no errors, nothing will be shown. If there is an error, the message will appear.

      -

      Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

      +

      Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

      <?php echo form_error('options[size]'); ?>
      <input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" /> @@ -688,8 +688,8 @@ individually.

      Saving Sets of Validation Rules to a Config File

      -

      A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You -can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or +

      A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You +can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or you can manually call each set as needed.

      How to save your rules

      @@ -728,8 +728,8 @@ $config = array(

      Creating Sets of Rules

      -

      In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. -We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

      +

      In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. +We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

      $config = array(
      @@ -783,7 +783,7 @@ We've arbitrarily called these two rules "signup" and "email". You can name your

      Calling a Specific Rule Group

      -

      In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

      +

      In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

      if ($this->form_validation->run('signup') == FALSE)
      @@ -800,8 +800,8 @@ else

      Associating a Controller Function with a Rule Group

      -

      An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you -have a controller named Member and a function named signup. Here's what your class might look like:

      +

      An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you +have a controller named Member and a function named signup. Here's what your class might look like:

      <?php

      @@ -860,7 +860,7 @@ class Member extends CI_Controller {

      Using Arrays as Field Names

      -

      The Form Validation class supports the use of arrays as field names. Consider this example:

      +

      The Form Validation class supports the use of arrays as field names. Consider this example:

      <input type="text" name="options[]" value="" size="50" /> @@ -1147,13 +1147,13 @@ like trim, htmlspecialchars, urldecode, etc.

      $this->form_validation->run(); -

      Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation +

      Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation group via the function, as described in: Saving Groups of Validation Rules to a Config File.

      $this->form_validation->set_message();

      -

      Permits you to set custom error messages. See Setting Error Messages above.

      +

      Permits you to set custom error messages. See Setting Error Messages above.

       

      @@ -1161,25 +1161,25 @@ group via the function, as described in: Saving Groups

      Helper Reference

      -

      The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they +

      The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they do not require you to prepend them with $this->form_validation.

      form_error()

      -

      Shows an individual error message associated with the field name supplied to the function. Example:

      +

      Shows an individual error message associated with the field name supplied to the function. Example:

      <?php echo form_error('username'); ?> -

      The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

      +

      The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

      validation_errors()

      -

      Shows all error messages as a string: Example:

      +

      Shows all error messages as a string: Example:

      <?php echo validation_errors(); ?> -

      The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

      +

      The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

      @@ -1194,7 +1194,7 @@ The second (optional) parameter allows you to set a default value for the form.

      set_select()

      -

      If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +

      If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter must contain the name of the select menu, the second parameter must contain the value of each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

      @@ -1202,16 +1202,16 @@ each item, and the third (optional) parameter lets you set an item as the defaul <select name="myselect">
      -<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
      -<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
      -<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
      +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
      +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
      +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
      </select>

      set_checkbox()

      -

      Permits you to display a checkbox in the state it was submitted. The first parameter +

      Permits you to display a checkbox in the state it was submitted. The first parameter must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

      <input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
      @@ -1222,8 +1222,8 @@ must contain the name of the checkbox, the second parameter must contain its val

      Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

      -<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
      -<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
      +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
      +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index c318bc15a..43b949a50 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -59,7 +59,7 @@ FTP Class

      FTP Class

      CodeIgniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed, -and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

      +and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

      Note:  SFTP and SSL FTP protocols are not supported, only standard FTP.

      @@ -74,7 +74,7 @@ and deleted. The FTP class also includes a "mirroring" function that permits an

      Usage Examples

      In this example a connection is opened to the FTP server, and a local file is read and uploaded in ASCII mode. The -file permissions are set to 755. Note: Setting permissions requires PHP 5.

      +file permissions are set to 755. Note: Setting permissions requires PHP 5.

      $this->load->library('ftp');
      @@ -157,26 +157,26 @@ $this->ftp->connect($config);

      Setting FTP Preferences in a Config File

      If you prefer you can store your FTP preferences in a config file. -Simply create a new file called the ftp.php, add the $config +Simply create a new file called the ftp.php, add the $config array in that file. Then save the file at config/ftp.php and it will be used automatically.

      Available connection options:

        -
      • hostname - the FTP hostname. Usually something like:  ftp.example.com
      • +
      • hostname - the FTP hostname. Usually something like:  ftp.example.com
      • username - the FTP username.
      • password - the FTP password.
      • port - The port number. Set to 21 by default.
      • debug - TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
      • -
      • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
      • +
      • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.

      $this->ftp->upload()

      -

      Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. +

      Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. Example:

      @@ -190,7 +190,7 @@ Example:

      $this->ftp->download()

      -

      Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. +

      Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. Example:

      $this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii'); @@ -202,7 +202,7 @@ Example:

      $this->ftp->rename()

      -

      Permits you to rename a file. Supply the source file name/path and the new file name/path.

      +

      Permits you to rename a file. Supply the source file name/path and the new file name/path.

      // Renames green.html to blue.html
      @@ -210,7 +210,7 @@ $this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html');

      $this->ftp->move()

      -

      Lets you move a file. Supply the source and destination paths:

      +

      Lets you move a file. Supply the source and destination paths:

      // Moves blog.html from "joe" to "fred"
      @@ -221,7 +221,7 @@ $this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html');

      $this->ftp->delete_file()

      -

      Lets you delete a file. Supply the source path with the file name.

      +

      Lets you delete a file. Supply the source path with the file name.

      $this->ftp->delete_file('/public_html/joe/blog.html'); @@ -229,10 +229,10 @@ $this->ftp->delete_file('/public_html/joe/blog.html');

      $this->ftp->delete_dir()

      -

      Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

      +

      Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

      -

      Important  Be VERY careful with this function. It will recursively delete -everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. +

      Important  Be VERY careful with this function. It will recursively delete +everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. Try using the list_files() function first to verify that your path is correct.

      @@ -242,7 +242,7 @@ $this->ftp->delete_dir('/public_html/path/to/folder/');

      $this->ftp->list_files()

      -

      Permits you to retrieve a list of files on your server returned as an array. You must supply +

      Permits you to retrieve a list of files on your server returned as an array. You must supply the path to the desired directory.

      @@ -255,7 +255,7 @@ print_r($list);

      $this->ftp->mirror()

      Recursively reads a local folder and everything it contains (including sub-folders) and creates a -mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. +mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. You must supply a source path and a destination path:

      @@ -266,7 +266,7 @@ $this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');

      $this->ftp->mkdir()

      -

      Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. +

      Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. Permissions can be set by passed an octal value in the second parameter (if you are running PHP 5).

      @@ -277,7 +277,7 @@ $this->ftp->mkdir('/public_html/foo/bar/', DIR_WRITE_MODE);

      $this->ftp->chmod()

      -

      Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

      +

      Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

      // Chmod "bar" to 777
      @@ -288,7 +288,7 @@ $this->ftp->chmod('/public_html/foo/bar/', DIR_WRITE_MODE);

      $this->ftp->close();

      -

      Closes the connection to your server. It's recommended that you use this when you are finished uploading.

      +

      Closes the connection to your server. It's recommended that you use this when you are finished uploading.

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index e6d38fc96..dbf07768e 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -68,11 +68,11 @@ Image Manipulation Class
    4. Image Watermarking
    5. -

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

      +

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

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

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

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

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

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

      +

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

      Processing an Image

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

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

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

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

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

    6. $this->image_lib->clear()
    7. -

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

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

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

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

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

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

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

      Preferences

      -

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

      +

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

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

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

      Availability Legend:

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

      Setting preferences in a config file

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

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

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

      -

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

      +

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

      Creating a Thumbnail

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

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

      +

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

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

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

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

      $this->image_lib->rotate()

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

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

      +calling the watermark function. Here is an example:

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

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

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

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

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

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

      Security Filtering

      -

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

      +

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

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

      XSS Filtering

      -

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

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

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

      Using POST, COOKIE, or SERVER Data

      -

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

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

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

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

      -

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

      +

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

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

      $this->input->set_cookie()

      -

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

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

      Array Method

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

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

      -

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

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

      -

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

      +

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

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

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

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

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

      $this->input->cookie()

      -

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

      +

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

      cookie('some_cookie');

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

      -

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

      +

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

      cookie('some_cookie', TRUE);

      $this->input->ip_address()

      -

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

      +

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

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

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

      -

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

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

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

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

      $this->input->request_headers()

      -

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

      +

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

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

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

      +

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

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

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

      +

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

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

      Setup and Configuration

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

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

      +

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

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

      Effects

      -

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

      +

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

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

      hide() / show()

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

      -

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

      +

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

      • "target" will be any valid jQuery selector or selectors.
      • @@ -162,8 +162,8 @@ $this->jquery->click('#trigger', $this->jquery->animate('#note', $pa

        fadeIn() / fadeOut()

        -

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

        +

        $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.
        • @@ -182,8 +182,8 @@ $this->jquery->click('#trigger', $this->jquery->animate('#note', $pa

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

          +

          $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.
          • @@ -193,9 +193,9 @@ $this->jquery->click('#trigger', $this->jquery->animate('#note', $pa

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

            +

            $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.
            • diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 1b253fa00..75863c2ac 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -60,30 +60,30 @@ Language Class

              The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

              -

              In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create +

              In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create your own language files as needed in order to display error and other messages in other languages.

              -

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside -your application folder and store them there. CodeIgniter will look first in your application/language -directory. If the directory does not exist or the specified language is not located there CI will instead look in your global +

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside +your application folder and store them there. CodeIgniter will look first in your application/language +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

              -

              Note:  Each language should be stored in its own folder. For example, the English files are located at: +

              Note:  Each language should be stored in its own folder. For example, the English files are located at: system/language/english

              Creating Language Files

              -

              Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file -containing error messages. You might name it: error_lang.php

              +

              Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: error_lang.php

              Within the file you will assign each line of text to an array called $lang with this prototype:

              $lang['language_key'] = "The actual message to be shown";

              Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with -similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

              +similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

              $lang['error_email_missing'] = "You must submit an email address";
              $lang['error_url_missing'] = "You must submit a URL";
              @@ -92,12 +92,12 @@ $lang['error_username_missing'] = "You must submit a username";
              Loading A Language File -

              In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

              +

              In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

              $this->lang->load('filename', 'language');

              Where filename is the name of the file you wish to load (without the file extension), and language -is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your application/config/config.php file will be used.

              @@ -109,7 +109,7 @@ is the language set containing it (ie, english). If the second parameter is miss

              Where language_key is the array key corresponding to the line you wish to show.

              -

              Note: This function simply returns the line. It does not echo it for you.

              +

              Note: This function simply returns the line. It does not echo it for you.

              Using language lines as form labels

              diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 50ec60c1f..1d93af5ed 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -58,7 +58,7 @@ Loader Class

              Loader Class

              -

              Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, +

              Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, Helpers, Models, or your own files.

              Note: This class is initialized automatically by the system so there is no need to do it manually.

              @@ -69,7 +69,7 @@ Loader Class

              $this->load->library('class_name', $config, 'object name')

              -

              This function is used to load core classes. Where class_name is the name of the class you want to load. +

              This function is used to load core classes. Where class_name is the name of the class you want to load. Note: We use the terms "class" and "library" interchangeably.

              For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:

              @@ -96,7 +96,7 @@ For example, if you have file located at:

              Setting options

              -

              The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

              +

              The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

              $config = array (
              @@ -113,7 +113,7 @@ $this->load->library('email', $config);

              Assigning a Library to a different object name

              -

              If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it +

              If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it will be assigned to a variable named $this->session.

              If you prefer to set your own class names you can pass its value to the third parameter:

              @@ -131,20 +131,20 @@ $this->my_session

              $this->load->view('file_name', $data, true/false)

              -

              This function is used to load your View files. If you haven't read the Views section of the +

              This function is used to load your View files. If you haven't read the Views section of the user guide it is recommended that you do since it shows you how this function is typically used.

              -

              The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

              +

              The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

              The second optional parameter can take an associative array or an object as input, which it runs through the PHP extract function to -convert to variables that can be used in your view files. Again, read the Views page to learn +convert to variables that can be used in your view files. Again, read the Views page to learn how this might be useful.

              The third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

              +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

              $string = $this->load->view('myfile', '', true); @@ -159,7 +159,7 @@ to your browser. Remember to assign it to a variable if you want the data return
              $this->fubar->function();

              $this->load->database('options', true/false)

              -

              This function lets you load the database class. The two parameters are optional. Please see the +

              This function lets you load the database class. The two parameters are optional. Please see the database section for more info.

              @@ -168,9 +168,9 @@ $this->fubar->function();

              $this->load->vars($array)

              This function takes an associative array as input and generates variables using the PHP extract function. -This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might want to use this function independently is if you would like to set some global variables in the constructor of your controller -and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.

              @@ -180,7 +180,7 @@ and merged into one array for conversion to variables.

              $this->load->file('filepath/filename', true/false)

              -

              This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +

              This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) it will instead return the data as a string.

              @@ -194,7 +194,7 @@ it will instead return the data as a string.

              Application "Packages"

              -

              An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

              +

              An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

              Sample Package "Foo Bar" Directory Map

              @@ -210,18 +210,18 @@ libraries/
              models/
              -

              Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

              +

              Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

              $this->load->add_package_path()

              -

              Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

              +

              Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

              $this->load->add_package_path(APPPATH.'third_party/foo_bar/');
              $this->load->library('foo_bar');

              $this->load->remove_package_path()

              -

              When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

              +

              When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

              $this->load->remove_package_path()

              @@ -231,8 +231,8 @@ $this->load->library('foo_bar');

              Package view files

              -

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

              -

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

              +

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

              +

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

              $this->load->add_package_path(APPPATH.'my_app', TRUE);
              diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 8846e15ff..4d1f8d97a 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -58,7 +58,7 @@ Output Class

              Output Class

              -

              The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is +

              The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is also responsible for caching your web pages, if you use that feature.

              Note: This class is initialized automatically by the system so there is no need to do it manually.

              @@ -70,7 +70,7 @@ It is possible, however, for you to manually intervene with the output if you ne

              $this->output->set_output();

              -

              Permits you to manually set the final output string. Usage example:

              +

              Permits you to manually set the final output string. Usage example:

              $this->output->set_output($data); @@ -95,7 +95,7 @@ $this->output

              $this->output->get_output();

              -

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

              +

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

              $string = $this->output->get_output();

              Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the @@ -104,7 +104,7 @@ CodeIgniter functions like $this->load->view().

              $this->output->append_output();

              -

              Appends data onto the output string. Usage example:

              +

              Appends data onto the output string. Usage example:

              $this->output->append_output($data); @@ -112,7 +112,7 @@ CodeIgniter functions like $this->load->view().

              $this->output->set_header();

              -

              Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

              +

              Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

              $this->output->set_header("HTTP/1.0 200 OK");
              @@ -125,10 +125,10 @@ $this->output->set_header("Pragma: no-cache");

              $this->output->set_status_header(code, 'text');

              -

              Permits you to manually set a server status header. Example:

              +

              Permits you to manually set a server status header. Example:

              $this->output->set_status_header('401');
              -// Sets the header as: Unauthorized
              +// Sets the header as: Unauthorized

              See here for a full list of headers.

              @@ -147,14 +147,14 @@ at the bottom of your pages for debugging and optimization purposes.

              $this->output->set_profiler_sections();

              -

              Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

              +

              Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

              $this->output->cache();

              -

              The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

              +

              The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

              Parsing Execution Variables

              -

              CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. +

              CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. $this->output->parse_exec_vars = FALSE; diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index a6b9287a3..3c366a69f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -72,26 +72,26 @@ Pagination Class $this->load->library('pagination');

              $config['base_url'] = 'http://example.com/index.php/test/page/';
              $config['total_rows'] = 200;
              -$config['per_page'] = 20; +$config['per_page'] = 20;

              $this->pagination->initialize($config);

              -echo $this->pagination->create_links(); +echo $this->pagination->create_links();

              Notes:

              -

              The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at -minimum you need the three shown. Here is a description of what those items represent:

              +

              The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

                -
              • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can +
              • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure.
              • total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
              • -
              • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
              • +
              • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.

              The create_links() function returns an empty string when there is no pagination to show.

              @@ -100,7 +100,7 @@ minimum you need the three shown. Here is a description of what those items repr

              Setting preferences in a config file

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

              @@ -122,9 +122,9 @@ something different you can specify it.

              $config['page_query_string'] = TRUE

              By default, the pagination library assume you are using URI Segments, and constructs your links something like

              http://example.com/index.php/test/page/20

              -

              If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

              +

              If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

              http://example.com/index.php?c=test&m=page&per_page=20

              -

              Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

              +

              Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

              Adding Enclosing Markup

              If you would like to surround the entire pagination with some markup you can do it with these two prefs:

              diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 4f04aaf48..cb2f100a2 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -83,10 +83,10 @@ variables or variable tag pairs. If you've never used a template engine, pseudo- PHP from your templates (view files).

              Note: CodeIgniter does not require you to use this class -since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if +since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if they work with designers who they feel would find some confusion working with PHP.

              -

              Also Note: The Template Parser Class is not a +

              Also Note: The Template Parser Class is not a full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.

              @@ -102,7 +102,7 @@ full-blown template parsing solution. We've kept it very lean on purpose in orde

              $this->parser->parse()

              -

              This method accepts a template name and data array as input, and it generates a parsed version. Example:

              +

              This method accepts a template name and data array as input, and it generates a parsed version. Example:

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

              @@ -114,11 +114,11 @@ $data = array(
              $this->parser->parse('blog_template', $data);

              The first parameter contains the name of the view file (in this example the file would be called blog_template.php), -and the second parameter contains an associative array of data to be replaced in the template. In the above example, the +and the second parameter contains an associative array of data to be replaced in the template. In the above example, the template would contain two variables: {blog_title} and {blog_heading}

              -

              There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically -passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can +

              There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically +passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can pass TRUE (boolean) to the third parameter:

              $string = $this->parser->parse('blog_template', $data, TRUE); @@ -130,8 +130,8 @@ pass TRUE (boolean) to the third parameter:

              Variable Pairs

              -

              The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be -repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

              +

              The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be +repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

              <html>
              <head>
              diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 0cb1d0cb1..735187459 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -63,11 +63,11 @@ Security Class

              XSS Filtering

              CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter -all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

              The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies -or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

              +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

              Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

              @@ -88,7 +88,7 @@ Note: This function should only be used to deal with data upon submission. It's

              Note: If you use the form validation class, it gives you the option of XSS filtering as well.

              -

              An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

              +

              An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

              if ($this->security->xss_clean($file, TRUE) === FALSE)
              {
              @@ -98,7 +98,7 @@ Note: This function should only be used to deal with data upon submission. It's

              $this->security->sanitize_filename()

              -

              When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

              +

              When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

              $filename = $this->security->sanitize_filename($this->input->post('filename')); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index bb8f1fc9b..a6f3c601c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -61,7 +61,7 @@ Session Class

              The Session class permits you maintain a user's "state" and track their activity while they browse your site. The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to use the database option you'll need to create the session table as indicated below.

              @@ -93,8 +93,8 @@ will cause it to read, create, and update sessions.

              If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

              -

              It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +

              It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

              @@ -106,7 +106,7 @@ even add your own data to a user's session, but the process of reading, writing,
            • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
            • The user's IP Address
            • The user's User Agent data (the first 50 characters of the browser data string)
            • -
            • The "last activity" time stamp.
            • +
            • The "last activity" time stamp.

            The above data is stored in a cookie as a serialized array with this prototype:

            @@ -124,7 +124,7 @@ making the data highly secure and impervious to being read or altered by someone can be found here, although the Session class will take care of initializing and encrypting the data automatically.

            -

            Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +

            Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time the cookie was written. This time is configurable by changing the $config['sess_time_to_update'] line in your system/config/config.php file.

            @@ -134,7 +134,7 @@ the cookie was written. This time is configurable by changing the $config['sess_ $this->session->userdata('item'); -

            Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +

            Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you will do this:

            $session_id = $this->session->userdata('session_id'); @@ -145,7 +145,7 @@ will do this:

            Adding Custom Session Data

            A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

            +Why would you want to do this? Here's one example:

            Let's say a particular user logs into your site. Once authenticated, you could add their username and email address to the session cookie, making that data globally available to you without @@ -155,7 +155,7 @@ having to run a database query when you need it.

            $this->session->set_userdata($array); -

            Where $array is an associative array containing your new data. Here's an example:

            +

            Where $array is an associative array containing your new data. Here's an example:

            $newdata = array(
            @@ -167,7 +167,7 @@ having to run a database query when you need it.

            $this->session->set_userdata($newdata);

            If you want to add userdata one value at a time, set_userdata() also supports this syntax.

            $this->session->set_userdata('some_name', 'some_value');

            -

            Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +

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

            Retrieving All Session Data

            @@ -179,10 +179,10 @@ encryption process in particular produces a longer data string than the original
             Array
             (
            -  [session_id] => 4a5a5dca22728fb0a84364eeb405b601
            -  [ip_address] => 127.0.0.1
            -  [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
            -  [last_activity] => 1303142623
            +    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
            +    [ip_address] => 127.0.0.1
            +    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
            +    [last_activity] => 1303142623
             )
             
            @@ -206,20 +206,20 @@ $this->session->unset_userdata($array_items);

            $this->session->keep_flashdata('item');

            Saving Session Data to a Database

            While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session could be restored by a user modifying their cookies.

            When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never be updated, they can only be generated when a new session is created.

            -

            In order to store sessions, you must first create a database table for this purpose. Here is the basic +

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

            -

            Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

            +

            Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

            The Server

            @@ -381,7 +381,7 @@ class Xmlrpc_server extends CI_Controller { $response = array( array( - 'you_said' => $parameters['0'], + 'you_said' => $parameters['0'], 'i_respond' => 'Not bad at all.'), 'struct'); @@ -452,7 +452,7 @@ The Server receives the request and maps it to the "process" function, where a r $this->xmlrpc->request($request);

            $this->xmlrpc->send_request()

            -

            The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

            +

            The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

            $this->xmlrpc->set_debug(TRUE);

            Enables debugging, which will display a variety of information and error data helpful during development.

            @@ -463,7 +463,7 @@ $this->xmlrpc->request($request); echo $this->xmlrpc->display_error();

            $this->xmlrpc->display_response()

            -

            Returns the response from the remote server once request is received. The response will typically be an associative array.

            +

            Returns the response from the remote server once request is received. The response will typically be an associative array.

            $this->xmlrpc->display_response();

            $this->xmlrpc->send_error_message()

            diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 2fc5fd81b..031126603 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -81,7 +81,7 @@ $this->zip->add_data($name, $data);
            // Write the zip file to a folder on your server. Name it "my_backup.zip"
            $this->zip->archive('/path/to/directory/my_backup.zip');

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip'); @@ -100,7 +100,7 @@ $this->zip->add_data($name, $data);

            You are allowed multiple calls to this function in order to -add several files to your archive. Example:

            +add several files to your archive. Example:

            $name = 'mydata1.txt';
            @@ -139,8 +139,8 @@ $this->zip->add_data($name, $data);

            $this->zip->add_dir()

            -

            Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when -using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

            +

            Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when +using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

            $this->zip->add_dir('myfolder'); // Creates a folder called "myfolder" @@ -148,49 +148,49 @@ using $this->zip->add_data(), but if you would like to create an empt

            $this->zip->read_file()

            -

            Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will +

            Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will read it and add it to the archive:

            $path = '/path/to/photo.jpg';

            $this->zip->read_file($path);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');

            If you would like the Zip archive to maintain the directory structure of the file in it, pass TRUE (boolean) in the -second parameter. Example:

            +second parameter. Example:

            $path = '/path/to/photo.jpg';

            $this->zip->read_file($path, TRUE);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');
            -

            In the above example, photo.jpg will be placed inside two folders: path/to/

            +

            In the above example, photo.jpg will be placed inside two folders: path/to/

            $this->zip->read_dir()

            -

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the -directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the -supplied path will be encoded, as will any sub-folders contained within it. Example:

            +

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the +directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the +supplied path will be encoded, as will any sub-folders contained within it. Example:

            $path = '/path/to/your/directory/';

            $this->zip->read_dir($path);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');

            By default the Zip archive will place all directories listed in the first parameter inside the zip. If you want the tree preceding the target folder to be ignored -you can pass FALSE (boolean) in the second parameter. Example:

            +you can pass FALSE (boolean) in the second parameter. Example:

            $path = '/path/to/your/directory/';

            @@ -204,7 +204,7 @@ $this->zip->read_dir($path, FALSE);

            $this->zip->archive()

            -

            Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the +

            Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the directory is writable (666 or 777 is usually OK). Example:

            $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip @@ -223,7 +223,7 @@ that cause the download to happen and the file to be treated as binary.

            $this->zip->get_zip()

            -

            Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. +

            Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. Example:

            diff --git a/user_guide/license.html b/user_guide/license.html index ecc5b500d..8f53851a7 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -63,7 +63,7 @@ License Agreement

            Copyright (c) 2008 - 2011, EllisLab, Inc.
            All rights reserved.

            -

            This license is a legal agreement between you and EllisLab Inc. for the use of CodeIgniter Software (the "Software"). By obtaining the Software you agree to comply with the terms and conditions of this license.

            +

            This license is a legal agreement between you and EllisLab Inc. for the use of CodeIgniter Software (the "Software"). By obtaining the Software you agree to comply with the terms and conditions of this license.

            Permitted Use

            You are permitted to use, copy, modify, and distribute the Software and its documentation, with or without modification, for any purpose, provided that the following conditions are met:

            diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt index 183481b78..8c17f008a 100644 --- a/user_guide/nav/hacks.txt +++ b/user_guide/nav/hacks.txt @@ -1,6 +1,6 @@ I did the following hack in moo.fx.js: -At line 79 in the toggle: function() function, I added: +At line 79 in the toggle: function() function, I added: document.getElementById('nav').style.display = 'block'; diff --git a/user_guide/nav/moo.fx.js b/user_guide/nav/moo.fx.js index b21ee20e0..256371d19 100755 --- a/user_guide/nav/moo.fx.js +++ b/user_guide/nav/moo.fx.js @@ -25,8 +25,8 @@ fx.Base.prototype = { }, step: function() { - var time = (new Date).getTime(); - var Tpos = (time - this.startTime) / (this.duration); + var time = (new Date).getTime(); + var Tpos = (time - this.startTime) / (this.duration); if (time >= this.duration+this.startTime) { this.now = this.to; clearInterval (this.timer); diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js index 857faae4d..e6c362279 100755 --- a/user_guide/nav/prototype.lite.js +++ b/user_guide/nav/prototype.lite.js @@ -1,9 +1,9 @@ -/* Prototype JavaScript framework - * (c) 2005 Sam Stephenson +/* Prototype JavaScript framework + * (c) 2005 Sam Stephenson * - * Prototype is freely distributable under the terms of an MIT-style license. + * Prototype is freely distributable under the terms of an MIT-style license. * - * For details, see the Prototype web site: http://prototype.conio.net/ + * For details, see the Prototype web site: http://prototype.conio.net/ * /*--------------------------------------------------------------------------*/ @@ -11,117 +11,117 @@ //note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). var Class = { - create: function() { + create: function() { return function() { - this.initialize.apply(this, arguments); + this.initialize.apply(this, arguments); } - } + } } Object.extend = function(destination, source) { - for (property in source) { + for (property in source) { destination[property] = source[property]; - } - return destination; + } + return destination; } Function.prototype.bind = function(object) { - var __method = this; - return function() { + var __method = this; + return function() { return __method.apply(object, arguments); - } + } } function $() { - var elements = new Array(); + var elements = new Array(); - for (var i = 0; i < arguments.length; i++) { + for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') - element = document.getElementById(element); + element = document.getElementById(element); if (arguments.length == 1) - return element; + return element; elements.push(element); - } + } - return elements; + return elements; } //------------------------- document.getElementsByClassName = function(className) { - var children = document.getElementsByTagName('*') || document.all; - var elements = new Array(); + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); - for (var i = 0; i < children.length; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; var classNames = child.className.split(' '); for (var j = 0; j < classNames.length; j++) { - if (classNames[j] == className) { + if (classNames[j] == className) { elements.push(child); break; - } + } } - } + } - return elements; + return elements; } //------------------------- if (!window.Element) { - var Element = new Object(); + var Element = new Object(); } Object.extend(Element, { - remove: function(element) { + remove: function(element) { element = $(element); element.parentNode.removeChild(element); - }, + }, - hasClassName: function(element, className) { + hasClassName: function(element, className) { element = $(element); if (!element) - return; + return; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { - if (a[i] == className) + if (a[i] == className) return true; } return false; - }, + }, - addClassName: function(element, className) { + addClassName: function(element, className) { element = $(element); Element.removeClassName(element, className); element.className += ' ' + className; - }, + }, - removeClassName: function(element, className) { + removeClassName: function(element, className) { element = $(element); if (!element) - return; + return; var newClassName = ''; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { - if (a[i] != className) { + if (a[i] != className) { if (i > 0) - newClassName += ' '; + newClassName += ' '; newClassName += a[i]; - } + } } element.className = newClassName; - }, + }, - // removes whitespace-only text node children - cleanWhitespace: function(element) { + // removes whitespace-only text node children + cleanWhitespace: function(element) { element = $(element); for (var i = 0; i < element.childNodes.length; i++) { - var node = element.childNodes[i]; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) Element.remove(node); } - } + } }); \ No newline at end of file diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 3b1c42e4c..bcbc43ff8 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -67,7 +67,7 @@ Appflow
          • The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
          • The Router examines the HTTP request to determine what should be done with it.
          • If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
          • -
          • Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
          • +
          • Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
          • The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
          • The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.
          • diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 1175e7f42..b6b81d760 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -60,7 +60,7 @@ What is CodeIgniter?

            CodeIgniter is an Application Framework

            -

            CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code +

            CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

            @@ -70,7 +70,7 @@ minimizing the amount of code needed for a given task.

            For more information please read the license agreement.

            CodeIgniter is Light Weight

            -

            Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. +

            Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system is very lean and quite fast.

            @@ -84,7 +84,7 @@ is very lean and quite fast. This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

            CodeIgniter Generates Clean URLs

            -

            The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" +

            The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

            example.com/news/article/345 @@ -92,7 +92,7 @@ approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a seg

            Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

            CodeIgniter Packs a Punch

            -

            CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, +

            CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and much more.

            @@ -104,7 +104,7 @@ much more.

            Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template -engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

            +engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

            <ul>

            @@ -133,7 +133,7 @@ back into PHP to run. Since one of our goals is maximum performance, we

            CodeIgniter is Thoroughly Documented

            -

            Programmers love to code and hate to write documentation. We're no different, of course, but +

            Programmers love to code and hate to write documentation. We're no different, of course, but since documentation is as important as the code itself, we are committed to doing it. Our source code is extremely clean and well commented as well.

            diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 4209463b1..e20219e0f 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -59,10 +59,10 @@ Features

            CodeIgniter Features

            Features in and of themselves are a very poor way to judge an application since they tell you nothing -about the user experience, or how intuitively or intelligently it is designed. Features +about the user experience, or how intuitively or intelligently it is designed. Features don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. The only way to really judge an app is to try it and get to know the code. Installing -CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

            +CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

            • Model-View-Controller Based System
            • @@ -73,7 +73,7 @@ CodeIgniter is child's play so we encourage you to do just that. In the mean tim
            • Security and XSS Filtering
            • Session Management
            • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
            • -
            • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
            • +
            • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
            • File Uploading Class
            • FTP Class
            • Localization
            • diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index 168332644..f120913f4 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -57,7 +57,7 @@ Getting Started

              Getting Started With CodeIgniter

              -

              Any software application requires some effort to learn. We've done our best to minimize the learning +

              Any software application requires some effort to learn. We've done our best to minimize the learning curve while making the process as enjoyable as possible.

              diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 7f1f7678e..754ecaae0 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -67,9 +67,9 @@ rejecting anything that doesn't further the stated objective.

              From a technical and architectural standpoint, CodeIgniter was created with the following objectives:

                -
              • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
              • -
              • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
              • -
              • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.
              • +
              • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
              • +
              • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
              • +
              • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.

              CodeIgniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

              diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 9eb327a95..91cf64977 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -60,12 +60,12 @@ MVC

              CodeIgniter is based on the Model-View-Controller development pattern. -MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

              +MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

              • The Model represents your data structures. Typically your model classes will contain functions that help you -retrieve, insert, and update information in your database.
              • -
              • The View is the information that is being presented to a user. A View will normally be a web page, but +retrieve, insert, and update information in your database.
              • +
              • The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
              • The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
              • diff --git a/user_guide/userguide.css b/user_guide/userguide.css index b08f4fb00..f93ff0d75 100644 --- a/user_guide/userguide.css +++ b/user_guide/userguide.css @@ -391,7 +391,7 @@ form { .select { background-color: #fff; - font-size: 11px; + font-size: 11px; font-weight: normal; color: #333; padding: 0; -- cgit v1.2.3-24-g4f1b