public static function DESConnector82::buildClusterUrl in Elasticsearch Connector 8
Builds the proper cluster URL based on the provided options.
Parameters
$cluster:
Return value
string
1 call to DESConnector82::buildClusterUrl()
- DESConnector82::getInstance in src/
DESConnector/ DESConnector82.php - Initializes the needed client.
File
- src/
DESConnector/ DESConnector82.php, line 102 - Provides Elasticsearch Client for Drupal's Elasticsearch Connector module.
Class
- DESConnector82
- Drupal Elasticsearch Interface.
Namespace
Drupal\elasticsearch_connector\DESConnectorCode
public static function buildClusterUrl($cluster_url, $options) {
if (isset($options['use_authentication'])) {
if (isset($options['username']) && isset($options['password'])) {
$schema = file_uri_scheme($cluster_url);
$host = file_uri_target($cluster_url);
$user = $options['username'];
$pass = $options['password'];
return $schema . '://' . $user . ':' . $pass . '@' . $host;
}
}
return $cluster_url;
}