From e3a6e9b085f95fe97deb21e103dc0fd381b8122f Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Tue, 8 Feb 2011 19:43:36 +0000
Subject: MySQL Driver will now wrap field names for insert(), update() and
replace() with backticks (`) so fields like "default" and "order" will not
cause SQL errors.
---
system/database/drivers/mysql/mysql_driver.php | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
(limited to 'system')
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index df18c912e..c9fc1ecab 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -287,12 +287,12 @@ class CI_DB_mysql_driver extends CI_DB {
if (is_array($str))
{
foreach($str as $key => $val)
- {
+ {
$str[$key] = $this->escape_str($val, $like);
- }
+ }
- return $str;
- }
+ return $str;
+ }
if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id))
{
@@ -532,7 +532,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -551,7 +551,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -569,7 +569,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
+ return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values);
}
// --------------------------------------------------------------------
@@ -592,7 +592,7 @@ class CI_DB_mysql_driver extends CI_DB {
{
foreach($values as $key => $val)
{
- $valstr[] = $key." = ".$val;
+ $valstr[] = sprintf('`%s` = %s', $key, $val);
}
$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
--
cgit v1.2.3-24-g4f1b
From 96bd33b2edc1b0e6a04cb8e3bcf97e8c7b3adf3e Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 4 May 2011 01:30:36 +0100
Subject: Added Migration class and language file.
---
system/language/english/migration_lang.php | 13 ++++
system/libraries/Migration.php | 95 +++++++++++++++---------------
2 files changed, 62 insertions(+), 46 deletions(-)
create mode 100644 system/language/english/migration_lang.php
(limited to 'system')
diff --git a/system/language/english/migration_lang.php b/system/language/english/migration_lang.php
new file mode 100644
index 000000000..4763ca243
--- /dev/null
+++ b/system/language/english/migration_lang.php
@@ -0,0 +1,13 @@
+_migration_path = rtrim($this->_migration_path, '/').'/';
+ // Load migration language
+ $this->lang->load('migration');
+
// They'll probably be using dbforge
$this->load->dbforge();
@@ -90,7 +93,7 @@ class CI_Migration {
* @param $version integer Target schema version
* @return mixed TRUE if already latest, FALSE if failed, int if upgraded
*/
- function version($target_version)
+ public function version($target_version)
{
$start = $current_version = $this->_get_version();
$stop = $target_version;
@@ -108,7 +111,7 @@ class CI_Migration {
// Moving Down
$step = -1;
}
-
+
$method = $step === 1 ? 'up' : 'down';
$migrations = array();
@@ -121,7 +124,7 @@ class CI_Migration {
// Only one migration per step is permitted
if (count($f) > 1)
{
- $this->error = sprintf($this->lang->line('multiple_migration_version'), $i);
+ $this->error = sprintf($this->lang->line('migration_multiple_version'), $i);
return FALSE;
}
@@ -152,7 +155,7 @@ class CI_Migration {
// Cannot repeat a migration at different steps
if (in_array($match[1], $migrations))
{
- $this->error = sprintf($this->lang->line('multiple_migrations_name'), $match[1]);
+ $this->error = sprintf($this->lang->line('migration_multiple_version'), $match[1]);
return FALSE;
}
@@ -165,9 +168,9 @@ class CI_Migration {
return FALSE;
}
- if ( ! is_callable(array($class, 'up')) || ! is_callable(array($class, 'down')))
+ if ( ! is_callable(array($class, $method)))
{
- $this->error = sprintf($this->lang->line('wrong_migration_interface'), $class);
+ $this->error = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
}
@@ -175,12 +178,13 @@ class CI_Migration {
}
else
{
- $this->error = sprintf($this->lang->line('invalid_migration_filename'), $file);
+ exit('313');
+ $this->error = sprintf($this->lang->line('migration_invalid_filename'), $file);
return FALSE;
}
}
- $this->log('Current schema version: ' . $current_version);
+ log_message('debug', 'Current migration: ' . $current_version);
$version = $i + ($step == 1 ? -1 : 0);
@@ -190,7 +194,7 @@ class CI_Migration {
return TRUE;
}
- $this->log('Moving ' . $method . ' to version ' . $version);
+ log_message('debug', 'Migrating from ' . $method . ' to version ' . $version);
// Loop through the migrations
foreach ($migrations AS $migration)
@@ -203,7 +207,7 @@ class CI_Migration {
$this->_update_version($current_version);
}
- $this->log('All done. Schema is at version '.$current_version);
+ log_message('debug', 'Finished migrating to '.$current_version);
return $current_version;
}
@@ -220,16 +224,15 @@ class CI_Migration {
{
if ( ! $migrations = $this->find_migrations())
{
- throw new Exception('no_migrations_found');
+ $this->error = $this->line->lang('migration_none_found');
return false;
}
$last_migration = basename(end($migrations));
-
+
// Calculate the last migration step from existing migration
// filenames and procceed to the standard version migration
- $last_version = intval(substr($last_migration, 0, 3));
- return $this->version($last_version);
+ return $this->version((int) substr($last_migration, 0, 3));
}
// --------------------------------------------------------------------
@@ -242,25 +245,36 @@ class CI_Migration {
*/
public function current()
{
- $version = $this->_migration_version;
- return $this->version($version);
+ return $this->version($this->_migration_version);
}
// --------------------------------------------------------------------
/**
- * Set's the schema to the latest migration
+ * Error string
*
* @access public
- * @return mixed true if already latest, false if failed, int if upgraded
+ * @return string Error message returned as a string
*/
+ public function error_string()
+ {
+ return $this->error;
+ }
- protected static function find_migrations()
+ // --------------------------------------------------------------------
+
+ /**
+ * Set's the schema to the latest migration
+ *
+ * @access protected
+ * @return mixed true if already latest, false if failed, int if upgraded
+ */
+ protected function find_migrations()
{
// Load all *_*.php files in the migrations path
$files = glob($this->_migration_path . '*_*.php');
$file_count = count($files);
-
+
for ($i = 0; $i < $file_count; $i++)
{
// Mark wrongly formatted files as false for later filtering
@@ -270,7 +284,7 @@ class CI_Migration {
$files[$i] = FALSE;
}
}
-
+
sort($files);
return $files;
@@ -281,10 +295,10 @@ class CI_Migration {
/**
* Retrieves current schema version
*
- * @access private
- * @return integer Current Schema version
+ * @access protected
+ * @return integer Current Migration
*/
- private function _get_version()
+ protected function _get_version()
{
$row = $this->db->get('migrations')->row();
return $row ? $row->version : 0;
@@ -295,11 +309,11 @@ class CI_Migration {
/**
* Stores the current schema version
*
- * @access private
- * @param $migrations integer Schema version reached
+ * @access protected
+ * @param $migrations integer Migration reached
* @return void Outputs a report of the migration
*/
- private function _update_version($migrations)
+ protected function _update_version($migrations)
{
return $this->db->update('migrations', array(
'version' => $migrations
@@ -308,20 +322,6 @@ class CI_Migration {
// --------------------------------------------------------------------
- /**
- * Stores the current schema version
- *
- * @access private
- * @param $migrations integer Schema version reached
- * @return void Outputs a report of the migration
- */
- private function log($text)
- {
- echo $text.'
';
- }
-
- // --------------------------------------------------------------------
-
/**
* Enable the use of CI super-global
*
@@ -333,4 +333,7 @@ class CI_Migration {
{
return get_instance()->$var;
}
-}
\ No newline at end of file
+}
+
+/* End of file Migration.php */
+/* Location: ./system/libraries/Migration.php */
\ No newline at end of file
--
cgit v1.2.3-24-g4f1b
From 168b3de75cd7161308eab89576df5353e40bae76 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 4 May 2011 09:44:22 +0100
Subject: Reverted partial MySQL driver change which double-escaped some
fields.
---
system/database/drivers/mysql/mysql_driver.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'system')
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index c4691ba0b..4ff9b0a11 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -532,7 +532,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
+ return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -551,7 +551,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
+ return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -569,7 +569,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values);
+ return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
}
// --------------------------------------------------------------------
--
cgit v1.2.3-24-g4f1b
From cb06c65e45120d084c8839d4caa344f0d84dc1a1 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 4 May 2011 10:50:25 +0100
Subject: Made a few uniform changes to Migrations.
---
system/libraries/Migration.php | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
(limited to 'system')
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index 4bf1d0dc1..3943ec130 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -33,7 +33,7 @@ class CI_Migration {
protected $_migration_path = NULL;
protected $_migration_version = 0;
- public $error = '';
+ protected $_error_string = '';
public function __construct($config = array())
{
@@ -124,7 +124,7 @@ class CI_Migration {
// Only one migration per step is permitted
if (count($f) > 1)
{
- $this->error = sprintf($this->lang->line('migration_multiple_version'), $i);
+ $this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i);
return FALSE;
}
@@ -140,7 +140,7 @@ class CI_Migration {
// If trying to migrate down but we're missing a step,
// something must definitely be wrong.
- $this->error = sprintf($this->lang->line('migration_not_found'), $i);
+ $this->_error_string = sprintf($this->lang->line('migration_not_found'), $i);
return FALSE;
}
@@ -155,7 +155,7 @@ class CI_Migration {
// Cannot repeat a migration at different steps
if (in_array($match[1], $migrations))
{
- $this->error = sprintf($this->lang->line('migration_multiple_version'), $match[1]);
+ $this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]);
return FALSE;
}
@@ -164,13 +164,13 @@ class CI_Migration {
if ( ! class_exists($class))
{
- $this->error = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);
+ $this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);
return FALSE;
}
if ( ! is_callable(array($class, $method)))
{
- $this->error = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
+ $this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
}
@@ -178,8 +178,7 @@ class CI_Migration {
}
else
{
- exit('313');
- $this->error = sprintf($this->lang->line('migration_invalid_filename'), $file);
+ $this->_error_string = sprintf($this->lang->line('migration_invalid_filename'), $file);
return FALSE;
}
}
@@ -224,7 +223,7 @@ class CI_Migration {
{
if ( ! $migrations = $this->find_migrations())
{
- $this->error = $this->line->lang('migration_none_found');
+ $this->_error_string = $this->line->lang('migration_none_found');
return false;
}
@@ -258,7 +257,7 @@ class CI_Migration {
*/
public function error_string()
{
- return $this->error;
+ return $this->_error_string;
}
// --------------------------------------------------------------------
--
cgit v1.2.3-24-g4f1b
From 3837ae79a34a04559cabb862abda504f47ef069d Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Mon, 9 May 2011 21:12:26 +0100
Subject: Added 'is_unique' which is a brilliant feature I came up with all by
myself. Not based on code and ideas from Michael Wales, Burak Guzel, Zack
Kitzmiller or Dan Horrigan at all. If they say any differently they are
lying.
---
system/language/english/form_validation_lang.php | 3 +-
system/libraries/Form_validation.php | 119 +++++++++++++----------
2 files changed, 70 insertions(+), 52 deletions(-)
(limited to 'system')
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index 3f2409007..abc30bcf3 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -1,4 +1,4 @@
-';
- var $_error_suffix = '
';
- var $error_string = '';
- var $_safe_form_data = FALSE;
-
+ protected $CI;
+ protected $_field_data = array();
+ protected $_config_rules = array();
+ protected $_error_array = array();
+ protected $_error_messages = array();
+ protected $_error_prefix = '';
+ protected $_error_suffix = '
';
+ protected $error_string = '';
+ protected $_safe_form_data = FALSE;
/**
* Constructor
@@ -72,7 +71,7 @@ class CI_Form_validation {
* @param string
* @return void
*/
- function set_rules($field, $label = '', $rules = '')
+ public function set_rules($field, $label = '', $rules = '')
{
// No reason to set rules if we have no POST data
if (count($_POST) == 0)
@@ -163,7 +162,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_message($lang, $val = '')
+ public function set_message($lang, $val = '')
{
if ( ! is_array($lang))
{
@@ -187,7 +186,7 @@ class CI_Form_validation {
* @param string
* @return void
*/
- function set_error_delimiters($prefix = '', $suffix = '
')
+ public function set_error_delimiters($prefix = '', $suffix = '
')
{
$this->_error_prefix = $prefix;
$this->_error_suffix = $suffix;
@@ -206,7 +205,7 @@ class CI_Form_validation {
* @param string the field name
* @return void
*/
- function error($field = '', $prefix = '', $suffix = '')
+ public function error($field = '', $prefix = '', $suffix = '')
{
if ( ! isset($this->_field_data[$field]['error']) OR $this->_field_data[$field]['error'] == '')
{
@@ -238,7 +237,7 @@ class CI_Form_validation {
* @param string
* @return str
*/
- function error_string($prefix = '', $suffix = '')
+ public function error_string($prefix = '', $suffix = '')
{
// No errrors, validation passes!
if (count($this->_error_array) === 0)
@@ -279,7 +278,7 @@ class CI_Form_validation {
* @access public
* @return bool
*/
- function run($group = '')
+ public function run($group = '')
{
// Do we even have any data to process? Mm?
if (count($_POST) == 0)
@@ -374,7 +373,7 @@ class CI_Form_validation {
* @param integer
* @return mixed
*/
- function _reduce_array($array, $keys, $i = 0)
+ protected function _reduce_array($array, $keys, $i = 0)
{
if (is_array($array))
{
@@ -406,7 +405,7 @@ class CI_Form_validation {
* @access private
* @return null
*/
- function _reset_post_array()
+ protected function _reset_post_array()
{
foreach ($this->_field_data as $field => $row)
{
@@ -468,7 +467,7 @@ class CI_Form_validation {
* @param integer
* @return mixed
*/
- function _execute($row, $rules, $postdata = NULL, $cycles = 0)
+ protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
{
// If the $_POST data is an array we will run a recursive call
if (is_array($postdata))
@@ -695,7 +694,7 @@ class CI_Form_validation {
* @param string the field name
* @return string
*/
- function _translate_fieldname($fieldname)
+ protected function _translate_fieldname($fieldname)
{
// Do we need to translate the field name?
// We look for the prefix lang: to determine this
@@ -727,7 +726,7 @@ class CI_Form_validation {
* @param string
* @return void
*/
- function set_value($field = '', $default = '')
+ public function set_value($field = '', $default = '')
{
if ( ! isset($this->_field_data[$field]))
{
@@ -757,7 +756,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_select($field = '', $value = '', $default = FALSE)
+ public function set_select($field = '', $value = '', $default = FALSE)
{
if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
{
@@ -801,7 +800,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_radio($field = '', $value = '', $default = FALSE)
+ public function set_radio($field = '', $value = '', $default = FALSE)
{
if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
{
@@ -845,7 +844,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_checkbox($field = '', $value = '', $default = FALSE)
+ public function set_checkbox($field = '', $value = '', $default = FALSE)
{
if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
{
@@ -885,7 +884,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function required($str)
+ public function required($str)
{
if ( ! is_array($str))
{
@@ -907,7 +906,7 @@ class CI_Form_validation {
* @param regex
* @return bool
*/
- function regex_match($str, $regex)
+ public function regex_match($str, $regex)
{
if ( ! preg_match($regex, $str))
{
@@ -927,7 +926,7 @@ class CI_Form_validation {
* @param field
* @return bool
*/
- function matches($str, $field)
+ public function matches($str, $field)
{
if ( ! isset($_POST[$field]))
{
@@ -938,6 +937,24 @@ class CI_Form_validation {
return ($str !== $field) ? FALSE : TRUE;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Match one field to another
+ *
+ * @access public
+ * @param string
+ * @param field
+ * @return bool
+ */
+ public function is_unique($str, $field)
+ {
+ list($table, $field)=explode('.', $field);
+ $query = $this->CI->db->limit(1)->get_where($table, array($field => $str));
+
+ return $query->num_rows() === 0;
+ }
// --------------------------------------------------------------------
@@ -949,7 +966,7 @@ class CI_Form_validation {
* @param value
* @return bool
*/
- function min_length($str, $val)
+ public function min_length($str, $val)
{
if (preg_match("/[^0-9]/", $val))
{
@@ -974,7 +991,7 @@ class CI_Form_validation {
* @param value
* @return bool
*/
- function max_length($str, $val)
+ public function max_length($str, $val)
{
if (preg_match("/[^0-9]/", $val))
{
@@ -999,7 +1016,7 @@ class CI_Form_validation {
* @param value
* @return bool
*/
- function exact_length($str, $val)
+ public function exact_length($str, $val)
{
if (preg_match("/[^0-9]/", $val))
{
@@ -1023,7 +1040,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function valid_email($str)
+ public function valid_email($str)
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}
@@ -1037,7 +1054,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function valid_emails($str)
+ public function valid_emails($str)
{
if (strpos($str, ',') === FALSE)
{
@@ -1064,7 +1081,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function valid_ip($ip)
+ public function valid_ip($ip)
{
return $this->CI->input->valid_ip($ip);
}
@@ -1078,7 +1095,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function alpha($str)
+ public function alpha($str)
{
return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
}
@@ -1092,7 +1109,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function alpha_numeric($str)
+ public function alpha_numeric($str)
{
return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE;
}
@@ -1106,7 +1123,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function alpha_dash($str)
+ public function alpha_dash($str)
{
return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
}
@@ -1120,7 +1137,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function numeric($str)
+ public function numeric($str)
{
return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str);
@@ -1135,7 +1152,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function is_numeric($str)
+ public function is_numeric($str)
{
return ( ! is_numeric($str)) ? FALSE : TRUE;
}
@@ -1149,7 +1166,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function integer($str)
+ public function integer($str)
{
return (bool) preg_match('/^[\-+]?[0-9]+$/', $str);
}
@@ -1163,7 +1180,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function decimal($str)
+ public function decimal($str)
{
return (bool) preg_match('/^[\-+]?[0-9]+\.[0-9]+$/', $str);
}
@@ -1177,7 +1194,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function greater_than($str, $min)
+ public function greater_than($str, $min)
{
if ( ! is_numeric($str))
{
@@ -1195,7 +1212,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function less_than($str, $max)
+ public function less_than($str, $max)
{
if ( ! is_numeric($str))
{
@@ -1213,7 +1230,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function is_natural($str)
+ public function is_natural($str)
{
return (bool) preg_match( '/^[0-9]+$/', $str);
}
@@ -1227,7 +1244,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function is_natural_no_zero($str)
+ public function is_natural_no_zero($str)
{
if ( ! preg_match( '/^[0-9]+$/', $str))
{
@@ -1254,7 +1271,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function valid_base64($str)
+ public function valid_base64($str)
{
return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str);
}
@@ -1271,7 +1288,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function prep_for_form($data = '')
+ public function prep_for_form($data = '')
{
if (is_array($data))
{
@@ -1300,7 +1317,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function prep_url($str = '')
+ public function prep_url($str = '')
{
if ($str == 'http://' OR $str == '')
{
@@ -1324,7 +1341,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function strip_image_tags($str)
+ public function strip_image_tags($str)
{
return $this->CI->input->strip_image_tags($str);
}
@@ -1338,7 +1355,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function xss_clean($str)
+ public function xss_clean($str)
{
return $this->CI->security->xss_clean($str);
}
@@ -1352,7 +1369,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function encode_php_tags($str)
+ public function encode_php_tags($str)
{
return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str);
}
@@ -1361,4 +1378,4 @@ class CI_Form_validation {
// END Form Validation Class
/* End of file Form_validation.php */
-/* Location: ./system/libraries/Form_validation.php */
+/* Location: ./system/libraries/Form_validation.php */
\ No newline at end of file
--
cgit v1.2.3-24-g4f1b
From 63df37de043a3581a328e63207ea1c809c0e74c2 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Mon, 9 May 2011 21:14:37 +0100
Subject: Removed accidental whitespace.
---
system/language/english/form_validation_lang.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'system')
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index abc30bcf3..3418f29ab 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -1,4 +1,4 @@
-
Date: Fri, 20 May 2011 10:25:13 -0500
Subject: modified the 'use_set_names' variable in the MySQL/i drivers to be a
class property instead of static, in case multiple database servers are
connected to in a single request. Also clarified description of the
'dbcollat' setting in the configuration files
---
system/database/drivers/mysql/mysql_driver.php | 11 ++++++-----
system/database/drivers/mysqli/mysqli_driver.php | 11 ++++++-----
2 files changed, 12 insertions(+), 10 deletions(-)
(limited to 'system')
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index dec15863f..73a8b68da 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -54,6 +54,9 @@ class CI_DB_mysql_driver extends CI_DB {
var $_count_string = 'SELECT COUNT(*) AS ';
var $_random_keyword = ' RAND()'; // database specific random keyword
+ // whether SET NAMES must be used to set the character set
+ var $use_set_names;
+
/**
* Non-persistent database connection
*
@@ -132,15 +135,13 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function db_set_charset($charset, $collation)
{
- static $use_set_names;
-
- if ( ! isset($use_set_names))
+ if ( ! isset($this->use_set_names))
{
// mysql_set_charset() requires PHP >= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback
- $use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE;
+ $this->use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE;
}
- if ($use_set_names)
+ if ($this->use_set_names === TRUE)
{
return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id);
}
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 74f55c421..457582498 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -54,6 +54,9 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
var $delete_hack = TRUE;
+ // whether SET NAMES must be used to set the character set
+ var $use_set_names;
+
// --------------------------------------------------------------------
/**
@@ -132,15 +135,13 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
function _db_set_charset($charset, $collation)
{
- static $use_set_names;
-
- if ( ! isset($use_set_names))
+ if ( ! isset($this->use_set_names))
{
// mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback
- $use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE;
+ $this->use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE;
}
- if ($use_set_names)
+ if ($this->use_set_names === TRUE)
{
return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'");
}
--
cgit v1.2.3-24-g4f1b
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
---
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 ++++++++++-----------
102 files changed, 986 insertions(+), 986 deletions(-)
(limited to 'system')
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("|