Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cluster/PhabricatorDatabaseRef.php
Show First 20 Lines • Show All 657 Lines • ▼ Show 20 Lines | $spec = $options + array( | ||||
'pass' => $this->getPass(), | 'pass' => $this->getPass(), | ||||
'host' => $this->getHost(), | 'host' => $this->getHost(), | ||||
'port' => $this->getPort(), | 'port' => $this->getPort(), | ||||
'database' => null, | 'database' => null, | ||||
'retries' => $default_retries, | 'retries' => $default_retries, | ||||
'timeout' => $default_timeout, | 'timeout' => $default_timeout, | ||||
); | ); | ||||
return PhabricatorEnv::newObjectFromConfig( | return self::newRawConnection($spec); | ||||
'mysql.implementation', | } | ||||
array( | |||||
$spec, | public static function newRawConnection(array $options) { | ||||
)); | if (extension_loaded('mysqli')) { | ||||
return new AphrontMySQLiDatabaseConnection($options); | |||||
} else { | |||||
return new AphrontMySQLDatabaseConnection($options); | |||||
} | |||||
} | } | ||||
} | } |