Skip to content

Commit

Permalink
Remove the ability to set drush version, use pantheon.yml instead
Browse files Browse the repository at this point in the history
  • Loading branch information
marktheunissen committed Sep 13, 2016
1 parent d57ad1e commit 7ee218e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 84 deletions.
12 changes: 0 additions & 12 deletions docs/Models/Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,6 @@

---

### setDrushVersion
##### Description:
Sets the Drush version to the indicated version number

##### Parameters:
[string] $version_number Version of Drush to use

##### Return:
[Workflow]

---

### setHttpsCertificate
##### Description:
Add/replace an HTTPS certificate on the environment
Expand Down
43 changes: 0 additions & 43 deletions php/Terminus/Commands/SiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -1630,49 +1630,6 @@ public function setConnectionMode($args, $assoc_args) {
return true;
}

/**
* Set the version of Drush to be used on a specific environment or site
*
* [--site=<site>]
* : The name of your site on Pantheon
*
* [--env=<environment>]
* : The Pantheon environment to change the Drush version of.
* Note: Leaving this blank will change the versions on all environments.
*
* [--version=<version>]
* : Drush version to use. Options are 5, 7, and 8.
*
* @subcommand set-drush-version
*/
public function setDrushVersion($args, $assoc_args) {
$sites = new Sites();
$site = $sites->get($this->input()->siteName(['args' => $assoc_args,]));
if (isset($assoc_args['env'])) {
$environments = [$site->environments->get($assoc_args['env']),];
} else {
$environments = $site->environments->all();
}
$version = $this->input()->menu(
[
'args' => $assoc_args,
'choices' => [5, 7, 8,],
'key' => 'version',
'message' => 'Select which Drush version to use',
'required' => true,
'return_value' => true,
]
);
foreach ($environments as $environment) {
$workflow = $environment->setDrushVersion((integer)$version);
$this->log()->info(
"Set {environment}'s Drush version to {version}, converging bindings.'",
['environment' => $environment->id, 'version' => $version,]
);
$workflow->wait();
}
}

/**
* Add/replace an HTTPS certificate for an environment
*
Expand Down
29 changes: 0 additions & 29 deletions php/Terminus/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,18 +664,6 @@ public function mergeToDev($options = []) {
return $workflow;
}

/**
* Sets the Drush version to the indicated version number
*
* @param string $version_number Version of Drush to use
* @return Workflow
*/
public function setDrushVersion($version_number) {
$this->updateSetting(['drush_version' => $version_number,]);
$workflow = $this->convergeBindings();
return $workflow;
}

/**
* Add/replace an HTTPS certificate on the environment
*
Expand Down Expand Up @@ -775,21 +763,4 @@ private function getSettings($setting = null) {

}

/**
* Changes the environment's settings
*
* @param array $settings Key/value pairs to set in the environment settings
* @return bool
*/
private function updateSetting(array $settings = []) {
$path = sprintf(
'sites/%s/environments/%s/settings',
$this->site->id,
$this->id
);
$params = ['form_params' => $settings, 'method' => 'put',];
$response = $this->request->request($path, $params);
return (boolean)$response['data'];
}

}

0 comments on commit 7ee218e

Please sign in to comment.