public function PreferredSearchCoreService::getListOfPossibleCores in Acquia Connector 7.3
Same name and namespace in other branches
- 8 acquia_search/src/PreferredSearchCoreService.php \Drupal\acquia_search\PreferredSearchCoreService::getListOfPossibleCores()
- 7.2 acquia_search/src/PreferredSearchCoreService.php \Drupal\acquia_search\PreferredSearchCoreService::getListOfPossibleCores()
Returns a list of all possible search core IDs.
The core IDs are generated based on the current site configuration.
Return value
array E.g. [ 'WXYZ-12345', 'WXYZ-12345.dev.mysitedev_folder1', 'WXYZ-12345.dev.mysitedev_db', ]
1 call to PreferredSearchCoreService::getListOfPossibleCores()
- PreferredSearchCoreService::getPreferredCore in acquia_search/
src/ PreferredSearchCoreService.php - Returns the preferred core from the list of available cores.
File
- acquia_search/
src/ PreferredSearchCoreService.php, line 127
Class
- PreferredSearchCoreService
- Class PreferredSearchCoreService.
Namespace
Drupal\acquia_searchCode
public function getListOfPossibleCores() {
$possible_core_ids = array();
// In index naming, we only accept alphanumeric chars.
$sites_foldername = preg_replace('@[^a-zA-Z0-9]+@', '', $this->sites_foldername);
$ah_env = preg_replace('@[^a-zA-Z0-9]+@', '', $this->ah_env);
if ($ah_env) {
// When there is an Acquia DB name defined, priority is to pick
// WXYZ-12345.[env].[db_name], then WXYZ-12345.[env].[site_foldername].
// If we're sure this is prod, then 3rd option is WXYZ-12345.
if ($this->ah_db_name) {
$possible_core_ids[] = $this->acquia_identifier . '.' . $ah_env . '.' . $this->ah_db_name;
}
$possible_core_ids[] = $this->acquia_identifier . '.' . $ah_env . '.' . $sites_foldername;
// @TODO: Support for [id]_[env][sitename] cores?
}
// For production-only, we allow auto-connecting to the suffix-less core
// as the fallback.
if (isset($_SERVER['AH_PRODUCTION']) || isset($_ENV['AH_PRODUCTION'])) {
$possible_core_ids[] = $this->acquia_identifier;
}
return $possible_core_ids;
}