Don't serialze the params array for the _instance key.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 13 Jan 2011 16:28:36 +0000 (11:28 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 13 Jan 2011 16:29:27 +0000 (11:29 -0500)
It's not necessary, and it causes problems with some drivers.

kronolith/lib/Injector/Factory/Driver.php

index 4b8bb60..d8ea70f 100644 (file)
@@ -39,12 +39,11 @@ class Kronolith_Injector_Factory_Driver
      */
     public function create($driver, $params = array())
     {
-        $key = $driver . md5(serialize($params));
-        if (!empty($this->_instances[$key])) {
-            return $this->_instances[$key];
-        }
-
         $driver = basename($driver);
+        if (!empty($this->_instances[$driver])) {
+            return $this->_instances[$driver];
+        }
+        $key = $driver;
         $class = 'Kronolith_Driver_' . $driver;
         if (class_exists($class)) {
             $driver = new $class($params);