function hook_drush_sitealias_alter

8.0.x drush.api.php hook_drush_sitealias_alter(&$alias_record)
master drush.api.php hook_drush_sitealias_alter(&$alias_record)

Adjust the contents of a site alias.

1 function implements hook_drush_sitealias_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

policy_drush_sitealias_alter in examples/policy.drush.inc
Implements hook_drush_sitealias_alter

File

./drush.api.php, line 208
Documentation of the Drush API.

Code

function hook_drush_sitealias_alter(&$alias_record) {
  // If the alias is "remote", but the remote site is
  // the system this command is running on, convert the
  // alias record to a local alias.
  if (isset($alias_record['remote-host'])) {
    $uname = php_uname('n');
    if ($alias_record['remote-host'] == $uname) {
      unset($alias_record['remote-host']);
      unset($alias_record['remote-user']);
    }
  }
}