You are here

function _apachesolr_drush_environment_load_and_validate in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 drush/apachesolr.drush.inc \_apachesolr_drush_environment_load_and_validate()
  2. 7 drush/apachesolr.drush.inc \_apachesolr_drush_environment_load_and_validate()

Load an environment from an id and validate the result.

Throws

Exception

4 calls to _apachesolr_drush_environment_load_and_validate()
apachesolr_drush_solr_get_env_name in drush/apachesolr.drush.inc
apachesolr_drush_solr_get_env_url in drush/apachesolr.drush.inc
apachesolr_drush_solr_set_env_url in drush/apachesolr.drush.inc
_apachesolr_drush_variable_like in drush/apachesolr.drush.inc
Search for similar variable names.

File

drush/apachesolr.drush.inc, line 528
drush integration for apachesolr.

Code

function _apachesolr_drush_environment_load_and_validate($env_id) {
  $environment = apachesolr_environment_load($env_id);
  if (!$environment) {
    throw new Exception(dt('!env_id is not a valid environment ID.', array(
      '!env_id' => $env_id,
    )));
  }
  drush_log(dt('Using environment ID: "!env_id"', array(
    '!env_id' => $env_id,
  )), 'success');
  return $environment;
}