From 993925b47a0bfb08e79961c47bcc3d247a03a5dd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 21 Aug 2008 12:43:31 +0000 Subject: whitespace fixes a minor re-ordering of the changelog --- system/libraries/Controller.php | 12 +-- system/libraries/Email.php | 6 +- system/libraries/Session.php | 158 ++++++++++++++++++++-------------------- system/libraries/Upload.php | 2 +- system/libraries/Validation.php | 22 +++--- system/libraries/Zip.php | 30 ++++---- 6 files changed, 115 insertions(+), 115 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 5c96c577a..f9c6bd270 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -87,12 +87,12 @@ class Controller extends CI_Base { // sync up the objects since PHP4 was working from a copy foreach (array_keys(get_object_vars($this)) as $attribute) - { - if (is_object($this->$attribute)) - { - $this->load->$attribute =& $this->$attribute; - } - } + { + if (is_object($this->$attribute)) + { + $this->load->$attribute =& $this->$attribute; + } + } } } diff --git a/system/libraries/Email.php b/system/libraries/Email.php index b0d9f1269..ca1093a9b 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1169,7 +1169,7 @@ class CI_Email { // Standardize newlines if (strpos($str, "\r") !== FALSE) { - $str = str_replace(array("\r\n", "\r"), "\n", $str); + $str = str_replace(array("\r\n", "\r"), "\n", $str); } // We are intentionally wrapping so mail servers will encode characters @@ -1179,8 +1179,8 @@ class CI_Email { // Break into an array of lines $lines = explode("\n", $str); - $escape = '='; - $output = ''; + $escape = '='; + $output = ''; foreach ($lines as $line) { diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 9907ade47..9fad08cf9 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -69,10 +69,10 @@ class CI_Session { $this->CI->load->helper('string'); // Do we need encryption? If so, load the encryption class - if ($this->sess_encrypt_cookie == TRUE) + if ($this->sess_encrypt_cookie == TRUE) { $this->CI->load->library('encrypt'); - } + } // Are we using a database? If so, load it if ($this->sess_use_database === TRUE AND $this->sess_table_name != '') @@ -106,10 +106,10 @@ class CI_Session { } // Delete 'old' flashdata (from last request) - $this->_flashdata_sweep(); - - // Mark all new flashdata as old (data will be deleted before next request) - $this->_flashdata_mark(); + $this->_flashdata_sweep(); + + // Mark all new flashdata as old (data will be deleted before next request) + $this->_flashdata_mark(); // Delete expired sessions if necessary $this->_sess_gc(); @@ -361,7 +361,7 @@ class CI_Session { // Turn it into a hash $new_sessid = md5(uniqid($new_sessid, TRUE)); - // Update the session data in the session data array + // Update the session data in the session data array $this->userdata['session_id'] = $new_sessid; $this->userdata['last_activity'] = $this->now; @@ -427,7 +427,7 @@ class CI_Session { */ function all_userdata() { - return ( ! isset($this->userdata)) ? FALSE : $this->userdata; + return ( ! isset($this->userdata)) ? FALSE : $this->userdata; } // -------------------------------------------------------------------- @@ -484,9 +484,9 @@ class CI_Session { $this->sess_write(); } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ - /** + /** * Add or change flashdata, only available * until the next request * @@ -495,46 +495,46 @@ class CI_Session { * @param string * @return void */ - function set_flashdata($newdata = array(), $newval = '') - { - if (is_string($newdata)) - { - $newdata = array($newdata => $newval); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - $flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($flashdata_key, $val); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Keeps existing flashdata available to next request. + function set_flashdata($newdata = array(), $newval = '') + { + if (is_string($newdata)) + { + $newdata = array($newdata => $newval); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + $flashdata_key = $this->flashdata_key.':new:'.$key; + $this->set_userdata($flashdata_key, $val); + } + } + } + + // ------------------------------------------------------------------------ + + /** + * Keeps existing flashdata available to next request. * * @access public * @param string * @return void - */ - function keep_flashdata($key) - { + */ + function keep_flashdata($key) + { // 'old' flashdata gets removed. Here we mark all // flashdata as 'new' to preserve it from _flashdata_sweep() // Note the function will return FALSE if the $key // provided cannot be found - $old_flashdata_key = $this->flashdata_key.':old:'.$key; - $value = $this->userdata($old_flashdata_key); + $old_flashdata_key = $this->flashdata_key.':old:'.$key; + $value = $this->userdata($old_flashdata_key); - $new_flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($new_flashdata_key, $value); - } + $new_flashdata_key = $this->flashdata_key.':new:'.$key; + $this->set_userdata($new_flashdata_key, $value); + } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ /** * Fetch a specific flashdata item from the session array @@ -543,57 +543,57 @@ class CI_Session { * @param string * @return string */ - function flashdata($key) - { - $flashdata_key = $this->flashdata_key.':old:'.$key; - return $this->userdata($flashdata_key); - } + function flashdata($key) + { + $flashdata_key = $this->flashdata_key.':old:'.$key; + return $this->userdata($flashdata_key); + } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ - /** - * Identifies flashdata as 'old' for removal + /** + * Identifies flashdata as 'old' for removal * when _flashdata_sweep() runs. * * @access private * @return void - */ - function _flashdata_mark() - { + */ + function _flashdata_mark() + { $userdata = $this->all_userdata(); - foreach ($userdata as $name => $value) - { - $parts = explode(':new:', $name); - if (is_array($parts) && count($parts) === 2) - { - $new_name = $this->flashdata_key.':old:'.$parts[1]; - $this->set_userdata($new_name, $value); - $this->unset_userdata($name); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Removes all flashdata marked as 'old' + foreach ($userdata as $name => $value) + { + $parts = explode(':new:', $name); + if (is_array($parts) && count($parts) === 2) + { + $new_name = $this->flashdata_key.':old:'.$parts[1]; + $this->set_userdata($new_name, $value); + $this->unset_userdata($name); + } + } + } + + // ------------------------------------------------------------------------ + + /** + * Removes all flashdata marked as 'old' * * @access private * @return void - */ + */ - function _flashdata_sweep() - { + function _flashdata_sweep() + { $userdata = $this->all_userdata(); - foreach ($userdata as $key => $value) - { - if (strpos($key, ':old:')) - { - $this->unset_userdata($key); - } - } - - } + foreach ($userdata as $key => $value) + { + if (strpos($key, ':old:')) + { + $this->unset_userdata($key); + } + } + + } // -------------------------------------------------------------------- diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 25e143567..4a615352e 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -836,7 +836,7 @@ class CI_Upload { * Prep Filename * * Prevents possible script execution from Apache's handling of files multiple extensions - * http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext + * http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext * * @access private * @param string diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index cae1a3f5a..b42d0e06d 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -640,17 +640,17 @@ class CI_Validation { */ function is_natural_no_zero($str) { - if ( ! preg_match( '/^[0-9]+$/', $str)) - { - return FALSE; - } - - if ($str == 0) - { - return FALSE; - } - - return TRUE; + if ( ! preg_match( '/^[0-9]+$/', $str)) + { + return FALSE; + } + + if ($str == 0) + { + return FALSE; + } + + return TRUE; } // -------------------------------------------------------------------- diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 8958b572c..6ca9cfb50 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -34,8 +34,8 @@ class CI_Zip { var $zipdata = ''; var $directory = ''; - var $entries = 0; - var $file_num = 0; + var $entries = 0; + var $file_num = 0; var $offset = 0; function CI_Zip() @@ -320,16 +320,16 @@ class CI_Zip { */ function download($filename = 'backup.zip') { - if ( ! preg_match("|.+?\.zip$|", $filename)) - { - $filename .= '.zip'; - } + if ( ! preg_match("|.+?\.zip$|", $filename)) + { + $filename .= '.zip'; + } + + $zip_content =& $this->get_zip(); - $zip_content =& $this->get_zip(); + $CI =& get_instance(); + $CI->load->helper('download'); - $CI =& get_instance(); - $CI->load->helper('download'); - force_download($filename, $zip_content); } @@ -346,11 +346,11 @@ class CI_Zip { */ function clear_data() { - $this->zipdata = ''; - $this->directory = ''; - $this->entries = 0; - $this->file_num = 0; - $this->offset = 0; + $this->zipdata = ''; + $this->directory = ''; + $this->entries = 0; + $this->file_num = 0; + $this->offset = 0; } } -- cgit v1.2.3-24-g4f1b