Skip to content

Commit

Permalink
Merge pull request #1147 from pantheon-systems/remove/site_set-php-ve…
Browse files Browse the repository at this point in the history
…rsion

AL-341 - Removed site set-php-version command
  • Loading branch information
TeslaDethray authored Aug 24, 2016
2 parents 55283bd + 318156d commit 02d543d
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 887 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project starting with the 0.6.0 release will be docu
## MASTER
### Removed
- `cli cache-clear` command. (#1152)
- The command `site set-php-version` has been removed. Please set your PHP version by your pantheon.yml file. (See: https://pantheon.io/docs/php-versions) (#1121)

## [0.11.4] - 2016-08-10
### Added
Expand Down
48 changes: 0 additions & 48 deletions php/Terminus/Commands/SiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -1834,54 +1834,6 @@ public function setOwner($args, $assoc_args) {
$this->workflowOutput($workflow);
}

/**
* Set the site's or environment's PHP version
*
* ## OPTIONS
*
* [--site=<site>]
* : Site to set the PHP version on.
*
* [--env=<env>]
* : Environment to set the PHP version on. Leave this out to set only the
* site's version.
*
* [--version=<php-version>]
* : The PHP version to set the site or environment to. Options are 7.0, 5.6,
* 5.5, and 5.3.
*
* @subcommand set-php-version
*/
public function setPhpVersion($args, $assoc_args) {
$params = ['args' => $assoc_args,];
$site = $this->sites->get($this->input()->siteName($params));

if (isset($assoc_args['env'])) {
$env = $site->environments->get($assoc_args['env']);
$params['choices'] = [
'default' => 'default',
53 => '5.3',
55 => '5.5',
56 => '5.6',
70 => '7.0',
];
$version = $this->input()->phpVersion($params);
if ($version != 'default') {
$workflow = $env->setPhpVersion($version);
} else {
$workflow = $env->unsetPhpVersion();
}
$workflow->wait();
$this->workflowOutput($workflow);
} else {
$version = $this->input()->phpVersion($params);
$workflow = $site->setPhpVersion($version);
$workflow->wait();
$this->workflowOutput($workflow);
$site->fetchAttributes();
}
}

/**
* Set the site's service level
*
Expand Down
39 changes: 0 additions & 39 deletions php/Terminus/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -721,28 +721,6 @@ function ($param) {
return $workflow;
}

/**
* Sets the PHP version number of this environment
*
* @param string $version_number The version number to set this environment to
* use
* @return void
*/
public function setPhpVersion($version_number) {
$options = [
'environment' => $this->get('id'),
'params' => [
'key' => 'php_version',
'value' => $version_number,
],
];
$workflow = $this->site->workflows->create(
'update_environment_setting',
$options
);
return $workflow;
}

/**
* Disable HTTP Basic Access authentication on the web environment
*
Expand All @@ -754,23 +732,6 @@ public function unlock() {
return $workflow;
}

/**
* Unsets the PHP version of this environment so it will use the site default
*
* @return void
*/
public function unsetPhpVersion() {
$options = [
'environment' => $this->get('id'),
'params' => ['key' => 'php_version',],
];
$workflow = $this->site->workflows->create(
'delete_environment_setting',
$options
);
return $workflow;
}

/**
* "Wake" a site
*
Expand Down
14 changes: 0 additions & 14 deletions php/Terminus/Models/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,20 +595,6 @@ public function setOwner($owner = null) {
return $workflow;
}

/**
* Sets the PHP version number of this site
*
* @param string $version_number The version number to set this site to use
* @return void
*/
public function setPhpVersion($version_number) {
$options = [
'params' => ['key' => 'php_version', 'value' => $version_number,],
];
$workflow = $this->workflows->create('update_site_setting', $options);
return $workflow;
}

/**
* Update service level
*
Expand Down
26 changes: 0 additions & 26 deletions tests/features/site_set-php-version.feature

This file was deleted.

Loading

0 comments on commit 02d543d

Please sign in to comment.