Phil Sturgeon avatar Phil Sturgeon committed 6eab310 Merge

Comments (0)

Files changed (49)

application/config/mimes.php

 				'midi'	=>	'audio/midi',
 				'mpga'	=>	'audio/mpeg',
 				'mp2'	=>	'audio/mpeg',
-				'mp3'	=>	array('audio/mpeg', 'audio/mpg', 'audio/mpeg3'),
+				'mp3'	=>	array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
 				'aif'	=>	'audio/x-aiff',
 				'aiff'	=>	'audio/x-aiff',
 				'aifc'	=>	'audio/x-aiff',

application/controllers/migrate.php

+<?php
+class Migrate extends CI_Controller
+{
+	function __construct()
+	{
+		parent::__construct();
+		
+		$this->load->library('migration');
+
+		/** VERY IMPORTANT - only turn this on when you need it. */
+//		show_error('Access to this controller is blocked, turn me on when you need me.');
+	}
+
+	// Install up to the most up-to-date version.
+	function install()
+	{
+		if ( ! $this->migration->current())
+		{
+			show_error($this->migration->error);
+			exit;
+		}
+
+		echo "<br />Migration Successful<br />";
+	}
+
+	// This will migrate up to the configed migration version
+	function version($id = NULL)
+	{
+		// No $id supplied? Use the config version
+		$id OR $id = $this->config->item('migration_version');
+
+		if ( ! $this->migration->version($id))
+		{
+			show_error($this->migration->error);
+			exit;
+		}
+
+		echo "<br />Migration Successful<br />";
+	}
+}

application/migrations/001_Create_accounts.php

