From 8f023db4630d41dce3142d1bde5624dcad426f38 Mon Sep 17 00:00:00 2001
From: "ctrlaltca@gmail.com" <>
Date: Thu, 10 Nov 2011 20:46:51 +0000
Subject: fixed #240

---
 HISTORY                       | 3 ++-
 framework/Caching/TXCache.php | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/HISTORY b/HISTORY
index 9a05be93..67d072f2 100644
--- a/HISTORY
+++ b/HISTORY
@@ -19,6 +19,7 @@ BUG: Issue #181 - Fixed regression introduced by the patch for #181 (ctrlaltca)
 BUG: Issue #203 - Workaround for ->CallbackClient->click under IE<=8 (ctrlaltca)
 BUG: Issue #232 - Could not change enable-state of TActiveCheckBox via Ajax callback (Christophe)
 ENH: Issue #235 - Progressive rendering not possible (Gabor)
+BUG: Issue #240 - TXCache has wrong flush() implementation (ctrlaltca)
 BUG: Issue #243 - Cross-site scripting issue in TForm (ctrlaltca)
 BUG: Issue #265 - Using scroll wheel causes NaN values in TDatePicker (Gabor)
 BUG: Issue #301 - Fixed a bug in TActiveFileUpload (ctrlaltca)
@@ -35,11 +36,11 @@ BUG: Issue #366 - Use divs instead of spans around tables in TActiveDataGrid (ct
 BUG: Issue #365 - [Runtime Notice] Declaration of T${DriverName}MetaData::quoteTableName() should be compatible with that of TDbMetaData::quoteTableName() (Yves)
 BUG: Issue #367 - Parameterized RegularExpression property in UrlMapping raise TPhpErrorException in DOMDocument::loadXML() (Yves)
 BUG: Issue #368 - Clearing selection of a TActiveDropDownList in callback should select its prompt (ctrlaltca)
+CHG: Issue #370 - Deprecated TSqliteCache since it's based on php's sqlite extension (ctrlaltca)
 BUG: Issue #371 - Sorting on TActiveDataGrid autogenerated column not work (ctrlaltca)
 ENH: Performance (micro)optimization in TUrlMapping::loadUrlMappings - invoke `getDefaultMappingClass` outside of loop (Yves)
 BUG: TActiveMultiView must update clientside only when necessary to get other active controls work fine inside it (ctrlaltca)
 BUG: TListBox doesn't correctly reports selected indices to serverside on callback
-CHG: Deprecated TSqliteCache since it's based on php's sqlite extension (ctrlaltca)
 
 Version 3.1.10 Jul 17, 2011
 BUG: Added missing timeout on TCacheHttpSession (ctrlaltca)
diff --git a/framework/Caching/TXCache.php b/framework/Caching/TXCache.php
index f97a9c23..ca9e19c1 100644
--- a/framework/Caching/TXCache.php
+++ b/framework/Caching/TXCache.php
@@ -119,7 +119,12 @@ class TXCache extends TCache
 	 */
 	public function flush()
 	{
-		return xcache_clear_cache();
+		for($i=0, $max=xcache_count(XC_TYPE_VAR); $i<$max; $i++)
+		{
+			if(xcache_clear_cache(XC_TYPE_VAR, $i)===false)
+				return false;
+		}
+		return true;
 	}
 }
 
-- 
cgit v1.2.3