diff --git a/index.php b/index.php
index 267a898..7d464dd 100644
--- a/index.php
+++ b/index.php
@@ -53,7 +53,7 @@
$system_folder = str_replace("\\", "/", realpath(dirname(__FILE__))).'/'.$system_folder;
}
-// Is the aplication variable blank? If so, we'll assume it's called "application"
+// Is the $aplication variable blank? If so, we'll assume the folder is called "application"
if ($application_folder == '')
{
$application_folder = 'application';
diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php
index 4346027..a227066 100644
--- a/system/codeigniter/CodeIgniter.php
+++ b/system/codeigniter/CodeIgniter.php
@@ -197,8 +197,8 @@
show_404();
}
- // Call the requested method. Any URI segments present (besides the class/function)
- // will be passed to the method for convenience
+ // Call the requested method.
+ // Any URI segments present (besides the class/function) will be passed to the method for convenience
call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3)));
}
}
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 128984d..36d74c5 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -232,14 +232,70 @@
// --------------------------------------------------------------------
-
-
-
-
-
- function create_table()
+ /**
+ * Drop database
+ *
+ * @access public
+ * @param string the database name
+ * @return bool
+ */
+ function drop_database($name)
{
+ $sql = $this->_drop_database($name);
+
+ if (is_bool($sql))
+ {
+ return $sql;
+ }
+
+ return $this->db->query($sql);
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * List databases
+ *
+ * @access public
+ * @return bool
+ */
+ function list_databases()
+ {
+ $query = $this->db->query($this->_list_database());
+ $dbs = array();
+ if ($query->num_rows() > 0)
+ {
+ foreach ($query->result_array() as $row)
+ {
+ $dbs[] = current($row);
+ }
+ }
+
+ return $dbs;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Drop Table
+ *
+ * @access public
+ * @param string the table name
+ * @return bool
+ */
+ function drop_table($name)
+ {
+ $sql = $this->_drop_table($name);
+
+ if (is_bool($sql))
+ {
+ return $sql;
+ }
+
+ return $this->db->query($sql);
+ }
+
+
function alter_table()
{
diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php
index 49b63b7..b85a420 100644
--- a/system/database/drivers/mssql/mssql_utility.php
+++ b/system/database/drivers/mssql/mssql_utility.php
@@ -42,13 +42,13 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
- return $this->db->query("DROP DATABASE ".$name);
+ return "DROP DATABASE ".$name;
}
// --------------------------------------------------------------------
@@ -56,22 +56,12 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
- $query = $this->db->query("EXEC sp_helpdb"); // Can also be: EXEC sp_databases
- $dbs = array();
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $dbs[] = current($row);
- }
- }
-
- return $dbs;
+ return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases
}
// --------------------------------------------------------------------
@@ -79,12 +69,12 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
- return $this->db->query("DROP TABLE ".$this->db->_escape_table($name));
+ return "DROP TABLE ".$this->db->_escape_table($name);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index e5f8e85..a0c7462 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -41,13 +41,13 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
- return $this->db->query("DROP DATABASE ".$name);
+ return "DROP DATABASE ".$name;
}
// --------------------------------------------------------------------
@@ -55,22 +55,12 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
- $query = $this->db->query("SHOW DATABASES");
- $dbs = array();
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $dbs[] = current($row);
- }
- }
-
- return $dbs;
+ return "SHOW DATABASES";
}
// --------------------------------------------------------------------
@@ -78,12 +68,12 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
- return $this->db->query("DROP TABLE IF EXISTS ".$this->db->_escape_table($name));
+ return "DROP TABLE IF EXISTS ".$this->db->_escape_table($name);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php
index 1775047..3286618 100644
--- a/system/database/drivers/mysqli/mysqli_utility.php
+++ b/system/database/drivers/mysqli/mysqli_utility.php
@@ -41,13 +41,13 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
- return $this->db->query("DROP DATABASE ".$name);
+ return "DROP DATABASE ".$name;
}
// --------------------------------------------------------------------
@@ -55,22 +55,12 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
- $query = $this->db->query("SHOW DATABASES");
- $dbs = array();
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $dbs[] = current($row);
- }
- }
-
- return $dbs;
+ return "SHOW DATABASES";
}
// --------------------------------------------------------------------
@@ -78,12 +68,12 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
- return $this->db->query("DROP TABLE IF EXISTS ".$this->db->_escape_table($name));
+ return "DROP TABLE IF EXISTS ".$this->db->_escape_table($name);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php
index 74b0165..9c3059f 100644
--- a/system/database/drivers/oci8/oci8_utility.php
+++ b/system/database/drivers/oci8/oci8_utility.php
@@ -34,6 +34,7 @@
*/
function _create_database($name)
{
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -41,12 +42,13 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -54,11 +56,12 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -66,11 +69,12 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
+ return FALSE;
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php
index 74f8d39..5b4558f 100644
--- a/system/database/drivers/odbc/odbc_utility.php
+++ b/system/database/drivers/odbc/odbc_utility.php
@@ -48,11 +48,11 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
// ODBC has no "drop database" command since it's
// designed to connect to an existing database
@@ -68,10 +68,10 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
// Not sure if ODBC lets you list all databases...
if ($this->db_debug)
@@ -86,10 +86,10 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
// Not a supported ODBC feature
if ($this->db_debug)
diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php
index 8e51623..b31609a 100644
--- a/system/database/drivers/postgre/postgre_utility.php
+++ b/system/database/drivers/postgre/postgre_utility.php
@@ -42,13 +42,13 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
- return $this->db->query("DROP DATABASE ".$name);
+ return "DROP DATABASE ".$name;
}
// --------------------------------------------------------------------
@@ -56,22 +56,12 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
- $query = $this->db->query("SELECT datname FROM pg_database");
- $dbs = array();
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $dbs[] = current($row);
- }
- }
-
- return $dbs;
+ return "SELECT datname FROM pg_database";
}
// --------------------------------------------------------------------
@@ -79,12 +69,12 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
- return $this->db->query("DROP TABLE ".$this->db->_escape_table($name)." CASCADE");
+ return "DROP TABLE ".$this->db->_escape_table($name)." CASCADE";
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php
index 14b406a..754a755 100644
--- a/system/database/drivers/sqlite/sqlite_utility.php
+++ b/system/database/drivers/sqlite/sqlite_utility.php
@@ -43,11 +43,11 @@
/**
* Drop database
*
- * @access public
+ * @access private
* @param string the database name
* @return bool
*/
- function drop_database($name)
+ function _drop_database($name)
{
if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database))
{
@@ -65,10 +65,10 @@
/**
* List databases
*
- * @access public
+ * @access private
* @return bool
*/
- function list_databases()
+ function _list_databases()
{
if ($this->db_debug)
{
@@ -82,10 +82,10 @@
/**
* Drop Table
*
- * @access public
+ * @access private
* @return bool
*/
- function drop_table($table)
+ function _drop_table($table)
{
if ($this->db_debug)
{
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
index f4a9f82..b69d3f0 100644
--- a/system/libraries/Loader.php
+++ b/system/libraries/Loader.php
@@ -363,7 +363,10 @@
* Load Script
*
* This function loads the specified include file from the
- * application/scripts/ folder
+ * application/scripts/ folder.
+ *
+ * NOTE: This feature has been deprecated but it will remain available
+ * for legacy users.
*
* @access public
* @param array
@@ -496,7 +499,7 @@
}
/*
- * Extract and cached variables
+ * Extract and cache variables
*
* You can either set variables using the dedicated $this->load_vars()
* function or via the second parameter of this function. We'll merge
diff --git a/system/libraries/Router.php b/system/libraries/Router.php
index d1751a0..d7740f5 100644
--- a/system/libraries/Router.php
+++ b/system/libraries/Router.php
@@ -149,12 +149,12 @@
return;
}
- $this->set_class($segments['0']);
+ $this->set_class($segments[0]);
- if (isset($segments['1']))
+ if (isset($segments[1]))
{
// A scaffolding request. No funny business with the URL
- if ($this->routes['scaffolding_trigger'] == $segments['1'] AND $segments['1'] != '_ci_scaffolding')
+ if ($this->routes['scaffolding_trigger'] == $segments[1] AND $segments[1] != '_ci_scaffolding')
{
$this->scaffolding_request = TRUE;
unset($this->routes['scaffolding_trigger']);
@@ -162,7 +162,7 @@
else
{
// A standard method request
- $this->set_method($segments['1']);
+ $this->set_method($segments[1]);
}
}
@@ -186,22 +186,22 @@
function _validate_segments($segments)
{
// Does the requested controller exist in the root folder?
- if (file_exists(APPPATH.'controllers/'.$segments['0'].EXT))
+ if (file_exists(APPPATH.'controllers/'.$segments[0].EXT))
{
return $segments;
}
// Is the controller in a sub-folder?
- if (is_dir(APPPATH.'controllers/'.$segments['0']))
+ if (is_dir(APPPATH.'controllers/'.$segments[0]))
{
// Set the directory and remove it from the segment array
- $this->set_directory($segments['0']);
+ $this->set_directory($segments[0]);
$segments = array_slice($segments, 1);
if (count($segments) > 0)
{
// Does the requested controller exist in the sub-folder?
- if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments['0'].EXT))
+ if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT))
{
show_404();
}
@@ -250,7 +250,7 @@
{
$this->segments[$i++] = $val;
}
- unset($this->segments['0']);
+ unset($this->segments[0]);
if ($diff == FALSE)
{
@@ -263,7 +263,7 @@
{
$this->rsegments[$i++] = $val;
}
- unset($this->rsegments['0']);
+ unset($this->rsegments[0]);
}
}
// END _reindex_segments()
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index 153657e..b65b9be 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -519,13 +519,27 @@
* Numeric
*
* @access public
- * @param string
+ * @param int
* @return bool
*/
function numeric($str)
{
return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Is Numeric
+ *
+ * @access public
+ * @param string
+ * @return bool
+ */
+ function is_numeric($str)
+ {
+ return ( ! is_numeric($str)) ? FALSE : TRUE;
+ }
// --------------------------------------------------------------------
diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html
index 4257df1..78ae4da 100644
--- a/user_guide/libraries/email.html
+++ b/user_guide/libraries/email.html
@@ -213,9 +213,9 @@
<p>Sets the email message body:</p>
<code>$this->email->message('<var>This is my message</var>');</code>
-<h3>$this->email->alt_message()</h3>
+<h3>$this->email->set_alt_message()</h3>
<p>Sets the alternative email message body:</p>
-<code>$this->email->alt_message('<var>This is the alternative message</var>');</code>
+<code>$this->email->set_alt_message('<var>This is the alternative message</var>');</code>
<p>This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative
message with no HTML formatting which is added to the header string for people who do not accept HTML email.