+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Create_accounts extends	CI_Migration {
+	
+	function up() 
+	{	
+		if ( ! $this->db->table_exists('accounts'))
+		{
+			// Setup Keys
+			$this->dbforge->add_key('id', TRUE);
+			
+			$this->dbforge->add_field(array(
+				'id' => array('type' => 'INT', 'constraint' => 5, 'unsigned' => TRUE, 'auto_increment' => TRUE),
+				'company_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE),
+				'first_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE),
+				'last_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE),
+				'phone' => array('type' => 'TEXT', 'null' => FALSE),
+				'email' => array('type' => 'TEXT', 'null' => FALSE),
+				'address' => array('type' => 'TEXT', 'null' => FALSE),
+				'Last_Update' => array('type' => 'DATETIME', 'null' => FALSE)
+			));
+			
+			$this->dbforge->add_field("Created_At TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
+			$this->dbforge->create_table('accounts', TRUE);
+		}
+	}
+
+	function down() 
+	{
+		$this->dbforge->drop_table('accounts');
+	}
+}
  *  Resolve the system path for increased reliability
  * ---------------------------------------------------------------
  */
+
+	// Set the current directory correctly for CLI requests
+	if (defined('STDIN'))
+	{
+		chdir(dirname(__FILE__));
+	}
+
 	if (realpath($system_path) !== FALSE)
 	{
 		$system_path = realpath($system_path).'/';

system/core/Config.php

 		// Set the base_url automatically if none was provided
 		if ($this->config['base_url'] == '')
 		{
-			if(isset($_SERVER['HTTP_HOST']))
+			if (isset($_SERVER['HTTP_HOST']))
 			{
 				$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
 				$base_url .= '://'. $_SERVER['HTTP_HOST'];
 		$file = ($file == '') ? 'config' : str_replace(EXT, '', $file);
 		$loaded = FALSE;
 
-		foreach($this->_config_paths as $path)
+		foreach ($this->_config_paths as $path)
 		{			
 			$file_path = $path.'config/'.ENVIRONMENT.'/'.$file.EXT;
 

system/core/Input.php

 		{
 			if (is_array($_GET) AND count($_GET) > 0)
 			{
-				foreach($_GET as $key => $val)
+				foreach ($_GET as $key => $val)
 				{
 					$_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
 				}
 		// Clean $_POST Data
 		if (is_array($_POST) AND count($_POST) > 0)
 		{
-			foreach($_POST as $key => $val)
+			foreach ($_POST as $key => $val)
 			{
 				$_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
 			}
 			unset($_COOKIE['$Path']);
 			unset($_COOKIE['$Domain']);
 
-			foreach($_COOKIE as $key => $val)
+			foreach ($_COOKIE as $key => $val)
 			{
 				$_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
 			}

system/core/Loader.php

 	{
 		if (is_array($library))
 		{
-			foreach($library as $read)
+			foreach ($library as $read)
 			{
 				$this->library($read);
 			}
 	{
 		if (is_array($model))
 		{
-			foreach($model as $babe)
+			foreach ($model as $babe)
 			{
 				$this->model($babe);
 			}

system/database/DB.php

 		{
 			parse_str($dns['query'], $extra);
 
-			foreach($extra as $key => $val)
+			foreach ($extra as $key => $val)
 			{
 				// booleans please
 				if (strtoupper($val) == "TRUE")

system/database/DB_active_rec.php

 			{
 				$clean = array();
 
-				foreach($row as $value)
+				foreach ($row as $value)
 				{
 					$clean[] = $this->escape($value);
 				}
 			$index_set = FALSE;
 			$clean = array();
 
-			foreach($v as $k2 => $v2)
+			foreach ($v as $k2 => $v2)
 			{
 				if ($k2 == $index)
 				{
 		}
 		elseif (is_array($table))
 		{
-			foreach($table as $single_table)
+			foreach ($table as $single_table)
 			{
 				$this->delete($single_table, $where, $limit, FALSE);
 			}

system/database/DB_driver.php

 
 		if ($query->num_rows() > 0)
 		{
-			foreach($query->result_array() as $row)
+			foreach ($query->result_array() as $row)
 			{
 				if (isset($row['TABLE_NAME']))
 				{
 		$query = $this->query($sql);
 
 		$retval = array();
-		foreach($query->result_array() as $row)
+		foreach ($query->result_array() as $row)
 		{
 			if (isset($row['COLUMN_NAME']))
 			{
 		$fields = array();
 		$values = array();
 
-		foreach($data as $key => $val)
+		foreach ($data as $key => $val)
 		{
 			$fields[] = $this->_escape_identifiers($key);
 			$values[] = $this->escape($val);
 		}
 
 		$fields = array();
-		foreach($data as $key => $val)
+		foreach ($data as $key => $val)
 		{
 			$fields[$this->_protect_identifiers($key)] = $this->escape($val);
 		}
 
 		$trace = debug_backtrace();
 
-		foreach($trace as $call)
+		foreach ($trace as $call)
 		{
 			if (isset($call['file']) && strpos($call['file'], BASEPATH.'database') === FALSE)
 			{
 		{
 			$escaped_array = array();
 
-			foreach($item as $k => $v)
+			foreach ($item as $k => $v)
 			{
 				$escaped_array[$this->_protect_identifiers($k)] = $this->_protect_identifiers($v);
 			}

system/database/DB_forge.php

 	{
 		if (is_array($key))
 		{
-			foreach($key as $one)
+			foreach ($key as $one)
 			{
 				$this->add_key($one, $primary);
 			}

system/database/DB_result.php

 		while ($row = $this->_fetch_object())
         {
             $object = new $class_name();
-            foreach($row as $key => $value)
+            foreach ($row as $key => $value)
             {
                 $object->$key = $value;
             }

system/database/drivers/mssql/mssql_driver.php

 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
+			foreach ($str as $key => $val)
 			{
 				$str[$key] = $this->escape_str($val, $like);
 			}
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$valstr[] = $key." = ".$val;
 		}

system/database/drivers/mysql/mysql_driver.php

 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
-			{
+			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))
 		{
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
-			$valstr[] = $key." = ".$val;
+			$valstr[] = $key . ' = ' . $val;
 		}
 
 		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
 		$ids = array();
 		$where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : '';
 
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$ids[] = $val[$index];
 
-			foreach(array_keys($val) as $field)
+			foreach (array_keys($val) as $field)
 			{
 				if ($field != $index)
 				{
 		$sql = "UPDATE ".$table." SET ";
 		$cases = '';
 
-		foreach($final as $k => $v)
+		foreach ($final as $k => $v)
 		{
 			$cases .= $k.' = CASE '."\n";
 			foreach ($v as $row)

system/database/drivers/mysqli/mysqli_driver.php

 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
+			foreach ($str as $key => $val)
 			{
 				$str[$key] = $this->escape_str($val, $like);
 			}
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$valstr[] = $key." = ".$val;
 		}
 		$ids = array();
 		$where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : '';
 
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$ids[] = $val[$index];
 
-			foreach(array_keys($val) as $field)
+			foreach (array_keys($val) as $field)
 			{
 				if ($field != $index)
 				{
 		$sql = "UPDATE ".$table." SET ";
 		$cases = '';
 
-		foreach($final as $k => $v)
+		foreach ($final as $k => $v)
 		{
 			$cases .= $k.' = CASE '."\n";
 			foreach ($v as $row)

system/database/drivers/oci8/oci8_driver.php

 		$sql = "begin $package.$procedure(";
 
 		$have_cursor = FALSE;
-		foreach($params as $param)
+		foreach ($params as $param)
 		{
 			$sql .= $param['name'] . ",";
 
 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
+			foreach ($str as $key => $val)
 			{
 				$str[$key] = $this->escape_str($val, $like);
 			}
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$valstr[] = $key." = ".$val;
 		}

system/database/drivers/odbc/odbc_driver.php

 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
+			foreach ($str as $key => $val)
 			{
 				$str[$key] = $this->escape_str($val, $like);
 			}
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$valstr[] = $key." = ".$val;
 		}

system/database/drivers/odbc/odbc_result.php

 	 */
 	function _odbc_fetch_object(& $odbc_result) {
 		$rs = array();
-		$rs_obj = false;
+		$rs_obj = FALSE;
 		if (odbc_fetch_into($odbc_result, $rs)) {
 			foreach ($rs as $k=>$v) {
 				$field_name= odbc_field_name($odbc_result, $k+1);
 	 */
 	function _odbc_fetch_array(& $odbc_result) {
 		$rs = array();
-		$rs_assoc = false;
+		$rs_assoc = FALSE;
 		if (odbc_fetch_into($odbc_result, $rs)) {
 			$rs_assoc=array();
 			foreach ($rs as $k=>$v) {

system/database/drivers/postgre/postgre_driver.php

 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
+			foreach ($str as $key => $val)
 			{
 				$str[$key] = $this->escape_str($val, $like);
 			}
 		$v = $this->_version();
 		$v = $v['server'];
 
-		$table	= func_num_args() > 0 ? func_get_arg(0) : null;
-		$column	= func_num_args() > 1 ? func_get_arg(1) : null;
+		$table	= func_num_args() > 0 ? func_get_arg(0) : NULL;
+		$column	= func_num_args() > 1 ? func_get_arg(1) : NULL;
 
-		if ($table == null && $v >= '8.1')
+		if ($table == NULL && $v >= '8.1')
 		{
 			$sql='SELECT LASTVAL() as ins_id';
 		}
-		elseif ($table != null && $column != null && $v >= '8.0')
+		elseif ($table != NULL && $column != NULL && $v >= '8.0')
 		{
 			$sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column);
 			$query = $this->query($sql);
 			$row = $query->row();
 			$sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq);
 		}
-		elseif ($table != null)
+		elseif ($table != NULL)
 		{
 			// seq_name passed in table parameter
 			$sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table);
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$valstr[] = $key." = ".$val;
 		}

system/database/drivers/sqlite/sqlite_driver.php

 	{
 		if (is_array($str))
 		{
-			foreach($str as $key => $val)
+			foreach ($str as $key => $val)
 			{
 				$str[$key] = $this->escape_str($val, $like);
 			}
 	 */
 	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
 	{
-		foreach($values as $key => $val)
+		foreach ($values as $key => $val)
 		{
 			$valstr[] = $key." = ".$val;
 		}

system/helpers/captcha_helper.php

 
 		$current_dir = @opendir($img_path);
 
-		while($filename = @readdir($current_dir))
+		while ($filename = @readdir($current_dir))
 		{
 			if ($filename != "." and $filename != ".." and $filename != "index.html")
 			{

system/helpers/file_helper.php

 			return FALSE;
 		}
 
-		while(FALSE !== ($filename = @readdir($current_dir)))
+		while (FALSE !== ($filename = @readdir($current_dir)))
 		{
 			if ($filename != "." and $filename != "..")
 			{

system/helpers/language_helper.php

-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *

system/helpers/number_helper.php

-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *

system/helpers/smiley_helper.php

 
 				if (is_array($alias))
 				{
-					foreach($alias as $name => $id)
+					foreach ($alias as $name => $id)
 					{
 						$m[] = '"'.$name.'" : "'.$id.'"';
 					}
 		{
 			if (is_array($alias))
 			{
-				foreach($alias as $name => $id)
+				foreach ($alias as $name => $id)
 				{
 					$r .= 'smiley_map["'.$name.'"] = "'.$id.'";'."\n";
 				}

system/helpers/text_helper.php

 			}
 
 			$temp = '';
-			while((strlen($line)) > $charlim)
+			while ((strlen($line)) > $charlim)
 			{
 				// If the over-length word is a URL we won't wrap it
 				if (preg_match("!\[url.+\]|://|wwww.!", $line))

system/libraries/Cache/drivers/Cache_file.php

 		
 		$path = $CI->config->item('cache_path');
 	
-		$this->_cache_path = ($path == '') ? BASEPATH.'cache/' : $path;
+		$this->_cache_path = ($path == '') ? APPPATH.'cache/' : $path;
 	}
 
 	// ------------------------------------------------------------------------

system/libraries/Driver.php

-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *
 	// subsequents calls will go straight to the proper child.
 	function __get($child)
 	{
-		if (! isset($this->lib_name))
+		if ( ! isset($this->lib_name))
 		{
 			$this->lib_name = get_class($this);
 		}
 				}
 			}
 
-			foreach($r->getProperties() as $prop)
+			foreach ($r->getProperties() as $prop)
 			{
 				if ($prop->isPublic())
 				{

system/libraries/Email.php

 			}
 
 			$temp = '';
-			while((strlen($line)) > $charlim)
+			while ((strlen($line)) > $charlim)
 			{
 				// If the over-length word is a URL we won't wrap it
 				if (preg_match("!\[url.+\]|://|wwww.!", $line))
 		reset($this->_headers);
 		$this->_header_str = "";
 
-		foreach($this->_headers as $key => $val)
+		foreach ($this->_headers as $key => $val)
 		{
 			$val = trim($val);
 
 
 		$this->_send_command('from', $this->clean_email($this->_headers['From']));
 
-		foreach($this->_recipients as $val)
+		foreach ($this->_recipients as $val)
 		{
 			$this->_send_command('to', $val);
 		}
 
 		if (count($this->_cc_array) > 0)
 		{
-			foreach($this->_cc_array as $val)
+			foreach ($this->_cc_array as $val)
 			{
 				if ($val != "")
 				{
 
 		if (count($this->_bcc_array) > 0)
 		{
-			foreach($this->_bcc_array as $val)
+			foreach ($this->_bcc_array as $val)
 			{
 				if ($val != "")
 				{
 										$errstr,
 										$this->smtp_timeout);
 
-		if( ! is_resource($this->_smtp_connect))
+		if ( ! is_resource($this->_smtp_connect))
 		{
 			$this->_set_error_message('email_smtp_error', $errno." ".$errstr);
 			return FALSE;

system/libraries/Form_validation.php

 
 		// Build our master array
 		$this->_field_data[$field] = array(
-											'field'				=> $field,
-											'label'				=> $label,
-											'rules'				=> $rules,
-											'is_array'			=> $is_array,
-											'keys'				=> $indexes,
-											'postdata'			=> NULL,
-											'error'				=> ''
-											);
+			'field'				=> $field,
+			'label'				=> $label,
+			'rules'				=> $rules,
+			'is_array'			=> $is_array,
+			'keys'				=> $indexes,
+			'postdata'			=> NULL,
+			'error'				=> ''
+		);
 
 		return $this;
 	}
 			return $this->valid_email(trim($str));
 		}
 
-		foreach(explode(',', $str) as $email)
+		foreach (explode(',', $str) as $email)
 		{
 			if (trim($email) != '' && $this->valid_email(trim($email)) === FALSE)
 			{
 	 */
 	function integer($str)
 	{
-		return (bool)preg_match( '/^[\-+]?[0-9]+$/', $str);
+		return (bool) preg_match('/^[\-+]?[0-9]+$/', $str);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Decimal number
+	 *
+	 * @access	public
+	 * @param	string
+	 * @return	bool
+	 */
+	function decimal($str)
+	{
+		return (bool) preg_match('/^[\-+]?[0-9]+\.[0-9]+$/', $str);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Greather than
+	 *
+	 * @access	public
+	 * @param	string
+	 * @return	bool
+	 */
+	function greater_than($str, $min)
+	{
+		if ( ! is_numeric($str))
+		{
+			return FALSE;
+		}
+		return $str > $min;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Less than
+	 *
+	 * @access	public
+	 * @param	string
+	 * @return	bool
+	 */
+	function less_than($str, $max)
+	{
+		if ( ! is_numeric($str))
+		{
+			return FALSE;
+		}
+		return $str < $max;
 	}
 
 	// --------------------------------------------------------------------
 	 */
 	function is_natural($str)
 	{
-		return (bool)preg_match( '/^[0-9]+$/', $str);
+		return (bool) preg_match( '/^[0-9]+$/', $str);
 	}
 
 	// --------------------------------------------------------------------

system/libraries/Image_lib.php

 
 		@chmod($this->full_dst_path, FILE_WRITE_MODE);
 
-		return true;
+		return TRUE;
 	}
 
 	// --------------------------------------------------------------------

system/libraries/Profiler.php

 
 		$output .= "\n\n<table style='width:100%'>\n";
 
-		foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header)
+		foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header)
 		{
 			$val = (isset($_SERVER[$header])) ? $_SERVER[$header] : '';
 			$output .= "<tr><td style='vertical-align: top;width:50%;padding:5px;color:#900;background-color:#ddd;'>".$header."&nbsp;&nbsp;</td><td style='width:50%;padding:5px;color:#000;background-color:#ddd;'>".$val."</td></tr>\n";
 
 		$output .= "\n\n<table style='width:100%'>\n";
 
-		foreach($this->CI->config->config as $config=>$val)
+		foreach ($this->CI->config->config as $config=>$val)
 		{
 			if (is_array($val))
 			{

system/libraries/Security.php

 				$str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str);
 			}
 		}
-		while($original != $str);
+		while ($original != $str);
 
 		unset($original);
 

system/libraries/Sha1.php

 			$oldd = $d;
 			$olde = $e;
 
-			for($j = 0; $j < 80; $j++)
+			for ($j = 0; $j < 80; $j++)
 			{
 				if ($j < 16)
 				{

system/libraries/Table.php

 		}
 
 		$new = array();
-		while(count($array) > 0)
+		while (count($array) > 0)
 		{
 			$temp = array_splice($array, 0, $col_limit);
 
 			$out .= $this->template['heading_row_start'];
 			$out .= $this->newline;
 
-			foreach($this->heading as $heading)
+			foreach ($this->heading as $heading)
 			{
 				$temp = $this->template['heading_cell_start'];
 
 			$out .= $this->newline;
 
 			$i = 1;
-			foreach($this->rows as $row)
+			foreach ($this->rows as $row)
 			{
 				if ( ! is_array($row))
 				{
 				$out .= $this->template['row_'.$name.'start'];
 				$out .= $this->newline;
 
-				foreach($row as $cell)
+				foreach ($row as $cell)
 				{
 					$temp = $this->template['cell_'.$name.'start'];
 

system/libraries/Trackback.php

 				{
 					$$item = $this->convert_ascii($$item);
 				}
-				elseif($item == 'blog_name')
+				elseif ($item == 'blog_name')
 				{
 					$$item = $this->convert_ascii($$item);
 				}
 		// Was it successful?
 		$this->response = "";
 
-		while( ! feof($fp))
+		while ( ! feof($fp))
 		{
 			$this->response .= fgets($fp, 128);
 		}

system/libraries/Upload.php

 			$this->file_name = $this->_prep_filename($this->_file_name_override);
 
 			// If no extension was provided in the file_name config item, use the uploaded one
-			if(strpos($this->_file_name_override, '.') === FALSE)
+			if (strpos($this->_file_name_override, '.') === FALSE)
 			{
 				$this->file_name .= $this->file_ext;
 			}

system/libraries/Xmlrpc.php

 
 		$this->data = array();
 
-		foreach($incoming as $key => $value)
+		foreach ($incoming as $key => $value)
 		{
 			$this->data[$key] = $this->values_parsing($value);
 		}
 	{
 		if (is_array($value) && array_key_exists(0, $value))
 		{
-			if ( ! isset($value['1']) OR (! isset($this->xmlrpcTypes[$value['1']])))
+			if ( ! isset($value['1']) OR ( ! isset($this->xmlrpcTypes[$value['1']])))
 			{
 				if (is_array($value[0]))
 				{
 					$temp = new XML_RPC_Values($value['0'], 'string');
 				}
 			}
-			elseif(is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array'))
+			elseif (is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array'))
 			{
 				while (list($k) = each($value['0']))
 				{
 			$this->error = $this->result->errstr;
 			return FALSE;
 		}
-		elseif( ! is_object($this->result->val))
+		elseif ( ! is_object($this->result->val))
 		{
 			$this->error = $this->result->errstr;
 			return FALSE;
 	var $errno			= '';
 	var $errstring		= '';
 	var $timeout		= 5;
-	var $no_multicall	= false;
+	var $no_multicall	= FALSE;
 
 	public function __construct($path, $server, $port=80)
 	{
 			return $r;
 		}
 
-		if(empty($msg->payload))
+		if (empty($msg->payload))
 		{
 			// $msg = XML_RPC_Messages
 			$msg->createPayload();
 	{
 		$kind = $xmlrpc_val->kindOf();
 
-		if($kind == 'scalar')
+		if ($kind == 'scalar')
 		{
 			return $xmlrpc_val->scalarval();
 		}
-		elseif($kind == 'array')
+		elseif ($kind == 'array')
 		{
 			reset($xmlrpc_val->me);
 			list($a,$b) = each($xmlrpc_val->me);
 
 			$arr = array();
 
-			for($i = 0; $i < $size; $i++)
+			for ($i = 0; $i < $size; $i++)
 			{
 				$arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]);
 			}
 			return $arr;
 		}
-		elseif($kind == 'struct')
+		elseif ($kind == 'struct')
 		{
 			reset($xmlrpc_val->me['struct']);
 			$arr = array();
 
-			while(list($key,$value) = each($xmlrpc_val->me['struct']))
+			while (list($key,$value) = each($xmlrpc_val->me['struct']))
 			{
 				$arr[$key] = $this->xmlrpc_decoder($value);
 			}
 		$t = 0;
 		if (preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/', $time, $regs))
 		{
-			if ($utc == 1)
-				$t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);
-			else
-				$t = mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);
+			$fnc = ($utc == 1) ? 'gmmktime' : 'mktime';
+			$t = $fnc($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);
 		}
 		return $t;
 	}
 		$this->method_name = $method;
 		if (is_array($pars) && count($pars) > 0)
 		{
-			for($i=0; $i<count($pars); $i++)
+			for ($i=0; $i<count($pars); $i++)
 			{
 				// $pars[$i] = XML_RPC_Values
 				$this->params[] = $pars[$i];
 		$this->payload .= '<methodName>' . $this->method_name . "</methodName>\r\n";
 		$this->payload .= "<params>\r\n";
 
-		for($i=0; $i<count($this->params); $i++)
+		for ($i=0; $i<count($this->params); $i++)
 		{
 			// $p = XML_RPC_Values
 			$p = $this->params[$i];
 	{
 		$data = '';
 
-		while($datum = fread($fp, 4096))
+		while ($datum = fread($fp, 4096))
 		{
 			$data .= $datum;
 		}
 		//  Check for data
 		//-------------------------------------
 
-		if($data == "")
+		if ($data == "")
 		{
 			error_log($this->xmlrpcstr['no_data']);
 			$r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']);
 				$this->xh[$the_parser]['isf'] = 1;
 			break;
 			case 'PARAM':
-				$this->xh[$the_parser]['value'] = null;
+				$this->xh[$the_parser]['value'] = NULL;
 			break;
 			case 'VALUE':
 				$this->xh[$the_parser]['vt'] = 'value';
 				$this->xh[$the_parser]['valuestack'][0]['name'] = '';
 
 				// Set NULL value to check to see if value passed for this param/member
-				$this->xh[$the_parser]['value'] = null;
+				$this->xh[$the_parser]['value'] = NULL;
 			break;
 			case 'DATA':
 			case 'METHODCALL':
 				$this->xh[$the_parser]['lv'] = 2; // Found a value
 			}
 
-			if( ! @isset($this->xh[$the_parser]['ac']))
+			if ( ! @isset($this->xh[$the_parser]['ac']))
 			{
 				$this->xh[$the_parser]['ac'] = '';
 			}
 	{
 		$kind = $param->kindOf();
 
-		if($kind == 'scalar')
+		if ($kind == 'scalar')
 		{
 			return $param->scalarval();
 		}
-		elseif($kind == 'array')
+		elseif ($kind == 'array')
 		{
 			reset($param->me);
 			list($a,$b) = each($param->me);
 
 			return $arr;
 		}
-		elseif($kind == 'struct')
+		elseif ($kind == 'struct')
 		{
 			reset($param->me['struct']);
 
 			$arr = array();
 
-			while(list($key,$value) = each($param->me['struct']))
+			while (list($key,$value) = each($param->me['struct']))
 			{
 				$arr[$key] = $this->decode_message($value);
 			}
 				// struct
 				$rs .= "<struct>\n";
 				reset($val);
-				while(list($key2, $val2) = each($val))
+				while (list($key2, $val2) = each($val))
 				{
 					$rs .= "<member>\n<name>{$key2}</name>\n";
 					$rs .= $this->serializeval($val2);

system/libraries/Xmlrpcs.php

 		log_message('debug', "XML-RPC Server Class Initialized");
 	}
 
-	//-------------------------------------
-	//  Initialize Prefs and Serve
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
+	/**
+	 * Initialize Prefs and Serve
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	void
+	 */
 	function initialize($config=array())
 	{
 		if (isset($config['functions']) && is_array($config['functions']))
 		}
 	}
 
-	//-------------------------------------
-	//  Setting of System Methods
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
-	function set_system_methods ()
+	/**
+	 * Setting of System Methods
+	 *
+	 * @access	public
+	 * @return	void
+	 */
+	function set_system_methods()
 	{
 		$this->methods = array(
 					'system.listMethods'	 => array(
 					);
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Main Server Function
-	//-------------------------------------
-
+	/**
+	 * Main Server Function
+	 *
+	 * @access	public
+	 * @return	void
+	 */
 	function serve()
 	{
 		$r = $this->parseRequest();
 		exit($payload);
 	}
 
-	//-------------------------------------
-	//  Add Method to Class
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
-	function add_to_map($methodname,$function,$sig,$doc)
+	/**
+	 * Add Method to Class
+	 *
+	 * @access	public
+	 * @param	string	method name
+	 * @param	string	function
+	 * @param	string	signature
+	 * @param	string	docstring
+	 * @return	void
+	 */
+	function add_to_map($methodname, $function, $sig, $doc)
 	{
 		$this->methods[$methodname] = array(
 			'function'  => $function,
 		);
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Parse Server Request
-	//-------------------------------------
-
+	/**
+	 * Parse Server Request
+	 *
+	 * @access	public
+	 * @param	string	data
+	 * @return	object	xmlrpc response
+	 */
 	function parseRequest($data='')
 	{
 		global $HTTP_RAW_POST_DATA;
 				xml_get_current_line_number($parser)));
 			xml_parser_free($parser);
 		}
-		elseif($parser_object->xh[$parser]['isf'])
+		elseif ($parser_object->xh[$parser]['isf'])
 		{
 			return new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']);
 		}
 			$m = new XML_RPC_Message($parser_object->xh[$parser]['method']);
 			$plist='';
 
-			for($i=0; $i < count($parser_object->xh[$parser]['params']); $i++)
+			for ($i=0; $i < count($parser_object->xh[$parser]['params']); $i++)
 			{
 				if ($this->debug === TRUE)
 				{
 		return $r;
 	}
 
-	//-------------------------------------
-	//  Executes the Method
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
+	/**
+	 * Executes the Method
+	 *
+	 * @access	protected
+	 * @param	object
+	 * @return	mixed
+	 */
 	function _execute($m)
 	{
 		$methName = $m->method_name;
 		if (isset($this->methods[$methName]['signature']))
 		{
 			$sig = $this->methods[$methName]['signature'];
-			for($i=0; $i<count($sig); $i++)
+			for ($i=0; $i<count($sig); $i++)
 			{
 				$current_sig = $sig[$i];
 
 				if (count($current_sig) == count($m->params)+1)
 				{
-					for($n=0; $n < count($m->params); $n++)
+					for ($n=0; $n < count($m->params); $n++)
 					{
 						$p = $m->params[$n];
 						$pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf();
 			return call_user_func($this->methods[$methName]['function'], $m);
 		}
 	}
+	
+	// --------------------------------------------------------------------
 
-
-	//-------------------------------------
-	//  Server Function:  List Methods
-	//-------------------------------------
-
+	/**
+	 * Server Function:  List Methods
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function listMethods($m)
 	{
 		$v = new XML_RPC_Values();
 		$output = array();
 
-		foreach($this->methods as $key => $value)
+		foreach ($this->methods as $key => $value)
 		{
 			$output[] = new XML_RPC_Values($key, 'string');
 		}
 
-		foreach($this->system_methods as $key => $value)
+		foreach ($this->system_methods as $key => $value)
 		{
 			$output[]= new XML_RPC_Values($key, 'string');
 		}
 		$v->addArray($output);
 		return new XML_RPC_Response($v);
 	}
+	
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Server Function:  Return Signature for Method
-	//-------------------------------------
-
+	/**
+	 * Server Function:  Return Signature for Method
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function methodSignature($m)
 	{
 		$parameters = $m->output_parameters();
 				$sigs = array();
 				$signature = $this->methods[$method_name]['signature'];
 
-				for($i=0; $i < count($signature); $i++)
+				for ($i=0; $i < count($signature); $i++)
 				{
 					$cursig = array();
 					$inSig = $signature[$i];
-					for($j=0; $j<count($inSig); $j++)
+					for ($j=0; $j<count($inSig); $j++)
 					{
 						$cursig[]= new XML_RPC_Values($inSig[$j], 'string');
 					}
 		return $r;
 	}
 
-	//-------------------------------------
-	//  Server Function:  Doc String for Method
-	//-------------------------------------
+	// --------------------------------------------------------------------
 
+	/**
+	 * Server Function:  Doc String for Method
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function methodHelp($m)
 	{
 		$parameters = $m->output_parameters();
 			return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
 		}
 	}
+	
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Server Function:  Multi-call
-	//-------------------------------------
-
+	/**
+	 * Server Function:  Multi-call
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function multicall($m)
 	{
 		// Disabled
 			$m = new XML_RPC_Message($value[0]);
 			$plist='';
 
-			for($i=0; $i < count($value[1]); $i++)
+			for ($i=0; $i < count($value[1]); $i++)
 			{
 				$m->addParam(new XML_RPC_Values($value[1][$i], 'string'));
 			}
 		return new XML_RPC_Response(new XML_RPC_Values($result, 'array'));
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Multi-call Function:  Error Handling
-	//-------------------------------------
-
+	/**
+	 *  Multi-call Function:  Error Handling
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function multicall_error($err)
 	{
 		$str  = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
 		return new XML_RPC_Values($struct, 'struct');
 	}
 
+	// --------------------------------------------------------------------
 
-	//-------------------------------------
-	//  Multi-call Function:  Processes method
-	//-------------------------------------
-
+	/**
+	 *  Multi-call Function:  Processes method
+	 *
+	 * @access	public
+	 * @param	mixed
+	 * @return	object
+	 */
 	function do_multicall($call)
 	{
 		if ($call->kindOf() != 'struct')
+		{
 			return $this->multicall_error('notstruct');
+		}
 		elseif ( ! $methName = $call->me['struct']['methodName'])
+		{
 			return $this->multicall_error('nomethod');
+		}
 
 		list($scalar_type,$scalar_value)=each($methName->me);
 		$scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type;
 
 		if ($methName->kindOf() != 'scalar' OR $scalar_type != 'string')
+		{
 			return $this->multicall_error('notstring');
+		}
 		elseif ($scalar_value == 'system.multicall')
+		{
 			return $this->multicall_error('recursion');
+		}
 		elseif ( ! $params = $call->me['struct']['params'])
+		{
 			return $this->multicall_error('noparams');
+		}
 		elseif ($params->kindOf() != 'array')
+		{
 			return $this->multicall_error('notarray');
+		}
 
 		list($a,$b)=each($params->me);
 		$numParams = count($b);

system/libraries/Zip.php

 
 		while (FALSE !== ($file = readdir($fp)))
 		{
-			if(substr($file, 0, 1) == '.')
+			if (substr($file, 0, 1) == '.')
 			{
 				continue;
 			}

user_guide/changelog.html

 
 <p>The <img src="images/reactor-bullet.png" width="16" height="16" alt="Reactor Marker" /> indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.</p>
 
+<h2>Version 2.0.1</h2>
+<p>Release Date: n/a<br />
+Hg Tag: n/a</p>
+
+<ul>
+	<li>Libraries
+		<ul>
+			<li class="reactor">Added <kbd>decimal</kbd>, <kbd>less_than</kbd> and <kbd>greater_than</kbd> rules to the <a href="libraries/parser.html">Form validation Class</a>.</li>
+		</ul>
+	</li>
+</ul>
+
+<h3>Bug fixes for 2.0.1</h3>
+<ul>
+	<li class="reactor">CLI requests can now be run from any folder, not just when CD'ed next to index.php.</li>
+	<li class="reactor">Fixed issue #41: Added audio/mp3 mime type to mp3.</li>
+	<li class="reactor">Fixed a bug (#329) where the file caching driver referenced the incorrect cache directory.</li>
+</ul>
+
 <h2>Version 2.0.0</h2>
 <p>Release Date: January 28, 2011<br />
 Hg Tag: v2.0.0</p>

user_guide/database/utilities.html

 <code>
 $dbs = $this->dbutil->list_databases();<br />
 <br />
-foreach($dbs as $db)<br />
+foreach ($dbs as $db)<br />
 {<br />
 &nbsp;&nbsp;&nbsp; echo $db;<br />
 }</code>

user_guide/general/alternative_php.html

 <code>
 &lt;ul><br />
 <br />
-<var>&lt;?php foreach($todo as $item): ?></var><br />
+<var>&lt;?php foreach ($todo as $item): ?></var><br />
 <br />
 &lt;li><var>&lt;?=$item?></var>&lt;/li><br />
 <br />

user_guide/general/views.html

 &lt;h3>My Todo List&lt;/h3>
 
 &lt;ul>
-&lt;?php foreach($todo_list as $item):?>
+&lt;?php foreach ($todo_list as $item):?>
 
 &lt;li>&lt;?php echo $item;?>&lt;/li>
 

user_guide/installation/downloads.html

 <h1>Downloading CodeIgniter</h1>
 
 <ul>
-<li><a href="http://codeigniter.com/download.php">CodeIgniter V 1.7.2 (Current version)</a></li>
+<li><a href="http://codeigniter.com/downloads/">CodeIgniter V 2.0.0 (Current version)</a></li>
+<li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.3.zip">CodeIgniter V 1.7.3</a></li>
+<li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.2.zip">CodeIgniter V 1.7.2</a></li>
 <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.1.zip">CodeIgniter V 1.7.1</a></li>
 <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.0.zip">CodeIgniter V 1.7.0</a></li>
 <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.6.3.zip">CodeIgniter V 1.6.3</a></li>
 <h1 id="hg">Mercurial Server</h1>
 <p><a href="http://mercurial.selenic.com">Mercurial</a> is a distributed version control system.</p>
 
-							<p>Public Hg access is available at <a href="http://bitbucket.org/ellislab/codeigniter/">BitBucket</a>.
+							<p>Public Hg access is available at <a href="http://bitbucket.org/ellislab/codeigniter-reactor/">BitBucket</a>.
 								Please note that while every effort is made to keep this code base functional, we cannot guarantee the functionality of code taken
 								from the tip.</p>
 

user_guide/libraries/cart.html

 
 &lt;?php $i = 1; ?>
 
-&lt;?php foreach($this->cart->contents() as $items): ?>
+&lt;?php foreach ($this->cart->contents() as $items): ?>
 
 	&lt;?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>
 

user_guide/libraries/file_uploading.html

 &lt;h3>Your file was successfully uploaded!&lt;/h3>
 
 &lt;ul>
-&lt;?php foreach($upload_data as $item => $value):?>
+&lt;?php foreach ($upload_data as $item => $value):?>
 &lt;li>&lt;?php echo $item;?>: &lt;?php echo $value;?>&lt;/li>
 &lt;?php endforeach; ?>
 &lt;/ul>

user_guide/libraries/form_validation.html

 <p>The following is a list of all the native rules that are available to use:</p>
 
 
+<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
+	<tr>
+		<th>Rule</th>
+		<th>Parameter</th>
+		<th>Description</th>
+		<th>Example</th>
+	</tr>
 
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Rule</th>
-<th>Parameter</th>
-<th>Description</th>
-<th>Example</th>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>required</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element is empty.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<td class="td"><strong>required</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element is empty.</td>
-<td class="td">&nbsp;</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>matches</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element does not match the one in the parameter.</td>
+		<td class="td">matches[form_item]</td>
+	</tr>
 
-<td class="td"><strong>matches</strong></td>
-<td class="td">Yes</td>
-<td class="td">Returns FALSE if the form element does not match the one in the parameter.</td>
-<td class="td">matches[form_item]</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>min_length</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element is shorter then the parameter value.</td>
+		<td class="td">min_length[6]</td>
+	</tr>
 
-<td class="td"><strong>min_length</strong></td>
-<td class="td">Yes</td>
-<td class="td">Returns FALSE if the form element is shorter then the parameter value.</td>
-<td class="td">min_length[6]</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>max_length</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element is longer then the parameter value.</td>
+		<td class="td">max_length[12]</td>
+	</tr>
 
-<td class="td"><strong>max_length</strong></td>
-<td class="td">Yes</td>
-<td class="td">Returns FALSE if the form element is longer then the parameter value.</td>
-<td class="td">max_length[12]</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>exact_length</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element is not exactly the parameter value.</td>
+		<td class="td">exact_length[8]</td>
+	</tr>
 
-<td class="td"><strong>exact_length</strong></td>
-<td class="td">Yes</td>
-<td class="td">Returns FALSE if the form element is not exactly the parameter value.</td>
-<td class="td">exact_length[8]</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>greater_than</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element is less than the parameter value or not numeric.</td>
+		<td class="td">greater_than[8]</td>
+	</tr>
 
-<td class="td"><strong>alpha</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than alphabetical characters.</td>
-<td class="td">&nbsp;</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>less_than</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element is greater than the parameter value or not numeric.</td>
+		<td class="td">less_than[8]</td>
+	</tr>
 
-<td class="td"><strong>alpha_numeric</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters.</td>
-<td class="td">&nbsp;</td>
-</tr><tr>
+	<tr>
+		<td class="td"><strong>alpha</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than alphabetical characters.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<td class="td"><strong>alpha_dash</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>alpha_numeric</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>numeric</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>alpha_dash</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>integer</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than an integer.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>numeric</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>is_natural</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>integer</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than an integer.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>is_natural_no_zero</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>decimal</strong></td>
+		<td class="td">Yes</td>
+		<td class="td">Returns FALSE if the form element is not exactly the parameter value.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>valid_email</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element does not contain a valid email address.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>is_natural</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>valid_emails</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>is_natural_no_zero</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>valid_ip</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the supplied IP is not valid.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>valid_email</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the form element does not contain a valid email address.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
-<tr>
-<td class="td"><strong>valid_base64</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td>
-<td class="td">&nbsp;</td>
-</tr>
+	<tr>
+		<td class="td"><strong>valid_emails</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
+
+	<tr>
+		<td class="td"><strong>valid_ip</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the supplied IP is not valid.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
+
+	<tr>
+		<td class="td"><strong>valid_base64</strong></td>
+		<td class="td">No</td>
+		<td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td>
+		<td class="td">&nbsp;</td>
+	</tr>
 
 
 </table>
 
 
 <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Name</th>
-<th>Parameter</th>
-<th>Description</th>
-</tr><tr>
+	<tr>
+		<th>Name</th>
+		<th>Parameter</th>
+		<th>Description</th>
+	</tr><tr>
 
-<td class="td"><strong>xss_clean</strong></td>
-<td class="td">No</td>
-<td class="td">Runs the data through the XSS filtering function, described in the <a href="input.html">Input Class</a> page.</td>
-</tr><tr>
+		<td class="td"><strong>xss_clean</strong></td>
+		<td class="td">No</td>
+		<td class="td">Runs the data through the XSS filtering function, described in the <a href="input.html">Input Class</a> page.</td>
+	</tr><tr>
 
-<td class="td"><strong>prep_for_form</strong></td>
-<td class="td">No</td>
-<td class="td">Converts special characters so that HTML data can be shown in a form field without breaking it.</td>
-</tr><tr>
+		<td class="td"><strong>prep_for_form</strong></td>
+		<td class="td">No</td>
+		<td class="td">Converts special characters so that HTML data can be shown in a form field without breaking it.</td>
+	</tr><tr>
 
-<td class="td"><strong>prep_url</strong></td>
-<td class="td">No</td>
-<td class="td">Adds "http://" to URLs if missing.</td>
-</tr><tr>
+		<td class="td"><strong>prep_url</strong></td>
+		<td class="td">No</td>
+		<td class="td">Adds "http://" to URLs if missing.</td>
+	</tr><tr>
 
-<td class="td"><strong>strip_image_tags</strong></td>
-<td class="td">No</td>
-<td class="td">Strips the HTML from image tags leaving the raw URL.</td>
-</tr><tr>
+		<td class="td"><strong>strip_image_tags</strong></td>
+		<td class="td">No</td>
+		<td class="td">Strips the HTML from image tags leaving the raw URL.</td>
+	</tr><tr>
 
-<td class="td"><strong>encode_php_tags</strong></td>
-<td class="td">No</td>
-<td class="td">Converts PHP tags to entities.</td>
-</tr>
+		<td class="td"><strong>encode_php_tags</strong></td>
+		<td class="td">No</td>
+		<td class="td">Converts PHP tags to entities.</td>
+	</tr>
 
 </table>
 

user_guide/toc.html

 	<li><a href="./doc_style/index.html">Writing Documentation</a></li>
 </ul>
 
+<h3>Additional Resources</h3>
+
+<ul>
+<li><a href="http://codeigniter.com/forums/">Community Forums</a></li>
+<li><a href="http://codeigniter.com/wiki/">Community Wiki</a></li>
+</ul>
+
 </td>
 <td valign="top" width="25%">
 
 <li><a href="./libraries/calendar.html">Calendar Class</a></li>
 <li><a href="./libraries/cart.html">Cart Class</a></li>
 <li><a href="./libraries/config.html">Config Class</a></li>
-<li><a href="./database/index.html">Database Class</a></li>
 <li><a href="./libraries/email.html">Email Class</a></li>
 <li><a href="./libraries/encryption.html">Encryption Class</a></li>
 <li><a href="./libraries/file_uploading.html">File Uploading Class</a></li>
 </td>
 <td valign="top" width="25%">
 
+<h3>Driver Reference</h3>
+<ul>
+<li><a href="./libraries/caching.html">Caching Class</a></li>
+<li><a href="./database/index.html">Database Class</a></li>
+<li><a href="./libraries/javascript.html">Javascript Class</a></li>
+</ul>
+
 <h3>Helper Reference</h3>
 <ul>
 <li><a href="./helpers/array_helper.html">Array Helper</a></li>
 <li><a href="./helpers/xml_helper.html">XML Helper</a></li>
 </ul>
 
-<h3>Additional Resources</h3>
 
-<ul>
-<li><a href="http://codeigniter.com/forums/">Community Forums</a></li>
-<li><a href="http://codeigniter.com/wiki/">Community Wiki</a></li>
-</ul>
 
 
 </td>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.