From c5f7fa3f8fea283b51ee6cd80b36b2112b2e81db Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 6 Oct 2006 02:10:23 +0000 Subject: --- system/database/DB_driver.php | 43 ++++++++++++++++++++++++------- system/libraries/Validation.php | 27 ++++++++++++------- user_guide/database/utilities.html | 4 +-- user_guide/general/changelog.html | 5 ++-- user_guide/helpers/user_agent_helper.html | 2 +- 5 files changed, 56 insertions(+), 25 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]); diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index cf42aaee5..fcfc24945 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -227,7 +227,7 @@ $config = array (
                  'root'    => 'root',
                  'element' => 'element',
                  'newline' => "\n",
-                  ';tab'    => "\t"
+                  'tab'    => "\t"
                );

echo $this->dbutil->xml_from_result($query, $config); @@ -252,7 +252,7 @@ via the command line, or have your server admin do it for you if you do not have // Load the DB utility class
$this->load->dbutil();

-// Backup your entire database
+// Backup your entire database and assign it to a variable
$backup =& $this->dbutil->backup();

diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 1e7b32213..22f22058e 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -80,13 +80,14 @@ Change Log
  • Added simple_query() function to the database classes
  • Added standard_date() function to the Date Helper.
  • Added $query->free_result() to database class.
  • -
  • Added $query->field_names() function to database class
  • -
  • Added $this->db->platform() function
  • +
  • Added $query->field_names() function to database class
  • +
  • Added $this->db->platform() function
  • Added two more protocols to the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
  • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
  • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
  • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
  • Fixed a bug in the Email class related to SMTP Helo data.
  • +
  • Fixed a bug in the validation class.
  • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
  • Deprecated $this->db->field_names() USE $this->db->list_fields()
  • Deprecated $this->load->library('unit_test'). USE $this->load->library('unit')
  • diff --git a/user_guide/helpers/user_agent_helper.html b/user_guide/helpers/user_agent_helper.html index 171f9ae24..617c32641 100644 --- a/user_guide/helpers/user_agent_helper.html +++ b/user_guide/helpers/user_agent_helper.html @@ -63,7 +63,7 @@ User Agent Helper

    User Agent Helper

    -

    The User Agent Helper file helps you work with browser generated data..

    +

    The User Agent Helper file helps you work with browser generated data.

    Loading this Helper

    -- cgit v1.2.3-24-g4f1b