src/Native5/Core/Database/DBFactory.php
public static function makeDB(\Native5\Core\Database\DBConfig $configuration)
    {
        if (empty($configuration))
            throw new \Exception('Empty connection settings provided'); 

        $port = $configuration->getPort();
        $port = !empty($port) ? $port : 3306;
        $dsn = $configuration->getType().':host='.$configuration->getHost().';port='.$port.';dbname='.$configuration->getName();
        $dbKey = md5($dsn.'.'.$configuration->getUser());

        if (isset(self::$_dbs[$dbKey]) && !empty(self::$_dbs[$dbKey]) && self::$_dbs[$dbKey]->checkConnection())
            return self::$_dbs[$dbKey];

        // Create a DB Instance for this user + database combination
        return (self::$_dbs[$dbKey] = new \Native5\Core\Database\DB($configuration));
    }
public static function makeDB(\Native5\Core\Database\DBConfig $configuration)
    {
        if (empty($configuration))
            throw new \Exception('Empty connection settings provided'); 

        $port = $configuration->getPort();
        $port = !empty($port) ? $port : 3306;
        $dsn = $configuration->getType().':host='.$configuration->getHost().';port='.$port.';dbname='.$configuration->getName();
        $dbKey = md5($dsn.'.'.$configuration->getUser());

        if (isset(self::$_dbs[$dbKey]) && !empty(self::$_dbs[$dbKey]) && self::$_dbs[$dbKey]->checkConnection())
            return self::$_dbs[$dbKey];

        // Create a DB Instance for this user + database combination
        return (self::$_dbs[$dbKey] = new \Native5\Core\Database\DB($configuration));
    }
public static function makeDB ( \ Native5 \ Core \ Database \ DBConfig $ configuration ) { if ( empty ( $ configuration ) ) throw new \ Exception ( 'Empty connection settings provided' ) ; $ port = $ configuration -> getPort ( ) ; $ port = ! empty ( $ port ) ? $ port : 3306 ; $ dsn = $ configuration -> getType ( ) . ':host=' . $ configuration -> getHost ( ) . ';port=' . $ port . ';dbname=' . $ configuration -> getName ( ) ; $ dbKey = md5 ( $ dsn . '.' . $ configuration -> getUser ( ) ) ; if ( isset ( self :: $ _dbs [ $ dbKey ] ) && ! empty ( self :: $ _dbs [ $ dbKey ] ) && self :: $ _dbs [ $ dbKey ] -> checkConnection ( ) ) return self :: $ _dbs [ $ dbKey ] ; // Create a DB Instance for this user + database combination return ( self :: $ _dbs [ $ dbKey ] = new \ Native5 \ Core \ Database \ DB ( $ configuration ) ) ; }
instance method for instantiating a DB object

@param mixed $configuration Database configuration

@static
@access private
@return void
instance method for instantiating a DB object