First of all you need to set a config for your connections.
В первую очередь вам нужно установить кофиг для ваших подключений.

@param array $config

@return array

@throws DbException
500195
public static function setConfig(array $config)
    {
        if ( ! isset($config['connection'])) {
            throw new DbException('can`t find `connection` parameter in database config');
        }
        $connection = &$config['connection'];
        if ( ! isset($connection['default'])) {
            throw new DbException('can`t find `default` parameter in database config');
        }
        $default = &$connection['default'];
        if ( ! is_string($default) || empty($connection[$default])) {
            throw new DbException('parameter `default` must be string and contain contains name of default connection. So given section `' .
                $default .
                '` must present in database config');
        }

        return self::$config = $config;
    }
194801
protected function createSingleConnection($config)
    {
        $pdo = false;
        $connection = $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config);
        $connection->connect($config['host'], $config['username'], $config['password'], $config['database']);
        return $connection;
    }
985338
protected function initDatabase( array $config )
    {
        if ( isset( $config[ 'db' ] ) )
        {
            if ( isset( $config[ 'db' ][ 'class' ] ) )
            {
                $this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
                {
                    $class = $config[ 'db' ][ 'class' ];

                    return new $class( $config[ 'db' ] );
                }
                );
            }
            else
            {
                $this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
                {
                    return new Database( $config[ 'db' ] );
                }
                );
            }
        }

        $this->alias( 'RawPHP\RawDatabase\Contract\IDatabase', 'db' );
    }
1364674
public function loadConfiguration(array $config = [])
    {
        if (isset($config['login'])) {
            $this->setLogin($config['login']);
        }
        if (isset($config['password'])) {
            $this->setPassword($config['password']);
        }
        if (isset($config['dsn'])) {
            $this->setDSN($config['dsn']);
        }
        return $this;
    }
585927
public function connect(array $config = [], $linkNum = 0)
    {
        if (!isset($this->links[$linkNum])) {
            if (empty($config)) {
                $config = $this->config;
            } else {
                $config = array_merge($this->config, $config);
            }
            $this->dbName  = $config['database'];
            $this->typeMap = $config['type_map'];

            if ($config['pk_convert_id'] && '_id' == $config['pk']) {
                $this->config['pk'] = 'id';
            }
            $host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . '/' . ($config['database'] ? "{$config['database']}" : '');

            $this->links[$linkNum] = new Manager($host, $this->config['params']);
        }
        return $this->links[$linkNum];
    }
240633
public function connect(array $config)
    {
        $dsn = $this->getDsn($config);

        $options = $this->getOptions($config);

        $connection = $this->createConnection($dsn, $config, $options);

        //
        $collation = $config['collation'];

        $charset = $config['charset'];

        $names = "set names '$charset'".
            (! is_null($collation) ? " collate '$collation'" : '');

        $connection->prepare($names)->execute();

        if (isset($config['strict']) && $config['strict']) {
            $connection->prepare("set session sql_mode='STRICT_ALL_TABLES'")->execute();
        }

        return $connection;
    }
1285342
public function connect(array $config)
    {
        $tns = ! empty($config['tns']) ? $config['tns'] : $this->getDsn($config);

        $options = $this->getOptions($config);

        if (array_get($options, 'session_mode') === OCI_CRED_EXT) {
            // External connections can only be used with user / and an empty password
            $config['username'] = '/';
            $config['password'] = null;
        }

        $connection = $this->createConnection($tns, $config, $options);

        return $connection;
    }
1241408
protected function doConnect($config)
    {
        $connectionString = "mysql:dbname={$config['database']}";
        
        if (isset($config['host'])) {
            $connectionString .= ";host={$config['host']}";
        }
        
        if (isset($config['port'])) {
            $connectionString .= ";port={$config['port']}";
        }

        if (isset($config['unix_socket'])) {
            $connectionString .= ";unix_socket={$config['unix_socket']}";
        }

        $connection = $this->container->build(
            '\PDO',
            array($connectionString, $config['username'], $config['password'], $config['options'])
        );

        if (isset($config['charset'])) {
            $connection->prepare("SET NAMES '{$config['charset']}'")->execute();
        }

        return $connection;
    }
