public function getConnection($type) { if (isset($this->conns[$type]) && !is_null($this->conns[$type])) { return $this->conns[$type]; } $config = $this->loadConfig($this->database, $type); $host = $config['HOST']; $port = $config['PORT']; $user = $config['USER']; $pass = $config['PASS']; $db = $config['DB']; $this->conns[$type] = \Frame\Helper\Util::retry($this->connectRetry, function () use($host, $db, $user, $pass, $port) { return new \Frame\Connect\Database($host, $db, $user, $pass, $port); }); return $this->conns[$type]; }