public function __construct($server)
{
if (!isset($server['scheme'])) {
throw new \Exception("Please provide a connection protocol such as 'ftp' or 'sftp'.");
}
if ($server['scheme'] === 'ftp' or $server['scheme'] === 'ftps') {
$this->server = $this->connectToFtp($server);
} elseif ($server['scheme'] === 'sftp') {
$this->server = $this->connectToSftp($server);
} else {
throw new \Exception("Please provide a known connection protocol such as 'ftp' or 'sftp'.");
}
}