Pantheon\Terminus\Models\Environment::changeConnectionMode PHP Method

changeConnectionMode() public method

Changes connection mode
public changeConnectionMode ( string $value ) : Workflow | string
$value string Connection mode, "git" or "sftp"
return Workflow | string
    public function changeConnectionMode($value)
    {
        $current_mode = $this->serialize()['connection_mode'];
        if ($value == $current_mode) {
            $reply = "The connection mode is already set to {$value}.";
            return $reply;
        }
        switch ($value) {
            case 'git':
                $workflow_name = 'enable_git_mode';
                break;
            case 'sftp':
                $workflow_name = 'enable_on_server_development';
                break;
        }
        $workflow = $this->getWorkflows()->create($workflow_name);
        return $workflow;
    }