private function getLinkFromConnectionInfo($connInfo) { $auth = Zotero_DBConnectAuth('shard'); $config = array('host' => $connInfo['address'], 'port' => $connInfo['port'], 'username' => $auth['user'], 'password' => $auth['pass'], 'dbname' => $connInfo['db'], 'charset' => !empty($auth['charset']) ? $auth['charset'] : 'utf8', 'driver_options' => array("MYSQLI_OPT_CONNECT_TIMEOUT" => 5)); // TEMP: For now, use separate host if (get_called_class() == 'Zotero_FullText_DB') { $auth = Zotero_DBConnectAuth('fulltext'); $config['host'] = $auth['host']; $config['port'] = $auth['port']; } else { if (get_called_class() == 'Zotero_Admin_DB') { $auth = Zotero_DBConnectAuth($this->db); $config['username'] = $auth['user']; $config['password'] = $auth['pass']; } } $link = new Zend_Db_Adapter_Mysqli($config); // If profile was previously enabled, enable it for this link if ($this->profilerEnabled) { $link->getProfiler()->setEnabled(true); } return $link; }