From 21ca8cca94e969dd83e410c26920ec80822959d0 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Mon, 27 Sep 2010 08:49:29 -0500
Subject: added sess_expire_on_close to config file, corrected comment block
for session config vars. Fixes #149
---
application/config/config.php | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/application/config/config.php b/application/config/config.php
index c5eae8f5b..3f2be480f 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -224,15 +224,22 @@ $config['encryption_key'] = "";
| Session Variables
|--------------------------------------------------------------------------
|
-| 'session_cookie_name' = the name you want for the cookie
-| 'encrypt_sess_cookie' = TRUE/FALSE (boolean). Whether to encrypt the cookie
-| 'session_expiration' = the number of SECONDS you want the session to last.
-| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
-| 'time_to_update' = how many seconds between CI refreshing Session Information
+| 'sess_cookie_name' = the name you want for the cookie
+| 'sess_expiration' = the number of SECONDS you want the session to last.
+| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
+| 'sess_expire_on_close' = Whether to cause the session to expire automatically
+| when the browser window is closed
+| 'sess_encrypt_cookie' = Whether to encrypt the cookie
+| 'sess_use_database' = Whether to save the session data to a database
+| 'sess_table_name' = The name of the session database table
+| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
+| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
+| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
+$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
--
cgit v1.2.3-24-g4f1b
From e77162b9d3233cf6de1f4830262b79b3c2235ed3 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Mon, 27 Sep 2010 09:08:00 -0500
Subject: fixed some grammar errors in the Views documentation. Fixes #154
---
user_guide/general/views.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/user_guide/general/views.html b/user_guide/general/views.html
index 107446946..b5dea05a1 100644
--- a/user_guide/general/views.html
+++ b/user_guide/general/views.html
@@ -109,12 +109,12 @@ class Blog extends Controller {
-If you visit the 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 then 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 Controller {
--
cgit v1.2.3-24-g4f1b
From d76334998db618d4633886bbcecc84658b50ab23 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Tue, 28 Sep 2010 13:14:57 -0500
Subject: fixed a bug where the Output class would send incorrect cached data
for controllers implementing their own _output() methods
---
system/core/Output.php | 21 +++++++++++++--------
user_guide/changelog.html | 1 +
user_guide/general/controllers.html | 11 ++++++++++-
3 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/system/core/Output.php b/system/core/Output.php
index 7d3e2e180..ad9ffbabe 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -212,7 +212,13 @@ class CI_Output {
// since this function is sometimes called by the caching mechanism,
// which happens before the CI super object is available.
global $BM, $CFG;
-
+
+ // Grab the super object if we can.
+ if (function_exists('get_instance'))
+ {
+ $CI =& get_instance();
+ }
+
// --------------------------------------------------------------------
// Set the output data
@@ -223,8 +229,10 @@ class CI_Output {
// --------------------------------------------------------------------
- // Do we need to write a cache file?
- if ($this->cache_expiration > 0)
+ // 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'))
{
$this->_write_cache($output);
}
@@ -271,10 +279,10 @@ class CI_Output {
// --------------------------------------------------------------------
- // Does the get_instance() function exist?
+ // Does the $CI object exist?
// If not we know we are dealing with a cache file so we'll
// simply echo out the data and exit.
- if ( ! function_exists('get_instance'))
+ if ( ! isset($CI))
{
echo $output;
log_message('debug', "Final output sent to browser");
@@ -283,9 +291,6 @@ class CI_Output {
}
// --------------------------------------------------------------------
-
- // Grab the super object. We'll need it in a moment...
- $CI =& get_instance();
// Do we need to generate profile data?
// If so, load the Profile class and run it.
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index fb533b082..58fd78008 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -162,6 +162,7 @@ Hg Tag:
Bug fixes for 2.0.0
+ - Fixed a bug where the Output class would send incorrect cached output for controllers implementing their own _output() method.
- Fixed a bug where a failed query would not have a saved query execution time causing errors in the Profiler
- Fixed a bug that was writing log entries when multiple identical helpers and plugins were loaded.
- Fixed assorted user guide typos or examples (#10693, #8951, #7825, #8660, #7883, #6771, #10656).
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html
index 9658df876..2020011d9 100644
--- a/user_guide/general/controllers.html
+++ b/user_guide/general/controllers.html
@@ -268,7 +268,16 @@ function _output($output)
Please note that your _output() function will receive the data in its finalized state. Benchmark and memory usage data will be rendered,
cache files written (if you have caching enabled), and headers will be sent (if you use that feature)
-before it is handed off to the _output() function. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate
+before it is handed off to the _output() function.
+
+To have your controller's output cached properly, its _output() method can use:
+
+if ($this->output->cache_expiration > 0)
+{
+ $this->output->write_cache($output);
+}
+
+If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate
since they will not take into acccount any further processing you do. For an alternate way to control output before any of the final processing is done, please see
the available methods in the Output Class.
--
cgit v1.2.3-24-g4f1b
From c206754bfe399f9cee4df92a3ea037a297dbb945 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Fri, 1 Oct 2010 07:19:57 -0500
Subject: tweak to typography. Better aesthetic to placement of paragraph tags
---
system/libraries/Typography.php | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php
index 0f0a8b7a2..f058769ec 100644
--- a/system/libraries/Typography.php
+++ b/system/libraries/Typography.php
@@ -202,7 +202,7 @@ class CI_Typography {
// If the user submitted their own paragraph tags within the text
// we will retain them instead of using our tags.
- '/(*?]>)
/' => '$1', // *?]>)
/' => '$1', // )+#' => '
',
@@ -219,8 +219,17 @@ class CI_Typography {
'/\{@DQ\}/' => '"',
'/\{@SQ\}/' => "'",
'/\{@DD\}/' => '--',
- '/\{@NBS\}/' => ' '
+ '/\{@NBS\}/' => ' ',
+ // An unintended consequence of the _format_newlines function is that
+ // some of the newlines get truncated, resulting in tags
+ // starting immediately after tags on the same line.
+ // This forces a newline after such occurrences, which looks much nicer.
+ "/>\n/" => ">\n
",
+
+ // Similarly, there might be cases where a closing
will follow
+ // a closing
tag, so we'll correct it by adding a newline in between
+ "#
#" => "\n"
);
// Do we need to reduce empty lines?
@@ -337,7 +346,10 @@ class CI_Typography {
// Wrap the whole enchilada in enclosing paragraphs
if ($str != "\n")
{
- $str = ''.$str.'
';
+ // 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).'
';
}
// Remove empty paragraphs if they are on the first line, as this
--
cgit v1.2.3-24-g4f1b
From 3351fbc56cea19ec3dd603836beb0a420b1ded65 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Fri, 1 Oct 2010 09:56:31 -0500
Subject: fixed code sample
---
user_guide/general/controllers.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html
index 2020011d9..782fbfa7e 100644
--- a/user_guide/general/controllers.html
+++ b/user_guide/general/controllers.html
@@ -274,7 +274,7 @@ To have your controller's output cached properly, its _output() metho
if ($this->output->cache_expiration > 0)
{
- $this->output->write_cache($output);
+ $this->output->_write_cache($output);
}
If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate
--
cgit v1.2.3-24-g4f1b
From 3934a4a803ee2069ac7622e4c2565fb5fee11ce9 Mon Sep 17 00:00:00 2001
From: fesplugas
Date: Mon, 4 Oct 2010 09:07:49 +0200
Subject: Fixed link
---
system/libraries/Javascript.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php
index efaaab4bf..c149bb111 100644
--- a/system/libraries/Javascript.php
+++ b/system/libraries/Javascript.php
@@ -22,7 +22,7 @@
* @subpackage Libraries
* @category Javascript
* @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/general/errors.html
+ * @link http://codeigniter.com/user_guide/libraries/javascript.html
*/
class CI_Javascript {
--
cgit v1.2.3-24-g4f1b
From dd6719738936be31cdaa1758ca86d5eb14dcab3d Mon Sep 17 00:00:00 2001
From: Barry Mieny
Date: Mon, 4 Oct 2010 16:33:58 +0200
Subject: Cleanup of stray spaces and tabs
---
application/config/autoload.php | 2 +-
application/config/config.php | 12 +-
application/config/constants.php | 12 +-
application/config/foreign_chars.php | 74 ++--
application/config/routes.php | 2 +-
application/config/smileys.php | 2 +-
application/config/user_agents.php | 6 +-
application/controllers/welcome.php | 4 +-
application/errors/error_404.php | 2 +-
application/errors/error_db.php | 2 +-
application/errors/error_general.php | 2 +-
index.php | 42 +-
system/core/Base4.php | 8 +-
system/core/Base5.php | 2 +-
system/core/Benchmark.php | 4 +-
system/core/CodeIgniter.php | 64 +--
system/core/Common.php | 70 ++--
system/core/Compat.php | 10 +-
system/core/Config.php | 48 +--
system/core/Controller.php | 16 +-
system/core/Exceptions.php | 26 +-
system/core/Hooks.php | 16 +-
system/core/Input.php | 8 +-
system/core/Lang.php | 2 +-
system/core/Loader.php | 298 +++++++-------
system/core/Model.php | 14 +-
system/core/Output.php | 142 +++----
system/core/Router.php | 156 ++++----
system/core/URI.php | 6 +-
system/core/Unicode.php | 28 +-
system/database/DB.php | 46 +--
system/database/DB_active_rec.php | 378 +++++++++---------
system/database/DB_cache.php | 54 +--
system/database/DB_driver.php | 332 ++++++++--------
system/database/DB_forge.php | 72 ++--
system/database/DB_result.php | 80 ++--
system/database/DB_utility.php | 84 ++--
system/database/drivers/mssql/mssql_driver.php | 120 +++---
system/database/drivers/mssql/mssql_forge.php | 34 +-
system/database/drivers/mssql/mssql_result.php | 24 +-
system/database/drivers/mssql/mssql_utility.php | 2 +-
system/database/drivers/mysql/mysql_driver.php | 144 +++----
system/database/drivers/mysql/mysql_forge.php | 30 +-
system/database/drivers/mysql/mysql_result.php | 24 +-
system/database/drivers/mysql/mysql_utility.php | 46 +--
system/database/drivers/mysqli/mysqli_driver.php | 120 +++---
system/database/drivers/mysqli/mysqli_forge.php | 30 +-
system/database/drivers/mysqli/mysqli_result.php | 24 +-
system/database/drivers/mysqli/mysqli_utility.php | 4 +-
system/database/drivers/oci8/oci8_driver.php | 104 ++---
system/database/drivers/oci8/oci8_forge.php | 32 +-
system/database/drivers/oci8/oci8_result.php | 30 +-
system/database/drivers/odbc/odbc_driver.php | 108 ++---
system/database/drivers/odbc/odbc_forge.php | 38 +-
system/database/drivers/odbc/odbc_result.php | 18 +-
system/database/drivers/odbc/odbc_utility.php | 6 +-
system/database/drivers/postgre/postgre_driver.php | 116 +++---
system/database/drivers/postgre/postgre_forge.php | 32 +-
system/database/drivers/postgre/postgre_result.php | 18 +-
system/database/drivers/sqlite/sqlite_driver.php | 124 +++---
system/database/drivers/sqlite/sqlite_forge.php | 30 +-
system/database/drivers/sqlite/sqlite_result.php | 20 +-
system/fonts/texb.ttf | Bin 143821 -> 152992 bytes
system/helpers/array_helper.php | 8 +-
system/helpers/captcha_helper.php | 74 ++--
system/helpers/compatibility_helper.php | 96 ++---
system/helpers/cookie_helper.php | 8 +-
system/helpers/date_helper.php | 170 ++++----
system/helpers/directory_helper.php | 8 +-
system/helpers/download_helper.php | 10 +-
system/helpers/email_helper.php | 4 +-
system/helpers/file_helper.php | 70 ++--
system/helpers/form_helper.php | 36 +-
system/helpers/html_helper.php | 6 +-
system/helpers/inflector_helper.php | 44 +--
system/helpers/language_helper.php | 2 +-
system/helpers/number_helper.php | 12 +-
system/helpers/path_helper.php | 10 +-
system/helpers/security_helper.php | 24 +-
system/helpers/smiley_helper.php | 36 +-
system/helpers/string_helper.php | 62 +--
system/helpers/text_helper.php | 264 ++++++-------
system/helpers/typography_helper.php | 12 +-
system/helpers/url_helper.php | 24 +-
system/helpers/xml_helper.php | 18 +-
system/language/english/calendar_lang.php | 66 ++--
system/language/english/form_validation_lang.php | 8 +-
system/language/english/profiler_lang.php | 2 +-
system/libraries/Calendar.php | 156 ++++----
system/libraries/Cart.php | 140 +++----
system/libraries/Driver.php | 44 +--
system/libraries/Email.php | 124 +++---
system/libraries/Encrypt.php | 30 +-
system/libraries/Form_validation.php | 436 ++++++++++-----------
system/libraries/Ftp.php | 14 +-
system/libraries/Image_lib.php | 42 +-
system/libraries/Javascript.php | 172 ++++----
system/libraries/Log.php | 34 +-
system/libraries/Pagination.php | 20 +-
system/libraries/Parser.php | 26 +-
system/libraries/Profiler.php | 184 ++++-----
system/libraries/Security.php | 142 +++----
system/libraries/Session.php | 24 +-
system/libraries/Sha1.php | 22 +-
system/libraries/Table.php | 156 ++++----
system/libraries/Trackback.php | 246 ++++++------
system/libraries/Typography.php | 140 +++----
system/libraries/Unit_test.php | 110 +++---
system/libraries/Upload.php | 298 +++++++-------
system/libraries/User_agent.php | 166 ++++----
system/libraries/Xmlrpc.php | 326 +++++++--------
system/libraries/Xmlrpcs.php | 152 +++----
system/libraries/Zip.php | 56 +--
system/libraries/javascript/Jquery.php | 28 +-
user_guide/changelog.html | 28 +-
user_guide/database/active_record.html | 74 ++--
user_guide/database/call_function.html | 2 +-
user_guide/database/fields.html | 2 +-
user_guide/database/index.html | 2 +-
user_guide/database/queries.html | 2 +-
user_guide/database/results.html | 30 +-
user_guide/database/table_data.html | 2 +-
user_guide/doc_style/template.html | 2 +-
user_guide/general/alternative_php.html | 4 +-
user_guide/general/creating_libraries.html | 2 +-
user_guide/general/credits.html | 4 +-
user_guide/general/drivers.html | 2 +-
user_guide/general/managing_apps.html | 6 +-
user_guide/general/models.html | 2 +-
user_guide/general/profiling.html | 4 +-
user_guide/general/styleguide.html | 124 +++---
user_guide/general/views.html | 10 +-
user_guide/helpers/captcha_helper.html | 18 +-
user_guide/helpers/compatibility_helper.html | 2 +-
user_guide/helpers/date_helper.html | 4 +-
user_guide/helpers/directory_helper.html | 2 +-
user_guide/helpers/form_helper.html | 6 +-
user_guide/helpers/html_helper.html | 4 +-
user_guide/helpers/smiley_helper.html | 14 +-
user_guide/helpers/string_helper.html | 2 +-
user_guide/helpers/text_helper.html | 2 +-
user_guide/images/ci_logo.jpg | Bin 5602 -> 9035 bytes
user_guide/images/ci_logo_flame.jpg | Bin 8589 -> 13862 bytes
user_guide/images/ci_quick_ref.png | Bin 94476 -> 150187 bytes
.../images/codeigniter_1.7.1_helper_reference.png | Bin 67388 -> 109471 bytes
.../images/codeigniter_1.7.1_library_reference.png | Bin 111747 -> 182066 bytes
user_guide/images/nav_bg.jpg | Bin 441 -> 503 bytes
user_guide/installation/downloads.html | 4 +-
user_guide/installation/index.html | 2 +-
user_guide/installation/upgrade_160.html | 2 +-
user_guide/installation/upgrade_170.html | 4 +-
user_guide/installation/upgrade_200.html | 6 +-
user_guide/libraries/calendar.html | 2 +-
user_guide/libraries/cart.html | 18 +-
user_guide/libraries/email.html | 4 +-
user_guide/libraries/file_uploading.html | 18 +-
user_guide/libraries/form_validation.html | 30 +-
user_guide/libraries/ftp.html | 12 +-
user_guide/libraries/image_lib.html | 2 +-
user_guide/libraries/loader.html | 6 +-
user_guide/libraries/output.html | 4 +-
user_guide/libraries/pagination.html | 2 +-
user_guide/libraries/table.html | 8 +-
user_guide/libraries/typography.html | 2 +-
user_guide/libraries/unit_testing.html | 2 +-
user_guide/libraries/xmlrpc.html | 32 +-
user_guide/nav/moo.fx.js | 4 +-
user_guide/nav/moo.fx.pack.js | 6 +-
user_guide/overview/at_a_glance.html | 2 +-
user_guide/overview/index.html | 2 +-
user_guide/toc.html | 10 +-
171 files changed, 4153 insertions(+), 4153 deletions(-)
diff --git a/application/config/autoload.php b/application/config/autoload.php
index 35ad6288f..5e9740844 100644
--- a/application/config/autoload.php
+++ b/application/config/autoload.php
@@ -77,7 +77,7 @@ $autoload['config'] = array();
|
| $autoload['language'] = array('lang1', 'lang2');
|
-| NOTE: Do not include the "_lang" part of your file. For example
+| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
diff --git a/application/config/config.php b/application/config/config.php
index 3f2be480f..e318a2ab7 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -149,16 +149,16 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
|
*/
$config['enable_query_strings'] = FALSE;
-$config['controller_trigger'] = 'c';
-$config['function_trigger'] = 'm';
-$config['directory_trigger'] = 'd'; // experimental not currently in use
+$config['controller_trigger'] = 'c';
+$config['function_trigger'] = 'm';
+$config['directory_trigger'] = 'd'; // experimental not currently in use
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
-| If you have enabled error logging, you can set an error threshold to
+| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
@@ -225,7 +225,7 @@ $config['encryption_key'] = "";
|--------------------------------------------------------------------------
|
| 'sess_cookie_name' = the name you want for the cookie
-| 'sess_expiration' = the number of SECONDS you want the session to last.
+| 'sess_expiration' = the number of SECONDS you want the session to last.
| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
| 'sess_expire_on_close' = Whether to cause the session to expire automatically
| when the browser window is closed
@@ -245,7 +245,7 @@ $config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
-$config['sess_time_to_update'] = 300;
+$config['sess_time_to_update'] = 300;
/*
|--------------------------------------------------------------------------
diff --git a/application/config/constants.php b/application/config/constants.php
index 1551cbcab..4a879d360 100644
--- a/application/config/constants.php
+++ b/application/config/constants.php
@@ -27,13 +27,13 @@ define('DIR_WRITE_MODE', 0777);
|
*/
-define('FOPEN_READ', 'rb');
+define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
-define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
-define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
-define('FOPEN_WRITE_CREATE', 'ab');
-define('FOPEN_READ_WRITE_CREATE', 'a+b');
-define('FOPEN_WRITE_CREATE_STRICT', 'xb');
+define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
+define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
+define('FOPEN_WRITE_CREATE', 'ab');
+define('FOPEN_READ_WRITE_CREATE', 'a+b');
+define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php
index 59a7d234a..e106ad800 100644
--- a/application/config/foreign_chars.php
+++ b/application/config/foreign_chars.php
@@ -8,56 +8,56 @@
|
*/
$foreign_characters = array('223' => "ss", // ß
- '224' => "a",
- '225' => "a",
- '226' => "a",
+ '224' => "a",
+ '225' => "a",
+ '226' => "a",
'229' => "a",
- '227' => "ae",
- '230' => "ae",
+ '227' => "ae",
+ '230' => "ae",
'228' => "ae",
'231' => "c",
'232' => "e", // è
'233' => "e", // é
- '234' => "e", // ê
+ '234' => "e", // ê
'235' => "e", // ë
- '236' => "i",
- '237' => "i",
- '238' => "i",
- '239' => "i",
+ '236' => "i",
+ '237' => "i",
+ '238' => "i",
+ '239' => "i",
'241' => "n",
- '242' => "o",
- '243' => "o",
- '244' => "o",
+ '242' => "o",
+ '243' => "o",
+ '244' => "o",
'245' => "o",
'246' => "oe", // ö
- '249' => "u",
- '250' => "u",
- '251' => "u",
+ '249' => "u",
+ '250' => "u",
+ '251' => "u",
'252' => "ue", // ü
'255' => "y",
- '257' => "aa",
- '269' => "ch",
- '275' => "ee",
- '291' => "gj",
- '299' => "ii",
- '311' => "kj",
- '316' => "lj",
- '326' => "nj",
- '353' => "sh",
- '363' => "uu",
+ '257' => "aa",
+ '269' => "ch",
+ '275' => "ee",
+ '291' => "gj",
+ '299' => "ii",
+ '311' => "kj",
+ '316' => "lj",
+ '326' => "nj",
+ '353' => "sh",
+ '363' => "uu",
'382' => "zh",
- '256' => "aa",
- '268' => "ch",
- '274' => "ee",
- '290' => "gj",
- '298' => "ii",
- '310' => "kj",
- '315' => "lj",
- '325' => "nj",
- '352' => "sh",
- '362' => "uu",
+ '256' => "aa",
+ '268' => "ch",
+ '274' => "ee",
+ '290' => "gj",
+ '298' => "ii",
+ '310' => "kj",
+ '315' => "lj",
+ '325' => "nj",
+ '352' => "sh",
+ '362' => "uu",
'381' => "zh",
- );
+ );
/* End of file foreign_chars.php */
diff --git a/application/config/routes.php b/application/config/routes.php
index 57af9850b..614462fd9 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -9,7 +9,7 @@
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
-| example.com/class/method/id/
+| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
diff --git a/application/config/smileys.php b/application/config/smileys.php
index 31a60c656..25d28b2c4 100644
--- a/application/config/smileys.php
+++ b/application/config/smileys.php
@@ -7,7 +7,7 @@
| Individual images can be used to replace multiple simileys. For example:
| :-) and :) use the same image replacement.
|
-| Please see user guide for more info:
+| Please see user guide for more info:
| http://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
diff --git a/application/config/user_agents.php b/application/config/user_agents.php
index 3be200942..985deed24 100644
--- a/application/config/user_agents.php
+++ b/application/config/user_agents.php
@@ -113,7 +113,7 @@ $mobiles = array(
'benq' => "BenQ",
'ipaq' => "HP iPaq",
'mot-' => "Motorola",
- 'playstation portable' => "PlayStation Portable",
+ 'playstation portable' => "PlayStation Portable",
'hiptop' => "Danger Hiptop",
'nec-' => "NEC",
'panasonic' => "Panasonic",
@@ -126,7 +126,7 @@ $mobiles = array(
// Operating Systems
'symbian' => "Symbian",
- 'SymbianOS' => "SymbianOS",
+ 'SymbianOS' => "SymbianOS",
'elaine' => "Palm",
'palm' => "Palm",
'series60' => "Symbian S60",
@@ -151,7 +151,7 @@ $mobiles = array(
// Fallback
'mobile' => "Generic Mobile",
- 'wireless' => "Generic Mobile",
+ 'wireless' => "Generic Mobile",
'j2me' => "Generic Mobile",
'midp' => "Generic Mobile",
'cldc' => "Generic Mobile",
diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php
index bd134e7e6..2e4cff8ed 100644
--- a/application/controllers/welcome.php
+++ b/application/controllers/welcome.php
@@ -4,9 +4,9 @@ class Welcome extends Controller {
function Welcome()
{
- parent::Controller();
+ parent::Controller();
}
-
+
function index()
{
$this->load->view('welcome_message');
diff --git a/application/errors/error_404.php b/application/errors/error_404.php
index 1c513a205..a304f4561 100644
--- a/application/errors/error_404.php
+++ b/application/errors/error_404.php
@@ -21,7 +21,7 @@ h1 {
font-weight: normal;
font-size: 14px;
color: #990000;
-margin: 0 0 4px 0;
+margin: 0 0 4px 0;
}
diff --git a/application/errors/error_db.php b/application/errors/error_db.php
index 1ce52dfc9..181de960b 100644
--- a/application/errors/error_db.php
+++ b/application/errors/error_db.php
@@ -21,7 +21,7 @@ h1 {
font-weight: normal;
font-size: 14px;
color: #990000;
-margin: 0 0 4px 0;
+margin: 0 0 4px 0;
}
diff --git a/application/errors/error_general.php b/application/errors/error_general.php
index d8610702b..7734d34c7 100644
--- a/application/errors/error_general.php
+++ b/application/errors/error_general.php
@@ -21,7 +21,7 @@ h1 {
font-weight: normal;
font-size: 14px;
color: #990000;
-margin: 0 0 4px 0;
+margin: 0 0 4px 0;
}
diff --git a/index.php b/index.php
index 0eef7b895..6ac782215 100644
--- a/index.php
+++ b/index.php
@@ -30,7 +30,7 @@
*---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
- * folder then the default one you can set its name here. The folder
+ * folder then the default one you can set its name here. The folder
* 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
@@ -46,9 +46,9 @@
* --------------------------------------------------------------------
*
* Normally you will set your default controller in the routes.php file.
- * You can, however, force a custom routing by hard-coding a
+ * You can, however, force a custom routing by hard-coding a
* specific controller class/function here. For most applications, you
- * WILL NOT set your routing here, but it's an option for those
+ * 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.
*
@@ -60,14 +60,14 @@
* Un-comment the $routing array below to use this feature
*
*/
- // The directory name, relative to the "controllers" folder. Leave blank
- // if your controller is not in a sub-folder within the "controllers" folder
+ // 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.php
// $routing['controller'] = '';
-
- // The controller function you wish to be called.
+
+ // The controller function you wish to be called.
// $routing['function'] = '';
@@ -77,10 +77,10 @@
* -------------------------------------------------------------------
*
* The $assign_to_config array below will be passed dynamically to the
- * config class when initialized. This allows you to set custom config
- * items or override any default config values found in the config.php file.
+ * config class when initialized. This allows you to set custom config
+ * items or override any default config values found in the config.php file.
* This can be handy as it permits you to share one application between
- * multiple front controller files, with each file containing different
+ * multiple front controller files, with each file containing different
* config values.
*
* Un-comment the $assign_to_config array below to use this feature
@@ -106,35 +106,35 @@
{
$system_path = realpath($system_path).'/';
}
-
+
// ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
// Is the system path correct?
if ( ! is_dir($system_path))
{
- exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
+ exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
}
/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
- */
+ */
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
// The PHP file extension
define('EXT', '.php');
- // Path to the system folder
+ // Path to the system folder
define('BASEPATH', str_replace("\\", "/", $system_path));
-
+
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
-
+
// Name of the "system folder"
- define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
+ define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
@@ -143,12 +143,12 @@
define('APPPATH', $application_folder.'/');
}
else
- {
+ {
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
- exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
+ exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
-
+
define('APPPATH', BASEPATH.$application_folder.'/');
}
diff --git a/system/core/Base4.php b/system/core/Base4.php
index bd0434158..ef7838d69 100644
--- a/system/core/Base4.php
+++ b/system/core/Base4.php
@@ -32,7 +32,7 @@
* Since PHP 5 doesn't suffer from this problem so we load one of
* two files based on the version of PHP being run.
* @PHP4
- *
+ *
* @package CodeIgniter
* @subpackage codeigniter
* @category front-controller
@@ -46,7 +46,7 @@
// This allows syntax like $this->load->foo() to work
parent::CI_Loader();
$this->load =& $this;
-
+
// This allows resources used within controller constructors to work
global $OBJ;
$OBJ = $this->load; // Do NOT use a reference.
@@ -56,12 +56,12 @@
function &get_instance()
{
global $CI, $OBJ;
-
+
if (is_object($CI))
{
return $CI;
}
-
+
return $OBJ->load;
}
diff --git a/system/core/Base5.php b/system/core/Base5.php
index 6f2fbdab0..ac6c7f020 100644
--- a/system/core/Base5.php
+++ b/system/core/Base5.php
@@ -23,7 +23,7 @@
* run under PHP 5. It allows us to manage the CI super object more
* gracefully than what is possible with PHP 4.
* @PHP4 (no need for separate Bases after PHP 4 is gone)
- *
+ *
* @package CodeIgniter
* @subpackage codeigniter
* @category front-controller
diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php
index 1149b7a76..80933f424 100644
--- a/system/core/Benchmark.php
+++ b/system/core/Benchmark.php
@@ -80,13 +80,13 @@ class CI_Benchmark {
{
$this->marker[$point2] = microtime();
}
-
+
list($sm, $ss) = explode(' ', $this->marker[$point1]);
list($em, $es) = explode(' ', $this->marker[$point2]);
return number_format(($em + $es) - ($sm + $ss), $decimals);
}
-
+
// --------------------------------------------------------------------
/**
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index 295917c92..f67bb8c10 100644
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -61,10 +61,10 @@
* ------------------------------------------------------
*/
set_error_handler('_exception_handler');
-
+
if ( ! is_php('5.3'))
{
- @set_magic_quotes_runtime(0); // Kill magic quotes
+ @set_magic_quotes_runtime(0); // Kill magic quotes
}
// Set a liberal script execution time limit
@@ -78,18 +78,18 @@
* Set the subclass_prefix
* ------------------------------------------------------
*
- * Normally the "subclass_prefix" is set in the config file.
- * The subclass prefix allows CI to know if a core class is
+ * Normally the "subclass_prefix" is set in the config file.
+ * The subclass prefix allows CI to know if a core class is
* being extended via a library in the local application
- * "libraries" folder. Since CI allows config items to be
- * overriden via data set in the main index. php file,
- * before proceeding we need to know if a subclass_prefix
+ * "libraries" folder. Since CI allows config items to be
+ * overriden via data set in the main index. php file,
+ * before proceeding we need to know if a subclass_prefix
* override exists. If so, we will set this value now,
* before any classes are loaded
- * Note: Since the config file data is cached it doesn't
+ * Note: Since the config file data is cached it doesn't
* hurt to load it here.
*/
- if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '')
+ if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '')
{
get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix']));
}
@@ -121,12 +121,12 @@
* ------------------------------------------------------
* Instantiate the config class
* ------------------------------------------------------
- */
+ */
$CFG =& load_class('Config', 'core');
// Do we have any manually set config items in the index.php file?
if (isset($assign_to_config))
- {
+ {
$CFG->_assign_to_config($assign_to_config);
}
@@ -134,16 +134,16 @@
* ------------------------------------------------------
* Instantiate the Unicode class
* ------------------------------------------------------
- *
+ *
* Note: Order here is rather important as the Unicode
* class needs to be used very early on, but it cannot
- * properly determine if UTf-8 can be supported until
+ * properly determine if UTf-8 can be supported until
* after the Config class is instantiated.
- *
+ *
*/
$UNI =& load_class('Unicode', 'core');
-
+
/*
* ------------------------------------------------------
* Instantiate the URI class
@@ -155,10 +155,10 @@
* ------------------------------------------------------
* Instantiate the routing class and set the routing
* ------------------------------------------------------
- */
+ */
$RTR =& load_class('Router', 'core');
$RTR->_set_routing();
-
+
// Set any routing overrides that may exist in the main index file
if (isset($routing))
{
@@ -190,7 +190,7 @@
* Load the Input class and sanitize globals
* ------------------------------------------------------
*/
- $IN =& load_class('Input', 'core');
+ $IN =& load_class('Input', 'core');
/*
* ------------------------------------------------------
@@ -208,9 +208,9 @@
* conditionally load different versions of the base
* class. Retaining PHP 4 compatibility requires a bit of a hack.
* @PHP4
- *
+ *
*/
- if (is_php('5.0.0') == TRUE)
+ if (is_php('5.0.0') == TRUE)
{
require(BASEPATH.'core/Base5'.EXT);
}
@@ -220,25 +220,25 @@
load_class('Loader', 'core');
require(BASEPATH.'core/Base4'.EXT);
}
-
+
// Load the base controller class
require BASEPATH.'core/Controller'.EXT;
-
+
if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT))
{
require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT;
}
-
+
// Load the local application controller
- // Note: The Router class automatically validates the controller path using the router->_validate_request().
+ // Note: The Router class automatically validates the controller path using the router->_validate_request().
// If this include fails it means that the default controller in the Routes.php file is not resolving to something valid.
if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT))
{
show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
}
-
+
include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT);
-
+
// Set a mark point for benchmarking
$BM->mark('loading_time:_base_classes_end');
@@ -253,7 +253,7 @@
*/
$class = $RTR->fetch_class();
$method = $RTR->fetch_method();
-
+
if ( ! class_exists($class)
OR $method == 'controller'
OR strncmp($method, '_', 1) == 0
@@ -277,7 +277,7 @@
*/
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
-
+
$CI = new $class();
/*
@@ -307,11 +307,11 @@
}
// Call the requested method.
- // Any URI segments present (besides the class/function) will be passed to the method for convenience
- call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));
+ // Any URI segments present (besides the class/function) will be passed to the method for convenience
+ call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));
}
-
+
// Mark a benchmark end point
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
@@ -331,7 +331,7 @@
{
$OUT->_display();
}
-
+
/*
* ------------------------------------------------------
* Is there a "post_system" hook?
diff --git a/system/core/Common.php b/system/core/Common.php
index 2b8ad26b1..90ba7c963 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -43,7 +43,7 @@
{
static $_is_php;
$version = (string)$version;
-
+
if ( ! isset($_is_php[$version]))
{
$_is_php[$version] = (version_compare(PHP_VERSION, $version) < 0) ? FALSE : TRUE;
@@ -57,13 +57,13 @@
/**
* Tests for file writability
*
- * is_writable() returns TRUE on Windows servers when you really can't write to
+ * is_writable() returns TRUE on Windows servers when you really can't write to
* the file, based on the read-only attribute. is_writable() is also unreliable
* on Unix servers if safe_mode is on.
*
* @access private
* @return void
- */
+ */
function is_really_writable($file)
{
// If we're on a Unix server with safe_mode off we call is_writable
@@ -115,7 +115,7 @@
function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
{
static $_classes = array();
-
+
// Does the class exist? If so, we're done...
if (isset($_classes[$class]))
{
@@ -127,25 +127,25 @@
// Look for the class first in the native system/libraries folder
// thenin the local application/libraries folder
foreach (array(BASEPATH, APPPATH) as $path)
- {
+ {
if (file_exists($path.$directory.'/'.$class.EXT))
{
$name = $prefix.$class;
-
+
if (class_exists($name) === FALSE)
{
require($path.$directory.'/'.$class.EXT);
}
-
+
break;
}
}
// Is the request a class extension? If so we load it too
if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT))
- {
+ {
$name = config_item('subclass_prefix').$class;
-
+
if (class_exists($name) === FALSE)
{
require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT);
@@ -155,8 +155,8 @@
// Did we find the class?
if ($name === FALSE)
{
- // Note: We use exit() rather then show_error() in order to avoid a
- // self-referencing loop with the Excptions class
+ // Note: We use exit() rather then show_error() in order to avoid a
+ // self-referencing loop with the Excptions class
exit('Unable to locate the specified class: '.$class.EXT);
}
@@ -176,7 +176,7 @@
* Required to retain PHP 4 compatibility and also not make PHP 5.3 cry.
*
* Use: $obj =& instantiate_class(new Foo());
- *
+ *
* @access public
* @param object
* @return object
@@ -221,11 +221,11 @@
function &get_config($replace = array())
{
static $_config;
-
+
if (isset($_config))
{
return $_config[0];
- }
+ }
// Fetch the config file
if ( ! file_exists(APPPATH.'config/config'.EXT))
@@ -254,7 +254,7 @@
}
}
}
-
+
return $_config[0] =& $config;
}
@@ -269,18 +269,18 @@
function config_item($item)
{
static $_config_item = array();
-
+
if ( ! isset($_config_item[$item]))
{
$config =& get_config();
-
+
if ( ! isset($config[$item]))
{
return FALSE;
}
$_config_item[$item] = $config[$item];
}
-
+
return $_config_item[$item];
}
@@ -343,7 +343,7 @@
{
return;
}
-
+
$_log =& load_class('Log');
$_log->write_log($level, $message, $php_error);
}
@@ -354,10 +354,10 @@
* Set HTTP Status Header
*
* @access public
- * @param int the status code
- * @param string
+ * @param int the status code
+ * @param string
* @return void
- */
+ */
function set_status_header($code = 200, $text = '')
{
$stati = array(
@@ -408,15 +408,15 @@
}
if (isset($stati[$code]) AND $text == '')
- {
+ {
$text = $stati[$code];
}
-
+
if ($text == '')
{
show_error('No status text available. Please check your status code number or supply your own message text.', 500);
}
-
+
$server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
if (substr(php_sapi_name(), 0, 3) == 'cgi')
@@ -432,7 +432,7 @@
header("HTTP/1.1 {$code} {$text}", TRUE, $code);
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -450,20 +450,20 @@
* @return void
*/
function _exception_handler($severity, $message, $filepath, $line)
- {
+ {
// We don't bother with "strict" notices since they tend to fill up
// the log file with excess information that isn't normally very helpful.
- // For example, if you are running PHP 5 and you use version 4 style
- // class functions (without prefixes like "public", "private", etc.)
+ // For example, if you are running PHP 5 and you use version 4 style
+ // class functions (without prefixes like "public", "private", etc.)
// you'll get notices telling you that these have been deprecated.
if ($severity == E_STRICT)
{
return;
}
-
+
$_error =& load_class('Exceptions', 'core');
-
- // Should we display the error? We'll get the current error_reporting
+
+ // Should we display the error? We'll get the current error_reporting
// level and add its bits with the severity bits to find out.
if (($severity & error_reporting()) == $severity)
{
@@ -475,12 +475,12 @@
{
return;
}
-
+
$_error->log_exception($severity, $message, $filepath, $line);
}
// --------------------------------------------------------------------
-
+
/**
* Remove Invisible Characters
*
@@ -494,7 +494,7 @@
function remove_invisible_characters($str)
{
static $non_displayables;
-
+
if ( ! isset($non_displayables))
{
// every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09),
diff --git a/system/core/Compat.php b/system/core/Compat.php
index 088d5815a..bd11b9836 100644
--- a/system/core/Compat.php
+++ b/system/core/Compat.php
@@ -32,7 +32,7 @@
/*
* PHP versions prior to 5.0 don't support the E_STRICT constant
- * so we need to explicitly define it otherwise the Exception class
+ * so we need to explicitly define it otherwise the Exception class
* will generate errors when running under PHP 4
* @PHP4
*
@@ -61,9 +61,9 @@ if ( ! function_exists('ctype_digit'))
{
return FALSE;
}
-
+
return ! preg_match('/[^0-9]/', $str);
- }
+ }
}
// --------------------------------------------------------------------
@@ -87,9 +87,9 @@ if ( ! function_exists('ctype_alnum'))
{
return FALSE;
}
-
+
return ! preg_match('/[^0-9a-z]/i', $str);
- }
+ }
}
// --------------------------------------------------------------------
diff --git a/system/core/Config.php b/system/core/Config.php
index 7e0443c1f..24503ab5d 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -45,10 +45,10 @@ class CI_Config {
*/
function CI_Config()
{
- $this->config =& get_config();
+ $this->config =& get_config();
log_message('debug', "Config Class Initialized");
}
-
+
// --------------------------------------------------------------------
/**
@@ -57,16 +57,16 @@ class CI_Config {
* @access public
* @param string the config file name
* @return boolean if the file was loaded correctly
- */
+ */
function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
$file = ($file == '') ? 'config' : str_replace(EXT, '', $file);
$loaded = FALSE;
-
+
foreach($this->_config_paths as $path)
{
$file_path = $path.'config/'.$file.EXT;
-
+
if (in_array($file_path, $this->is_loaded, TRUE))
{
$loaded = TRUE;
@@ -77,7 +77,7 @@ class CI_Config {
{
continue;
}
-
+
include($file_path);
if ( ! isset($config) OR ! is_array($config))
@@ -88,7 +88,7 @@ class CI_Config {
}
show_error('Your '.$file_path.' file does not appear to contain a valid configuration array.');
}
-
+
if ($use_sections === TRUE)
{
if (isset($this->config[$file]))
@@ -104,14 +104,14 @@ class CI_Config {
{
$this->config = array_merge($this->config, $config);
}
-
+
$this->is_loaded[] = $file_path;
unset($config);
-
+
$loaded = TRUE;
log_message('debug', 'Config file loaded: '.$file_path);
}
-
+
if ($loaded === FALSE)
{
if ($fail_gracefully === TRUE)
@@ -123,7 +123,7 @@ class CI_Config {
return TRUE;
}
-
+
// --------------------------------------------------------------------
/**
@@ -137,9 +137,9 @@ class CI_Config {
* @return string
*/
function item($item, $index = '')
- {
+ {
if ($index == '')
- {
+ {
if ( ! isset($this->config[$item]))
{
return FALSE;
@@ -164,8 +164,8 @@ class CI_Config {
return $pref;
}
-
- // --------------------------------------------------------------------
+
+ // --------------------------------------------------------------------
/**
* Fetch a config file item - adds slash after item
@@ -188,13 +188,13 @@ class CI_Config {
$pref = $this->config[$item];
if ($pref != '' && substr($pref, -1) != '/')
- {
+ {
$pref .= '/';
}
return $pref;
}
-
+
// --------------------------------------------------------------------
/**
@@ -224,9 +224,9 @@ class CI_Config {
{
$uri = implode('/', $uri);
}
-
+
$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
- return $this->slash_item('base_url').$this->slash_item('index_page').trim($uri, '/').$suffix;
+ return $this->slash_item('base_url').$this->slash_item('index_page').trim($uri, '/').$suffix;
}
else
{
@@ -254,7 +254,7 @@ class CI_Config {
}
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -268,7 +268,7 @@ class CI_Config {
$x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH));
return $this->slash_item('base_url').end($x).'/';
}
-
+
// --------------------------------------------------------------------
/**
@@ -283,7 +283,7 @@ class CI_Config {
{
$this->config[$item] = $value;
}
-
+
// --------------------------------------------------------------------
/**
@@ -296,7 +296,7 @@ class CI_Config {
* @access private
* @param array
* @return void
- */
+ */
function _assign_to_config($items = array())
{
if (is_array($items))
@@ -305,7 +305,7 @@ class CI_Config {
{
$this->set_item($key, $val);
}
- }
+ }
}
}
diff --git a/system/core/Controller.php b/system/core/Controller.php
index c9d797ca2..9bd9912dc 100644
--- a/system/core/Controller.php
+++ b/system/core/Controller.php
@@ -28,18 +28,18 @@
* @link http://codeigniter.com/user_guide/general/controllers.html
*/
class Controller extends CI_Base {
-
+
/**
* Constructor
*
* Calls the initialize() function
*/
function Controller()
- {
+ {
parent::CI_Base();
// Assign all the class objects that were instantiated by the
- // bootstrap file (CodeIgniter.php) to local class variables
+ // bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
foreach (is_loaded() as $var => $class)
{
@@ -48,18 +48,18 @@ class Controller extends CI_Base {
// In PHP 5 the Loader class is run as a discreet
// class. In PHP 4 it extends the Controller @PHP4
- if (is_php('5.0.0') == TRUE)
+ if (is_php('5.0.0') == TRUE)
{
$this->load =& load_class('Loader', 'core');
-
+
$this->load->_base_classes =& is_loaded();
-
+
$this->load->_ci_autoloader();
}
else
{
$this->_ci_autoloader();
-
+
// sync up the objects since PHP4 was working from a copy
foreach (array_keys(get_object_vars($this)) as $attribute)
{
@@ -71,7 +71,7 @@ class Controller extends CI_Base {
}
log_message('debug', "Controller Class Initialized");
-
+
}
}
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index 419ea2b61..108861de7 100644
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -51,13 +51,13 @@ class CI_Exceptions {
/**
* Constructor
*
- */
+ */
function CI_Exceptions()
{
$this->ob_level = ob_get_level();
// Note: Do not log messages from this constructor.
}
-
+
// --------------------------------------------------------------------
/**
@@ -73,9 +73,9 @@ class CI_Exceptions {
* @return string
*/
function log_exception($severity, $message, $filepath, $line)
- {
+ {
$severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
-
+
log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE);
}
@@ -89,7 +89,7 @@ class CI_Exceptions {
* @return string
*/
function show_404($page = '', $log_error = TRUE)
- {
+ {
$heading = "404 Page Not Found";
$message = "The page you requested was not found.";
@@ -102,7 +102,7 @@ class CI_Exceptions {
echo $this->show_error($heading, $message, 'error_404', 404);
exit;
}
-
+
// --------------------------------------------------------------------
/**
@@ -121,12 +121,12 @@ class CI_Exceptions {
function show_error($heading, $message, $template = 'error_general', $status_code = 500)
{
set_status_header($status_code);
-
+
$message = ''.implode('
', ( ! is_array($message)) ? array($message) : $message).'
';
if (ob_get_level() > $this->ob_level + 1)
{
- ob_end_flush();
+ ob_end_flush();
}
ob_start();
include(APPPATH.'errors/'.$template.EXT);
@@ -148,21 +148,21 @@ class CI_Exceptions {
* @return string
*/
function show_php_error($severity, $message, $filepath, $line)
- {
+ {
$severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
-
+
$filepath = str_replace("\\", "/", $filepath);
-
+
// For safety reasons we do not show the full file path
if (FALSE !== strpos($filepath, '/'))
{
$x = explode('/', $filepath);
$filepath = $x[count($x)-2].'/'.end($x);
}
-
+
if (ob_get_level() > $this->ob_level + 1)
{
- ob_end_flush();
+ ob_end_flush();
}
ob_start();
include(APPPATH.'errors/error_php'.EXT);
diff --git a/system/core/Hooks.php b/system/core/Hooks.php
index 3b063f792..9026a5eb6 100644
--- a/system/core/Hooks.php
+++ b/system/core/Hooks.php
@@ -28,8 +28,8 @@
*/
class CI_Hooks {
- var $enabled = FALSE;
- var $hooks = array();
+ var $enabled = FALSE;
+ var $hooks = array();
var $in_progress = FALSE;
/**
@@ -41,7 +41,7 @@ class CI_Hooks {
$this->_initialize();
log_message('debug', "Hooks Class Initialized");
}
-
+
// --------------------------------------------------------------------
/**
@@ -49,9 +49,9 @@ class CI_Hooks {
*
* @access private
* @return void
- */
- function _initialize()
- {
+ */
+ function _initialize()
+ {
$CFG =& load_class('Config', 'core');
// If hooks are not enabled in the config file
@@ -74,8 +74,8 @@ class CI_Hooks {
$this->hooks =& $hook;
$this->enabled = TRUE;
- }
-
+ }
+
// --------------------------------------------------------------------
/**
diff --git a/system/core/Input.php b/system/core/Input.php
index 2eef82458..df3be207c 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -257,7 +257,7 @@ class CI_Input {
{
return $this->ip_address;
}
-
+
if (config_item('proxy_ips') != '' && $this->server('HTTP_X_FORWARDED_FOR') && $this->server('REMOTE_ADDR'))
{
$proxies = preg_split('/[\s,]/', config_item('proxy_ips'), -1, PREG_SPLIT_NO_EMPTY);
@@ -308,7 +308,7 @@ class CI_Input {
* Validate IP Address
*
* Updated version suggested by Geert De Deckere
- *
+ *
* @access public
* @param string
* @return string
@@ -330,7 +330,7 @@ class CI_Input {
// Check each segment
foreach ($ip_segments as $segment)
{
- // IP segments must be digits and can not be
+ // IP segments must be digits and can not be
// longer than 3 digits or greater then 255
if ($segment == '' OR preg_match("/[^0-9]/", $segment) OR $segment > 255 OR strlen($segment) > 3)
{
@@ -383,7 +383,7 @@ class CI_Input {
$protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA',
'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN');
- // Unset globals for securiy.
+ // Unset globals for securiy.
// This is effectively the same as register_globals = off
foreach (array($_GET, $_POST, $_COOKIE) as $global)
{
diff --git a/system/core/Lang.php b/system/core/Lang.php
index e071495b8..cbd4e38b8 100644
--- a/system/core/Lang.php
+++ b/system/core/Lang.php
@@ -120,7 +120,7 @@ class CI_Lang {
* Fetch a single line of text from the language array
*
* @access public
- * @param string $line the language line
+ * @param string $line the language line
* @return string
*/
function line($line = '')
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 292fdc955..69b3da0c9 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -34,7 +34,7 @@ class CI_Loader {
var $_ci_library_paths = array();
var $_ci_model_paths = array();
var $_ci_helper_paths = array();
- var $_ci_is_instance = FALSE; // Whether we should use $this or $CI =& get_instance()
+ var $_ci_is_instance = FALSE; // Whether we should use $this or $CI =& get_instance()
var $_base_classes = array(); // Set by the controller class
var $_ci_cached_vars = array();
var $_ci_classes = array();
@@ -42,7 +42,7 @@ class CI_Loader {
var $_ci_models = array();
var $_ci_helpers = array();
var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent');
-
+
/**
* Constructor
@@ -52,18 +52,18 @@ class CI_Loader {
* @access public
*/
function CI_Loader()
- {
+ {
$this->_ci_view_path = APPPATH.'views/';
$this->_ci_ob_level = ob_get_level();
$this->_ci_library_paths = array(APPPATH, BASEPATH);
$this->_ci_helper_paths = array(APPPATH, BASEPATH);
$this->_ci_model_paths = array(APPPATH);
-
+
log_message('debug', "Loader Class Initialized");
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Class Loader
*
@@ -75,7 +75,7 @@ class CI_Loader {
* @param mixed the optional parameters
* @param string an optional object name
* @return void
- */
+ */
function library($library = '', $params = NULL, $object_name = NULL)
{
if ($library == '' OR isset($this->_base_classes[$library]))
@@ -99,12 +99,12 @@ class CI_Loader {
{
$this->_ci_load_class($library, $params, $object_name);
}
-
+
$this->_ci_assign_to_models();
}
// --------------------------------------------------------------------
-
+
/**
* Model Loader
*
@@ -115,14 +115,14 @@ class CI_Loader {
* @param string name for the model
* @param bool database connection
* @return void
- */
+ */
function model($model, $name = '', $db_conn = FALSE)
- {
+ {
if (is_array($model))
{
foreach($model as $babe)
{
- $this->model($babe);
+ $this->model($babe);
}
return;
}
@@ -131,9 +131,9 @@ class CI_Loader {
{
return;
}
-
+
$path = '';
-
+
// Is the model in a sub-folder? If so, parse out the filename and path.
if (($last_slash = strrpos($model, '/')) !== FALSE)
{
@@ -143,23 +143,23 @@ class CI_Loader {
// And the model name behind it
$model = substr($model, $last_slash + 1);
}
-
+
if ($name == '')
{
$name = $model;
}
-
+
if (in_array($name, $this->_ci_models, TRUE))
{
return;
}
-
+
$CI =& get_instance();
if (isset($CI->$name))
{
show_error('The model name you are loading is the name of a resource that is already being used: '.$name);
}
-
+
$model = strtolower($model);
foreach ($this->_ci_model_paths as $mod_path)
@@ -192,13 +192,13 @@ class CI_Loader {
$this->_ci_models[] = $name;
return;
}
-
+
// couldn't find the model
show_error('Unable to locate the model you have specified: '.$model);
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Database Loader
*
@@ -207,57 +207,57 @@ class CI_Loader {
* @param bool whether to return the DB object
* @param bool whether to enable active record (this allows us to override the config setting)
* @return object
- */
+ */
function database($params = '', $return = FALSE, $active_record = NULL)
{
// Grab the super object
$CI =& get_instance();
-
+
// Do we even need to load the database class?
if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db))
{
return FALSE;
- }
-
+ }
+
require_once(BASEPATH.'database/DB'.EXT);
if ($return === TRUE)
{
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 = '';
-
+
// Load the DB class
- $CI->db =& DB($params, $active_record);
-
+ $CI->db =& DB($params, $active_record);
+
// Assign the DB object to any existing models
$this->_ci_assign_to_models();
}
-
+
// --------------------------------------------------------------------
/**
* Load the Utilities Class
*
* @access public
- * @return string
- */
+ * @return string
+ */
function dbutil()
{
if ( ! class_exists('CI_DB'))
{
$this->database();
}
-
+
$CI =& get_instance();
// for backwards compatibility, load dbforge so we can extend dbutils off it
// this use is deprecated and strongly discouraged
$CI->load->dbforge();
-
+
require_once(BASEPATH.'database/DB_utility'.EXT);
require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT);
$class = 'CI_DB_'.$CI->db->dbdriver.'_utility';
@@ -266,35 +266,35 @@ class CI_Loader {
$CI->load->_ci_assign_to_models();
}
-
+
// --------------------------------------------------------------------
/**
* Load the Database Forge Class
*
* @access public
- * @return string
- */
+ * @return string
+ */
function dbforge()
{
if ( ! class_exists('CI_DB'))
{
$this->database();
}
-
+
$CI =& get_instance();
-
+
require_once(BASEPATH.'database/DB_forge'.EXT);
require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge'.EXT);
$class = 'CI_DB_'.$CI->db->dbdriver.'_forge';
$CI->dbforge = new $class();
-
+
$CI->load->_ci_assign_to_models();
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Load View
*
@@ -316,9 +316,9 @@ class CI_Loader {
{
return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Load File
*
@@ -333,9 +333,9 @@ class CI_Loader {
{
return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return));
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Set Variables
*
@@ -352,9 +352,9 @@ class CI_Loader {
{
$vars = array($vars => $val);
}
-
+
$vars = $this->_ci_object_to_array($vars);
-
+
if (is_array($vars) AND count($vars) > 0)
{
foreach ($vars as $key => $val)
@@ -363,9 +363,9 @@ class CI_Loader {
}
}
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Load Helper
*
@@ -376,9 +376,9 @@ class CI_Loader {
* @return void
*/
function helper($helpers = array())
- {
+ {
foreach ($this->_ci_prep_filename($helpers, '_helper') as $helper)
- {
+ {
if (isset($this->_ci_helpers[$helper]))
{
continue;
@@ -386,33 +386,33 @@ class CI_Loader {
$ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.EXT;
- // Is this a helper extension request?
+ // Is this a helper extension request?
if (file_exists($ext_helper))
{
$base_helper = BASEPATH.'helpers/'.$helper.EXT;
-
+
if ( ! file_exists($base_helper))
{
show_error('Unable to load the requested file: helpers/'.$helper.EXT);
}
-
+
include_once($ext_helper);
include_once($base_helper);
-
+
$this->_ci_helpers[$helper] = TRUE;
log_message('debug', 'Helper loaded: '.$helper);
continue;
}
-
+
// Try to load the helper
foreach ($this->_ci_helper_paths as $path)
{
if (file_exists($path.'helpers/'.$helper.EXT))
- {
+ {
include_once($path.'helpers/'.$helper.EXT);
$this->_ci_helpers[$helper] = TRUE;
- log_message('debug', 'Helper loaded: '.$helper);
+ log_message('debug', 'Helper loaded: '.$helper);
break;
}
}
@@ -420,13 +420,13 @@ class CI_Loader {
// unable to load the helper
if ( ! isset($this->_ci_helpers[$helper]))
{
- show_error('Unable to load the requested file: helpers/'.$helper.EXT);
+ show_error('Unable to load the requested file: helpers/'.$helper.EXT);
}
- }
+ }
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Load Helpers
*
@@ -441,9 +441,9 @@ class CI_Loader {
{
$this->helper($helpers);
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Loads a language file
*
@@ -462,13 +462,13 @@ class CI_Loader {
}
foreach ($file as $langfile)
- {
+ {
$CI->lang->load($langfile, $lang);
}
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Loads a config file
*
@@ -477,7 +477,7 @@ class CI_Loader {
* @return void
*/
function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
- {
+ {
$CI =& get_instance();
$CI->config->load($file, $use_sections, $fail_gracefully);
}
@@ -501,19 +501,19 @@ class CI_Loader {
// we aren't instantiating an object here, that'll be done by the Library itself
require BASEPATH.'libraries/Driver'.EXT;
}
-
+
// We can save the loader some time since Drivers will *always* be in a subfolder,
// and typically identically named to the library
if ( ! strpos($library, '/'))
{
$library = ucfirst($library).'/'.$library;
}
-
+
return $this->library($library, $params, $object_name);
}
// --------------------------------------------------------------------
-
+
/**
* Add Package Path
*
@@ -528,7 +528,7 @@ class CI_Loader {
array_unshift($this->_ci_library_paths, $path);
array_unshift($this->_ci_model_paths, $path);
array_unshift($this->_ci_helper_paths, $path);
-
+
// Add config file path
$config =& $this->_ci_get_component('config');
array_unshift($config->_config_paths, $path);
@@ -549,7 +549,7 @@ class CI_Loader {
function remove_package_path($path = '', $remove_config_path = TRUE)
{
$config =& $this->_ci_get_component('config');
-
+
if ($path == '')
{
$void = array_shift($this->_ci_library_paths);
@@ -566,13 +566,13 @@ class CI_Loader {
unset($this->{$var}[$key]);
}
}
-
+
if (($key = array_search($path, $config->_config_paths)) !== FALSE)
{
unset($config->_config_paths[$key]);
}
}
-
+
// make sure the application default paths are still in the array
$this->_ci_library_paths = array_unique(array_merge($this->_ci_library_paths, array(APPPATH, BASEPATH)));
$this->_ci_helper_paths = array_unique(array_merge($this->_ci_helper_paths, array(APPPATH, BASEPATH)));
@@ -581,7 +581,7 @@ class CI_Loader {
}
// --------------------------------------------------------------------
-
+
/**
* Loader
*
@@ -613,16 +613,16 @@ class CI_Loader {
$_ci_x = explode('/', $_ci_path);
$_ci_file = end($_ci_x);
}
-
+
if ( ! file_exists($_ci_path))
{
show_error('Unable to load the requested file: '.$_ci_file);
}
-
+
// This allows anything loaded using $this->load (views, files, etc.)
// to become accessible from within the Controller and Model functions.
// Only needed when running PHP 5
-
+
if ($this->_ci_is_instance())
{
$_ci_CI =& get_instance();
@@ -642,13 +642,13 @@ class CI_Loader {
* function or via the second parameter of this function. We'll merge
* the two types and cache them so that views that are embedded within
* other views can have access to these variables.
- */
+ */
if (is_array($_ci_vars))
{
$this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars);
}
extract($this->_ci_cached_vars);
-
+
/*
* Buffer the output
*
@@ -662,11 +662,11 @@ class CI_Loader {
* the browser and then stop the timer it won't be accurate.
*/
ob_start();
-
+
// If the PHP installation does not support short tags we'll
// do a little string replacement, changing the short tags
// to standard PHP echo statements.
-
+
if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE)
{
echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('=', ' $this->_ci_ob_level + 1)
{
ob_end_flush();
@@ -717,18 +717,18 @@ class CI_Loader {
* This function loads the requested class.
*
* @access private
- * @param string the item that is being loaded
+ * @param string the item that is being loaded
* @param mixed any additional parameters
* @param string an optional object name
- * @return void
+ * @return void
*/
function _ci_load_class($class, $params = NULL, $object_name = NULL)
- {
- // Get the class name, and while we're at it trim any slashes.
- // The directory path can be included as part of the class name,
+ {
+ // Get the class name, and while we're at it trim any slashes.
+ // The directory path can be included as part of the class name,
// but we don't want a leading slash
$class = str_replace(EXT, '', trim($class, '/'));
-
+
// Was the path included with the class name?
// We look for a slash to determine this
$subdir = '';
@@ -736,7 +736,7 @@ class CI_Loader {
{
// Extract the path
$subdir = substr($class, 0, $last_slash + 1);
-
+
// Get the filename from the path
$class = substr($class, $last_slash + 1);
}
@@ -746,11 +746,11 @@ class CI_Loader {
{
$subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.EXT;
- // Is this a class extension request?
+ // Is this a class extension request?
if (file_exists($subclass))
{
$baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT;
-
+
if ( ! file_exists($baseclass))
{
log_message('error', "Unable to load the requested class: ".$class);
@@ -768,22 +768,22 @@ class CI_Loader {
$CI =& get_instance();
if ( ! isset($CI->$object_name))
{
- return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name);
+ return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name);
}
}
-
+
$is_duplicate = TRUE;
log_message('debug', $class." class already loaded. Second attempt ignored.");
return;
}
-
- include_once($baseclass);
+
+ include_once($baseclass);
include_once($subclass);
$this->_ci_loaded_files[] = $subclass;
-
- return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name);
+
+ return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name);
}
-
+
// Lets search for the requested library file and load it.
$is_duplicate = FALSE;
foreach ($this->_ci_library_paths as $path)
@@ -795,7 +795,7 @@ class CI_Loader {
{
continue;
}
-
+
// Safety: Was the class already loaded by a previous call?
if (in_array($filepath, $this->_ci_loaded_files))
{
@@ -810,15 +810,15 @@ class CI_Loader {
return $this->_ci_init_class($class, '', $params, $object_name);
}
}
-
+
$is_duplicate = TRUE;
log_message('debug', $class." class already loaded. Second attempt ignored.");
return;
}
-
+
include_once($filepath);
$this->_ci_loaded_files[] = $filepath;
- return $this->_ci_init_class($class, '', $params, $object_name);
+ return $this->_ci_init_class($class, '', $params, $object_name);
}
} // END FOREACH
@@ -829,7 +829,7 @@ class CI_Loader {
$path = strtolower($class).'/'.$class;
return $this->_ci_load_class($path, $params);
}
-
+
// If we got this far we were unable to find the requested class.
// We do not issue errors if the load call failed due to a duplicate request
if ($is_duplicate == FALSE)
@@ -838,7 +838,7 @@ class CI_Loader {
show_error("Unable to load the requested class: ".$class);
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -851,7 +851,7 @@ class CI_Loader {
* @return null
*/
function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL)
- {
+ {
// Is there an associated config file for this class? Note: these should always be lowercase
if ($config === NULL)
{
@@ -860,20 +860,20 @@ class CI_Loader {
if (file_exists(APPPATH.'config/'.strtolower($class).EXT))
{
include_once(APPPATH.'config/'.strtolower($class).EXT);
- }
+ }
elseif (file_exists(APPPATH.'config/'.ucfirst(strtolower($class)).EXT))
{
include_once(APPPATH.'config/'.ucfirst(strtolower($class)).EXT);
}
}
-
+
if ($prefix == '')
- {
- if (class_exists('CI_'.$class))
+ {
+ if (class_exists('CI_'.$class))
{
$name = 'CI_'.$class;
}
- elseif (class_exists(config_item('subclass_prefix').$class))
+ elseif (class_exists(config_item('subclass_prefix').$class))
{
$name = config_item('subclass_prefix').$class;
}
@@ -886,18 +886,18 @@ class CI_Loader {
{
$name = $prefix.$class;
}
-
+
// Is the class name valid?
if ( ! class_exists($name))
{
log_message('error', "Non-existent class: ".$name);
show_error("Non-existent class: ".$class);
}
-
+
// Set the variable name we will assign the class to
// Was a custom class name supplied? If so we'll use it
$class = strtolower($class);
-
+
if (is_null($object_name))
{
$classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class];
@@ -907,23 +907,23 @@ class CI_Loader {
$classvar = $object_name;
}
- // Save the class name and object name
+ // Save the class name and object name
$this->_ci_classes[$class] = $classvar;
- // Instantiate the class
+ // Instantiate the class
$CI =& get_instance();
if ($config !== NULL)
{
$CI->$classvar = new $name($config);
}
else
- {
+ {
$CI->$classvar = new $name;
- }
- }
-
+ }
+ }
+
// --------------------------------------------------------------------
-
+
/**
* Autoloader
*
@@ -935,31 +935,31 @@ class CI_Loader {
* @return void
*/
function _ci_autoloader()
- {
+ {
include_once(APPPATH.'config/autoload'.EXT);
-
+
if ( ! isset($autoload))
{
return FALSE;
}
-
+
// Load any custom config file
if (count($autoload['config']) > 0)
- {
+ {
$CI =& get_instance();
foreach ($autoload['config'] as $key => $val)
{
$CI->config->load($val);
}
- }
+ }
// Autoload helpers and languages
foreach (array('helper', 'language') as $type)
- {
+ {
if (isset($autoload[$type]) AND count($autoload[$type]) > 0)
{
$this->$type($autoload[$type]);
- }
+ }
}
// A little tweak to remain backward compatible
@@ -968,7 +968,7 @@ class CI_Loader {
{
$autoload['libraries'] = $autoload['core'];
}
-
+
// Load libraries
if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0)
{
@@ -978,13 +978,13 @@ class CI_Loader {
$this->database();
$autoload['libraries'] = array_diff($autoload['libraries'], array('database'));
}
-
+
// Load all other libraries
foreach ($autoload['libraries'] as $item)
{
$this->library($item);
}
- }
+ }
// Autoload models
if (isset($autoload['model']))
@@ -993,7 +993,7 @@ class CI_Loader {
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -1012,13 +1012,13 @@ class CI_Loader {
{
return;
}
-
+
foreach($this->_ci_models as $model)
{
$model = $this->_ci_get_component($model);
$model->_assign_libraries();
}
- }
+ }
// --------------------------------------------------------------------
@@ -1041,7 +1041,7 @@ class CI_Loader {
/**
* Determines whether we should use the CI instance or $this
* @PHP4
- *
+ *
* @access private
* @return bool
*/
@@ -1051,11 +1051,11 @@ class CI_Loader {
{
return TRUE;
}
-
+
global $CI;
return (is_object($CI)) ? TRUE : FALSE;
}
-
+
// --------------------------------------------------------------------
/**
@@ -1078,7 +1078,7 @@ class CI_Loader {
}
// --------------------------------------------------------------------
-
+
/**
* Prep filename
*
@@ -1091,20 +1091,20 @@ class CI_Loader {
function _ci_prep_filename($filename, $extension)
{
if ( ! is_array($filename))
- {
- return array(strtolower(str_replace(EXT, '', str_replace($extension, '', $filename)).$extension));
+ {
+ return array(strtolower(str_replace(EXT, '', str_replace($extension, '', $filename)).$extension));
}
else
{
foreach ($filename as $key => $val)
{
- $filename[$key] = strtolower(str_replace(EXT, '', str_replace($extension, '', $val)).$extension);
+ $filename[$key] = strtolower(str_replace(EXT, '', str_replace($extension, '', $val)).$extension);
}
-
+
return $filename;
}
}
-
+
}
diff --git a/system/core/Model.php b/system/core/Model.php
index 16c4e7dd8..ebbb0fbe6 100644
--- a/system/core/Model.php
+++ b/system/core/Model.php
@@ -37,11 +37,11 @@ class CI_Model {
{
// If the magic __get() or __set() methods are used in a Model references can't be used.
$this->_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE );
-
+
// We don't want to assign the model object to itself when using the
// assign_libraries function below so we'll grab the name of the model parent
$this->_parent_name = ucfirst(get_class($this));
-
+
log_message('debug', "Model Class Initialized");
}
@@ -50,17 +50,17 @@ class CI_Model {
*
* Creates local references to all currently instantiated objects
* so that any syntax that can be legally used in a controller
- * can be used within models.
+ * can be used within models.
*
* @access private
- */
+ */
function _assign_libraries($use_reference = TRUE)
{
- $CI =& get_instance();
+ $CI =& get_instance();
foreach (array_keys(get_object_vars($CI)) as $key)
{
if ( ! isset($this->$key) AND $key != $this->_parent_name)
- {
+ {
// In some cases using references can cause
// problems so we'll conditionally use them
if ($use_reference == TRUE)
@@ -74,7 +74,7 @@ class CI_Model {
$this->$key = $CI->$key;
}
}
- }
+ }
}
}
diff --git a/system/core/Output.php b/system/core/Output.php
index ad9ffbabe..04e452d2c 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -30,8 +30,8 @@ class CI_Output {
var $final_output;
var $cache_expiration = 0;
- var $headers = array();
- var $enable_profiler = FALSE;
+ var $headers = array();
+ var $enable_profiler = FALSE;
var $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage}
var $_zlib_oc = FALSE;
@@ -40,12 +40,12 @@ class CI_Output {
function CI_Output()
{
$this->_zlib_oc = @ini_get('zlib.output_compression');
-
+
log_message('debug', "Output Class Initialized");
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Get Output
*
@@ -53,14 +53,14 @@ class CI_Output {
*
* @access public
* @return string
- */
+ */
function get_output()
{
return $this->final_output;
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Set Output
*
@@ -69,7 +69,7 @@ class CI_Output {
* @access public
* @param string
* @return void
- */
+ */
function set_output($output)
{
$this->final_output = $output;
@@ -85,7 +85,7 @@ class CI_Output {
* @access public
* @param string
* @return void
- */
+ */
function append_output($output)
{
if ($this->final_output == '')
@@ -111,52 +111,52 @@ class CI_Output {
* @access public
* @param string
* @return void
- */
+ */
function set_header($header, $replace = TRUE)
{
// If zlib.output_compression is enabled it will compress the output,
// but it will not modify the content-length header to compensate for
// the reduction, causing the browser to hang waiting for more data.
// We'll just skip content-length in those cases.
-
+
if ($this->_zlib_oc && strncasecmp($header, 'content-length', 14) == 0)
{
return;
}
-
+
$this->headers[] = array($header, $replace);
}
// --------------------------------------------------------------------
-
+
/**
* Set HTTP Status Header
* moved to Common procedural functions in 1.7.2
- *
+ *
* @access public
- * @param int the status code
- * @param string
+ * @param int the status code
+ * @param string
* @return void
- */
+ */
function set_status_header($code = 200, $text = '')
{
set_status_header($code, $text);
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Enable/disable Profiler
*
* @access public
* @param bool
* @return void
- */
+ */
function enable_profiler($val = TRUE)
{
$this->enable_profiler = (is_bool($val)) ? $val : TRUE;
}
-
+
// --------------------------------------------------------------------
/**
@@ -177,21 +177,21 @@ class CI_Output {
}
// --------------------------------------------------------------------
-
+
/**
* Set Cache
*
* @access public
* @param integer
* @return void
- */
+ */
function cache($time)
{
$this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time;
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Display Output
*
@@ -205,9 +205,9 @@ class CI_Output {
*
* @access public
* @return mixed
- */
+ */
function _display($output = '')
- {
+ {
// 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.
@@ -220,15 +220,15 @@ class CI_Output {
}
// --------------------------------------------------------------------
-
+
// Set the output data
if ($output == '')
{
$output =& $this->final_output;
}
-
+
// --------------------------------------------------------------------
-
+
// 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
@@ -236,24 +236,24 @@ class CI_Output {
{
$this->_write_cache($output);
}
-
+
// --------------------------------------------------------------------
// Parse out the elapsed time and memory usage,
// then swap the pseudo-variables with the data
-
- $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
+
+ $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
if ($this->parse_exec_vars === TRUE)
{
$memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
-
+
$output = str_replace('{elapsed_time}', $elapsed, $output);
$output = str_replace('{memory_usage}', $memory, $output);
}
// --------------------------------------------------------------------
-
+
// Is compression requested?
if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE)
{
@@ -267,7 +267,7 @@ class CI_Output {
}
// --------------------------------------------------------------------
-
+
// Are there any server headers to send?
if (count($this->headers) > 0)
{
@@ -275,10 +275,10 @@ class CI_Output {
{
@header($header[0], $header[1]);
}
- }
+ }
// --------------------------------------------------------------------
-
+
// Does the $CI object exist?
// If not we know we are dealing with a cache file so we'll
// simply echo out the data and exit.
@@ -289,19 +289,19 @@ class CI_Output {
log_message('debug', "Total execution time: ".$elapsed);
return TRUE;
}
-
+
// --------------------------------------------------------------------
-
+
// Do we need to generate profile data?
// If so, load the Profile class and run it.
if ($this->enable_profiler == TRUE)
{
- $CI->load->library('profiler');
-
+ $CI->load->library('profiler');
+
if ( ! empty($this->_profiler_sections))
{
$CI->profiler->set_sections($this->_profiler_sections);
- }
+ }
// If the output data contains closing