summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-08-21 14:43:31 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-08-21 14:43:31 +0200
commit993925b47a0bfb08e79961c47bcc3d247a03a5dd (patch)
tree4012e1f02407efb333a20c67e5d7d1cac8249b9f /system/libraries
parent719b65d54a85337c5616a781eff07d5031c106e9 (diff)
whitespace fixes
a minor re-ordering of the changelog
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Controller.php12
-rw-r--r--system/libraries/Email.php6
-rw-r--r--system/libraries/Session.php158
-rw-r--r--system/libraries/Upload.php2
-rw-r--r--system/libraries/Validation.php22
-rw-r--r--system/libraries/Zip.php30
6 files changed, 115 insertions, 115 deletions
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;
}
}