summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_driver.php43
-rw-r--r--system/libraries/Validation.php27
2 files changed, 50 insertions, 20 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index f77b46609..e8c4a8236 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -51,7 +51,7 @@ class CI_DB_driver {
var $_trans_failure = FALSE; // Used with transactions to determine if a rollback should occur
var $cache_on = FALSE;
var $cachedir = '';
- var $cache_autodel = TRUE;
+ var $cache_autodel = FALSE;
var $CACHE; // The cache class object
@@ -889,7 +889,21 @@ class CI_DB_driver {
return call_user_func_array($function, $args);
}
}
-
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Set Cache Directory Path
+ *
+ * @access public
+ * @param string the path to the cache directory
+ * @return void
+ */
+ function cache_set_path($path = '')
+ {
+ $this->cachedir = $path;
+ }
+
// --------------------------------------------------------------------
/**
@@ -915,32 +929,41 @@ class CI_DB_driver {
{
return $this->cache_on = FALSE;
}
+
// --------------------------------------------------------------------
/**
- * Set the cache "auto-delete" value
+ * Delete the cache files associated with a particular URI
*
* @access public
* @return void
*/
- function cache_autodelete($val = TRUE)
+ function cache_delete()
{
- $this->cache_autodel = ( ! is_bool($val)) ? TRUE : $val;
+ if ( ! $this->_cache_init())
+ {
+ return FALSE;
+ }
+ return $this->CACHE->delete();
}
-
+
// --------------------------------------------------------------------
/**
- * Set Cache Directory Path
+ * Delete All cache files
*
* @access public
- * @param string the path to the cache directory
* @return void
*/
- function cache_set_path($path = '')
+ function cache_delete_all()
{
- $this->cachedir = $path;
+ if ( ! $this->_cache_init())
+ {
+ return FALSE;
+ }
+
+ return $this->CACHE->delete_all();
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index 7db67a3e1..ff5970837 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -65,18 +65,25 @@ class CI_Validation {
function set_fields($data = '', $field = '')
{
if ($data == '')
- return;
-
- if ( ! is_array($data))
{
- if ($field == '')
- return;
-
- $data = array($data => $field);
+ if (count($this->_fields) == 0)
+ {
+ return FALSE;
+ }
}
-
- $this->_fields = $data;
-
+ else
+ {
+ if ( ! is_array($data))
+ {
+ $data = array($data => $field);
+ }
+
+ if (count($data) > 0)
+ {
+ $this->_fields = $data;
+ }
+ }
+
foreach($this->_fields as $key => $val)
{
$this->$key = ( ! isset($_POST[$key]) OR is_array($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]);