--- includes/cache.inc	2006-11-10 08:26:27.000000000 +0100
+++ ../cache.inc	2007-07-04 12:54:30.000000000 +0200
@@ -11,6 +11,10 @@
  *   'cache_menu', 'cache_page', or 'cache' for the default cache.
  */
 function cache_get($key, $table = 'cache') {
+  return ehcache_get($key, $table);
+}
+
+function cache_get_db($key, $table = 'cache') {
   global $user;
 
   // Garbage collection necessary when enforcing a minimum cache lifetime
@@ -91,6 +95,10 @@
  *   A string containing HTTP header information for cached pages.
  */
 function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
+  ehcache_set($cid, $table, $data, $expire, $headers);
+}
+
+function cache_set_db($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
   db_lock_table($table);
   db_query("UPDATE {%s} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $table, $data, time(), $expire, $headers, $cid);
   if (!db_affected_rows()) {
@@ -118,10 +126,19 @@
  *   match. If '*' is given as $cid, the table $table will be emptied.
  */
 function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
+  if (!isset($cid) && !isset($table)) {
+    cache_clear_all(NULL, 'cache_page');
+    return;
+  }
+
+  ehcache_clear_all($cid, $table, $wildcard);
+}
+
+function cache_clear_all_db($cid = NULL, $table = NULL, $wildcard = FALSE) {
   global $user;
 
   if (!isset($cid) && !isset($table)) {
-    cache_clear_all(NULL, 'cache_page');
+    cache_clear_all_db(NULL, 'cache_page');
     return;
   }
 
