fix DbPear factory, fix duplicate variable name in function signature
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 24 Dec 2010 17:01:40 +0000 (12:01 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 24 Dec 2010 17:04:50 +0000 (12:04 -0500)
framework/Core/lib/Horde/Core/Factory/DbPear.php

index 94a6ed5..36d6b6a 100644 (file)
@@ -56,17 +56,17 @@ class Horde_Core_Factory_DbPear
      *
      * @param string $type  Either 'read' or 'rw'.
      * @param string $app   The application.
-     * @param mixed $type   The type. If this is an array, this is used as
+     * @param mixed $dtype  The type. If this is an array, this is used as
      *                      the configuration array.
      *
      * @return DB  The singleton DB instance.
      * @throws Horde_Exception
      */
-    public function create($type = 'rw', $app = 'horde', $type = null)
+    public function create($type = 'rw', $app = 'horde', $dtype = null)
     {
         global $registry;
 
-        $sig = hash('md5', serialize($type . '|' . $app . '|' . $type));
+        $sig = hash('md5', serialize($type . '|' . $app . '|' . $dtype));
 
         if (isset($this->_instances[$sig])) {
             return $this->_instances[$sig];
@@ -76,9 +76,9 @@ class Horde_Core_Factory_DbPear
             ? false
             : $registry->pushApp($app);
 
-        $config = is_array($type)
-            ? $type
-            : $this->getConfig($type);
+        $config = is_array($dtype)
+            ? $dtype
+            : $this->getConfig($dtype);
 
         /* Determine if we we are not using splitread or if we are using the
          * base SQL config. */