You are here

function apachesolr_drush_solr_get_env_url in Apache Solr Search 7

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

Get the environment url based on the environment ID

@print The environment url

Return value

mixed APACHESOLR_ENV_ID_ERROR Only return error if the environment can't be found

1 string reference to 'apachesolr_drush_solr_get_env_url'
apachesolr_drush_command in drush/apachesolr.drush.inc
Implements hook_drush_command().

File

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

Code

function apachesolr_drush_solr_get_env_url() {
  $env_id = drush_get_option('id', apachesolr_default_environment());
  try {
    $environment = _apachesolr_drush_environment_load_and_validate($env_id);
  } catch (Exception $e) {
    return drush_set_error('APACHESOLR_ENV_ID_ERROR', $e
      ->getMessage());
  }
  drush_print($environment['url']);
}