381014
public function connect(array $config){
		Connection::alias($config, 'resource', 'pdo');

		// Defaults
		$defaults = array(
			'dsn' => null,
			'resource' => null,
			'username' => null,
			'password' => null,
			'options' => array(),
		);

		$config += $defaults;

		// Connect
		if($config['resource'] instanceof PDO)
			$this->resource = $config['resource'];
		else try{
			$this->resource = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']);
		} catch(PDOException $e){
			throw new DriverException($e->getMessage(), $e->getCode());
		}

		if(!$this->resource)
			throw new DriverException('Connection failed.');

		$this->driverName = $this->resource->getAttribute(PDO::ATTR_DRIVER_NAME);
	}
737658
public static function createDatabaseObject($dbConfig = null)
    {
        $dbConfig = self::getDatabaseConfig($dbConfig);

        $db = @Adapter::factory($dbConfig['adapter'], $dbConfig);

        self::$connection = $db;
    }
1147693
public static function configure($config = [])
    {
        if (empty(static::$config)) {
            static::$config = $config;
        }

        if (!in_array($config['driver'], ["smtp", "mail"])) {
            throw new MailException("The type is not known.", E_USER_ERROR);
        }

        if ($config['driver'] == "mail") {
            if (!static::$instance instanceof Native) {
                static::$instance = new Native($config['mail']);
            }
        } else {
            if (!static::$instance instanceof Smtp) {
                static::$instance = new Smtp($config['smtp']);
            }
        }

        return static::$instance;
    }
396784
public function setConnection($connectionConfig)
    {
        self::$config = static::parseUrl($connectionConfig);

        try {
            return  static::createConnection(self::$config);
        } catch (\PDOException $e) {
            throw new \Exception($e->getMessage());
        }
    }
143080
public function connect(array $config)
	{
		return new DatabaseQueue(
			$this->connections->connection(Arr::get($config, 'connection')),
			$config['table'],
			$config['queue'],
			Arr::get($config, 'expire', 60)
		);
	}
993585
public function connect($config)
    {
        $this->connection = Db::connect($config);
        $this->setBuilder();
        $this->prefix = $this->connection->getConfig('prefix');
        return $this;
    }
714786
public function connect(array $config)
    {
        $dsn = $this->getDsn($config);

        $options = $this->getOptions($config);

        // We need to grab the PDO options that should be used while making the brand
        // new connection instance. The PDO options control various aspects of the
        // connection's behavior, and some might be specified by the developers.
        $connection = $this->createConnection($dsn, $config, $options);

        if (! empty($config['database'])) {
            $connection->exec("use `{$config['database']}`;");
        }

        $this->configureEncoding($connection, $config);

        // Next, we will check to see if a timezone has been specified in this config
        // and if it has we will issue a statement to modify the timezone with the
        // database. Setting this DB timezone is an optional configuration item.
        $this->configureTimezone($connection, $config);

        $this->setModes($connection, $config);

        return $connection;
    }
448342
protected function _connection(array $config)
    {
        $redis = new \Redis;
        $host = empty($config['host']) ? self::DEFAULT_HOST : $config['host'];
        $port = empty($config['port']) ? self::DEFAULT_PORT : $config['port'];
        $timeout = empty($config['timeout']) ? self::DEFAULT_TIMEOUT : $config['timeout'];
        $connect = empty($config['persistent']) ? 'connect' : 'pconnect';
        $redis->$connect($host, $port, $timeout);
        return $redis;
    }
1340960
public function access($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'entity'  		=> null,
            'field'		=> 'access'
        ));

        $db = JFactory::getDbo();
        $query = $db->getQuery(true);

        $query->select('a.title AS text');
        $query->from('#__viewlevels AS a');
        $query->where('id = '.(int) $config->entity->{$config->field});
        $query->group('a.id, a.title, a.ordering');
        $query->order('a.ordering ASC');
        $query->order($query->qn('title') . ' ASC');

        // Get the options.
        $db->setQuery($query);
        $html = $db->loadResult();

        return $html;
    }