diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-12-21 20:05:27 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-12-21 20:05:27 -0800 |
commit | 9285c8c66c530196399eb05bb5561c3fa5538335 (patch) | |
tree | 7cec68583c01b5b365e7669fefc1adc6360e89a5 /system/libraries/Database.php | |
parent | 9c5df1d31bd214fab051b71d092c751a1da20ecc (diff) |
Updated Kohana to r4724
Diffstat (limited to 'system/libraries/Database.php')
-rw-r--r-- | system/libraries/Database.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/system/libraries/Database.php b/system/libraries/Database.php index d3716c59..38a38fbf 100644 --- a/system/libraries/Database.php +++ b/system/libraries/Database.php @@ -1,9 +1,9 @@ <?php defined('SYSPATH') or die('No direct script access.'); /** * Database wrapper. - * - * $Id: Database.php 4679 2009-11-10 01:45:52Z isaiah $ - * + * + * $Id: Database.php 4709 2009-12-10 05:09:35Z isaiah $ + * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team @@ -11,10 +11,12 @@ */ abstract class Database_Core { - const SELECT = 1; - const INSERT = 2; - const UPDATE = 3; - const DELETE = 4; + const SELECT = 1; + const INSERT = 2; + const UPDATE = 3; + const DELETE = 4; + const CROSS_REQUEST = 5; + const PER_REQUEST = 6; protected static $instances = array(); @@ -350,11 +352,12 @@ abstract class Database_Core { * Clears the internal query cache. * * @param mixed clear cache by SQL statement, NULL for all, or TRUE for last query + * @param integer Type of cache to clear, Database::CROSS_REQUEST or Database::PER_REQUEST * @return Database */ - public function clear_cache($sql = NULL) + public function clear_cache($sql = NULL, $type = NULL) { - if ($this->cache instanceof Cache) + if ($this->cache instanceof Cache AND ($type == NULL OR $type == Database::CROSS_REQUEST)) { // Using cross-request Cache library if ($sql === TRUE) @@ -370,7 +373,7 @@ abstract class Database_Core { $this->cache->delete_all(); } } - elseif (is_array($this->cache)) + elseif (is_array($this->cache) AND ($type == NULL OR $type == Database::PER_REQUEST)) { // Using per-request memory cache if ($sql === TRUE) |