You are here

function apachesolr_drush_solr_set_env_url in Apache Solr Search 7

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

Set the environment url based on the environment ID

Parameters

$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_set_env_url'
apachesolr_drush_command in drush/apachesolr.drush.inc
Implements hook_drush_command().

File

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

Code

function apachesolr_drush_solr_set_env_url($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());
  }
  $environment['url'] = $url;
  apachesolr_environment_save($environment);
}