Ejemplo n.º 1
0
 /**
  * @brief Return a pooled connection for the connectionstring
  *
  * @param mixed $connectionstring The connectionstring to request
  * @return DatabaseDriver the database driver
  */
 public static function getPooledConnection($connectionstring)
 {
     $csh = md5(serialize($connectionstring));
     if (!arr::hasKey(self::$pool, $csh)) {
         $driverclass = DatabaseDriver::getDriverClass($connectionstring['driver']);
         self::$pool[$csh] = array('instance' => new $driverclass($connectionstring), 'count' => 0);
         self::$pool[$csh]['instance']->setPoolIdentity($csh);
     }
     self::$pool[$csh]['count']++;
     return self::$pool[$csh]['instance'];
 }