summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rwxr-xr-xsystem/core/CodeIgniter.php10
-rw-r--r--system/core/Common.php10
-rwxr-xr-xsystem/core/Exceptions.php4
-rwxr-xr-xsystem/core/Security.php4
-rw-r--r--system/database/DB_driver.php35
-rw-r--r--system/database/DB_result.php12
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php9
-rw-r--r--system/database/drivers/interbase/interbase_driver.php5
-rw-r--r--system/database/drivers/mssql/mssql_driver.php7
-rw-r--r--system/database/drivers/mysql/mysql_driver.php7
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php6
-rw-r--r--system/database/drivers/oci8/oci8_driver.php7
-rw-r--r--system/database/drivers/odbc/odbc_driver.php7
-rw-r--r--system/database/drivers/pdo/pdo_driver.php15
-rw-r--r--system/database/drivers/postgre/postgre_driver.php5
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php7
-rw-r--r--system/database/drivers/sqlite3/sqlite3_driver.php3
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_driver.php7
18 files changed, 79 insertions, 81 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index e1892ee7e..c8245fcfa 100755
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -382,15 +382,5 @@
*/
$EXT->call_hook('post_system');
-/*
- * ------------------------------------------------------
- * Close the DB connection if one exists
- * ------------------------------------------------------
- */
- if (class_exists('CI_DB') && isset($CI->db) && ! $CI->db->pconnect)
- {
- $CI->db->close();
- }
-
/* End of file CodeIgniter.php */
/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file
diff --git a/system/core/Common.php b/system/core/Common.php
index 8b897776f..4b733ac97 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -487,16 +487,6 @@ if ( ! function_exists('_exception_handler'))
*/
function _exception_handler($severity, $message, $filepath, $line)
{
- // We don't bother with "strict" notices since they tend to fill up
- // the log file with excess information that isn't normally very helpful.
- // For example, if you are running PHP 5 and you use version 4 style
- // class functions (without prefixes like "public", "private", etc.)
- // you'll get notices telling you that these have been deprecated.
- if ($severity == E_STRICT)
- {
- return;
- }
-
$_error =& load_class('Exceptions', 'core');
// Should we display the error? We'll get the current error_reporting
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index 965a717ad..8c32085fe 100755
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -143,7 +143,7 @@ class CI_Exceptions {
ob_end_flush();
}
ob_start();
- include(APPPATH.'errors/'.$template.'.php');
+ include(APPPATH.'views/errors/'.$template.'.php');
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
@@ -177,7 +177,7 @@ class CI_Exceptions {
ob_end_flush();
}
ob_start();
- include(APPPATH.'errors/error_php.php');
+ include(APPPATH.'views/errors/error_php.php');
$buffer = ob_get_contents();
ob_end_clean();
echo $buffer;
diff --git a/system/core/Security.php b/system/core/Security.php
index 81b6602ae..f953011eb 100755
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -831,7 +831,7 @@ class CI_Security {
// each page load since a page could contain embedded
// sub-pages causing this feature to fail
if (isset($_COOKIE[$this->_csrf_cookie_name]) &&
- $_COOKIE[$this->_csrf_cookie_name] != '')
+ preg_match('#^[0-9a-f]{32}$#iS', $_COOKIE[$this->_csrf_cookie_name]) === 1)
{
return $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name];
}
@@ -846,4 +846,4 @@ class CI_Security {
}
/* End of file Security.php */
-/* Location: ./system/core/Security.php */ \ No newline at end of file
+/* Location: ./system/core/Security.php */
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index ef77b594e..a0812d4c7 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1152,7 +1152,7 @@ abstract class CI_DB_driver {
{
if ($this->conn_id)
{
- $this->_close($this->conn_id);
+ $this->_close();
$this->conn_id = FALSE;
}
}
@@ -1160,6 +1160,20 @@ abstract class CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Close DB Connection
+ *
+ * This method would be overriden by most of the drivers.
+ *
+ * @return void
+ */
+ protected function _close()
+ {
+ $this->conn_id = FALSE;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Display an error message
*
* @param string the error message
@@ -1390,7 +1404,24 @@ abstract class CI_DB_driver {
{
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Destructor
+ *
+ * Closes the database connection, if needed.
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ if ( ! $this->pconnect)
+ {
+ $this->close();
+ }
+ }
+
}
/* End of file DB_driver.php */
-/* Location: ./system/database/DB_driver.php */
+/* Location: ./system/database/DB_driver.php */ \ No newline at end of file
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 196febe2c..690734b08 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -371,6 +371,18 @@ class CI_DB_result {
// --------------------------------------------------------------------
/**
+ * Returns an unbuffered row and move pointer to next row
+ *
+ * @return mixed either a result object or array
+ */
+ public function unbuffered_row($type = 'object')
+ {
+ return ($type !== 'array') ? $this->_fetch_object() : $this->_fetch_assoc();
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* The following functions are normally overloaded by the identically named
* methods in the platform-specific driver -- except when query caching
* is used. When caching is enabled we do not load the other driver.
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index 1373faa88..944df99b5 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -485,7 +485,7 @@ class CI_DB_cubrid_driver extends CI_DB {
}
// --------------------------------------------------------------------
-
+
/**
* Limit string
*
@@ -506,15 +506,14 @@ class CI_DB_cubrid_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @cubrid_close($conn_id);
+ @cubrid_close($this->conn_id);
}
}
/* End of file cubrid_driver.php */
-/* Location: ./system/database/drivers/cubrid/cubrid_driver.php */
+/* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php
index 1b18de803..c457f6340 100644
--- a/system/database/drivers/interbase/interbase_driver.php
+++ b/system/database/drivers/interbase/interbase_driver.php
@@ -472,12 +472,11 @@ class CI_DB_interbase_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @ibase_close($conn_id);
+ @ibase_close($this->conn_id);
}
}
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index f60ec8168..914de499f 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -523,15 +523,14 @@ class CI_DB_mssql_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @mssql_close($conn_id);
+ @mssql_close($this->conn_id);
}
}
/* End of file mssql_driver.php */
-/* Location: ./system/database/drivers/mssql/mssql_driver.php */
+/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 32c51865d..161f99541 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -520,15 +520,14 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @mysql_close($conn_id);
+ @mysql_close($this->conn_id);
}
}
/* End of file mysql_driver.php */
-/* Location: ./system/database/drivers/mysql/mysql_driver.php */
+/* Location: ./system/database/drivers/mysql/mysql_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index e2684e4f2..9261883f5 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -523,16 +523,14 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param object
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
$this->conn_id->close();
- $this->conn_id = FALSE;
}
}
/* End of file mysqli_driver.php */
-/* Location: ./system/database/drivers/mysqli/mysqli_driver.php */
+/* Location: ./system/database/drivers/mysqli/mysqli_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 33a89df94..e2fa51349 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -671,15 +671,14 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @oci_close($conn_id);
+ @oci_close($this->conn_id);
}
}
/* End of file oci8_driver.php */
-/* Location: ./system/database/drivers/oci8/oci8_driver.php */
+/* Location: ./system/database/drivers/oci8/oci8_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index e36f2d233..e3172117a 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -402,15 +402,14 @@ class CI_DB_odbc_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @odbc_close($conn_id);
+ @odbc_close($this->conn_id);
}
}
/* End of file odbc_driver.php */
-/* Location: ./system/database/drivers/odbc/odbc_driver.php */
+/* Location: ./system/database/drivers/odbc/odbc_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 89e69676d..e38c1145c 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -667,20 +667,7 @@ class CI_DB_pdo_driver extends CI_DB {
}
}
- // --------------------------------------------------------------------
-
- /**
- * Close DB Connection
- *
- * @param object
- * @return void
- */
- protected function _close($conn_id)
- {
- $this->conn_id = NULL;
- }
-
}
/* End of file pdo_driver.php */
-/* Location: ./system/database/drivers/pdo/pdo_driver.php */
+/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 17bd37b38..0ddfd0abe 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -653,12 +653,11 @@ class CI_DB_postgre_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @pg_close($conn_id);
+ @pg_close($this->conn_id);
}
}
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 551704f83..d710b945d 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -450,15 +450,14 @@ class CI_DB_sqlite_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @sqlite_close($conn_id);
+ @sqlite_close($this->conn_id);
}
}
/* End of file sqlite_driver.php */
-/* Location: ./system/database/drivers/sqlite/sqlite_driver.php */
+/* Location: ./system/database/drivers/sqlite/sqlite_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php
index d22f6a442..ad2848ed8 100644
--- a/system/database/drivers/sqlite3/sqlite3_driver.php
+++ b/system/database/drivers/sqlite3/sqlite3_driver.php
@@ -417,10 +417,9 @@ class CI_DB_sqlite3_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param object (ignored)
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
$this->conn_id->close();
}
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php
index 8cc500f55..3e9fa7b1a 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_driver.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -510,15 +510,14 @@ class CI_DB_sqlsrv_driver extends CI_DB {
/**
* Close DB Connection
*
- * @param resource
* @return void
*/
- protected function _close($conn_id)
+ protected function _close()
{
- @sqlsrv_close($conn_id);
+ @sqlsrv_close($this->conn_id);
}
}
/* End of file sqlsrv_driver.php */
-/* Location: ./system/database/drivers/sqlsrv/sqlsrv_driver.php */
+/* Location: ./system/database/drivers/sqlsrv/sqlsrv_driver.php */ \ No newline at end of file