<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>php/EpiSession_Memcached.php</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 &lt;?php
 class EpiCache_Memcached extends EpiCache
 {
+  private static $connected = false;
   private $memcached = null;
   private $host = null;
   private $port = null;
@@ -8,19 +9,27 @@ class EpiCache_Memcached extends EpiCache
   private $expiry   = null;
   public function __construct($params = array())
   {
-    $this-&gt;host = !empty($params[0] ? $params[0] : 'localhost';
-    $this-&gt;port = !empty($params[1] ? $params[1] : 11211;;
-    $this-&gt;compress = !empty($params[2] ? $params[2] : 0;;
-    $this-&gt;expiry   = !empty($params[3] ? $params[3] : 3600;
+    $this-&gt;host = !empty($params[0]) ? $params[0] : 'localhost';
+    $this-&gt;port = !empty($params[1]) ? $params[1] : 11211;;
+    $this-&gt;compress = !empty($params[2]) ? $params[2] : 0;;
+    $this-&gt;expiry   = !empty($params[3]) ? $params[3] : 3600;
   }
 
-  public function get($key)
+  public function delete($key, $timeout = 0)
+  {
+    if(!$this-&gt;connect() || empty($key))
+      return false;
+
+    return $this-&gt;memcached-&gt;delete($key, $timeout);
+  }
+
+  public function get($key, $useCache = true)
   {
     if(!$this-&gt;connect() || empty($key))
     {
       return null;
     }
-    else if($getEpiCache = $this-&gt;getEpiCache($key))
+    else if($useCache &amp;&amp; $getEpiCache = $this-&gt;getEpiCache($key))
     {
       return $getEpiCache;
     }
@@ -45,14 +54,21 @@ class EpiCache_Memcached extends EpiCache
 
   private function connect()
   {
+    if(self::$connected === true)
+      return true;
+
     if(class_exists('Memcache'))
     {
       $this-&gt;memcached = new Memcache;
-      if($this-&gt;memcached-&gt;connect($this-&gt;host, $this-&gt;port))
-        return true;
+      if(@$this-&gt;memcached-&gt;connect($this-&gt;host, $this-&gt;port))
+        return self::$connected = true;
+      else
+        throw new EpiCacheMemcacheConnectException('Could not connect to memcache server', 0);
     }
 
-    return false;
+    throw new EpiCacheMemcacheClientDneException('No memcache client exists', 0);
   }
 }
-?&gt;
+
+class EpiCacheMemcacheClientDneException extends EpiCacheException{}
+class EpiCacheMemcacheConnectException extends EpiCacheException{}</diff>
      <filename>php/EpiCache_Memcached.php</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ class EpiSession
 
     $type = array_shift($params);
     if(!file_exists($file = dirname(__FILE__) . &quot;/{$type}.php&quot;))
-      throw new EpiCacheTypeDoesNotExistException(&quot;EpiCache type does not exist: ({$type}).  Tried loading {$file}&quot;, 404);
+      echo $file;//throw new EpiCacheTypeDoesNotExistException(&quot;EpiCache type does not exist: ({$type}).  Tried loading {$file}&quot;, 404);
 
     require_once $file;
     self::$instances[$hash] = new $type($params);</diff>
      <filename>php/EpiSession.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9d5aa9780589489b2bfacbef6fcaf46454acc169</id>
    </parent>
  </parents>
  <author>
    <name>Jaisen Mathai</name>
    <email>jaisen@jmathai.com</email>
  </author>
  <url>http://github.com/jmathai/epicode/commit/1e93acbcf1d435127f040fb3347458628f273eab</url>
  <id>1e93acbcf1d435127f040fb3347458628f273eab</id>
  <committed-date>2009-06-18T23:51:17-07:00</committed-date>
  <authored-date>2009-06-18T23:51:17-07:00</authored-date>
  <message>Adding Memcached extension for EpiSession.</message>
  <tree>92b02fa9dafc3a12c99f0830b9ef5788f917fe49</tree>
  <committer>
    <name>Jaisen Mathai</name>
    <email>jaisen@jmathai.com</email>
  </committer>
</commit>
