Change web domain.

@param $domain
@param $ftpUserName
@param $ftpPath

@return mixed
490755
public function changeWebDomain($domain, $ftpUserName, $ftpPath)
    {
        return $this->send('v-change-web-domain-ftp-path', $this->userName, $domain, $ftpUserName,
            $ftpPath);
    }
418297
public function listEditWebDomain($domain)
    {
        $this->returnCode = 'no';
        $answer = $this->send('v-list-web-domain', $this->userName, $domain, 'json');

        $data = json_decode($answer, true);

        $ftpU = strpos($data[$domain]['FTP_USER'], ':');
        $ftpPath = strpos($data[$domain]['FTP_PATH'], ':');

        if ($ftpU !== false) {
            $ftAr = explode(':', $data[$domain]['FTP_USER']);
            $data[$domain]['FTP_USER'] = $ftAr;
        }
        if ($ftpPath !== false) {
            $ftpP = explode(':', $data[$domain]['FTP_PATH']);
            $data[$domain]['FTP_PATH'] = $ftpP;
        }

        return $data;
    }
1149642
public function removeGithubOAuthToken($domain = 'github.com')
    {
        $this->remove(self::GITHUB_OAUTH_KEY . '/' . $this->escape($domain));

        return $this;
    }
515551
public function setDomain($domain)
    {
        if (mb_strpos($domain, ':') !== false) {
            throw new InvalidArgumentException(sprintf('Cookie domain "%s" should not contain a port', $domain));
        }

        $this->cookie['domain'] = $domain;
    }
626961
public function setDomain($domain)
    {
        if (is_string($domain)) {
            $this->domain = $domain;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($domain) . "' for argument 'domain' given. String expected."
            );
        }
    }
662648
public function removeDomain($domain)
    {
        if (isset($this->domains[$domain])) {
            unset($this->domains[$domain]);
        }

        return $this;
    }
1183902
public static function create($domain, $whois)
    {
        $tld = substr(strrchr($domain, '.'), 1);
        $parserClass = 'Wisdom\\Whois\\Parser\\Tld\\'.ucfirst($tld);
        if (!class_exists($parserClass)) {
            throw new WhoisParserNotFoundException(sprintf(
                'Whois parser for .%s domains not found.',
                $tld
            ));
        }

        return new $parserClass($domain, $whois);
    }
1153331
public static function isDomain($domain)
    {
        if (!is_string($domain)) {
            throw new \ErrorException('Accept string ' . gettype($domain) . ' given');
        }

        return  (bool) preg_match(
            '/^((https?|ftps?|ssl|url|git):\/\/)?[a-zA-Z0-9-_.]+\.[a-z]{2,6}$/',
            $domain
        );
    }
145344
public function allowOrigin($domain = '*', $replace = false)
    {
        $domain = implode(' ', (array) $domain);

        if ($replace) {
            $this->response = $this->response->withHeader('Access-Control-Allow-Origin', $domain);
        } else {
            $this->response = $this->response->withAddedHeader('Access-Control-Allow-Origin', $domain);
        }

        return $this;
    }
48408
public function addDNSDomain($domain, $ip, $ns1, $ns2, $ns3 = null, $ns4 = null)
    {
        return $this->send('v-add-dns-domain', $this->userName, $domain, $ip, $ns1, $ns2, $ns3,
            $ns4, 'no');
    }
489049
public function replaceSubDomain ($replacement, $protocol = null, $domain_name = null) {
		$domain_name = $domain_name !== null ? $domain_name : $_SERVER['HTTP_HOST'];

		if (preg_match("@^https?://@", $domain_name, $match) !== false) {
			$domain_name = str_replace($match[1], '', $domain_name);
		} else {
			preg_match("@^https?://@", $_SERVER['HTTP_HOST'], $match);
		}
		$protocol = $protocol !== null ? $protocol . '://' : $match[1];

		$domain = explode('.', $domain_name);
		$length = count($domain);

		$offset = in_array($domain[$length - 1], [
			'co',
			'or',
			'ne',
			'ac',
			'ad',
			'ed',
			'go',
			'gr',
			'lg',
		], true) ? 3 : 2;

		return sprintf('%s%s.%s', $protocol, $replacement, implode('.', array_slice($domain, $length - $offset, $length)));
	}
509813
public function siteIconUrl($domain) {
		if (strpos($domain, 'http') === 0) {
			// Strip protocol
			$pieces = parse_url($domain);
			$domain = $pieces['host'];
		}
		return 'http://www.google.com/s2/favicons?domain=' . $domain;
	}
220565
protected function stripProtocol($domain)
    {
        if (Str::contains($domain, '://')) {
            $domain = \substr($domain, \strpos($domain, '://') + 3);
        }

        return $domain;
    }
604289
public function rename($oldName, $newName)
    {
        if (! ftp_rename($this->session, $oldName, $newName)) {
            throw new \RuntimeException('Name can not be changed');
        }
        return true;
    }
1010194
public function rename($currentName, $newName)
    {
        $result = @ftp_rename($this->connection, $currentName, $newName);

        return $result;
    }
605762
public function setFtpPassword($domainName, $newPassword)
    {
        return $this->getSoapClient(array_merge(array($domainName, $newPassword), array('__method' => 'setFtpPassword')))->setFtpPassword($domainName, $newPassword);
    }
1043616
public function sslStart($domain, $ip = null, $token = null)
    {
        $headers = [
            'connect_timeout' => 60,
            'timeout' => 60,
            'debug' => false,
            'form_params' => [
                'domain' => $domain.':443',
                'show_test_results' => 'false',
                'recheck' => 'true',
                'verbosity' => '0'
            ]
        ];

        if ((! is_null($ip)) && (! is_null($token))) {
            $headers['form_params']['choosen_ip'] = $ip[0];
            $headers['form_params']['token'] = $token;
        }

        try {
            $response = $this->client->post('https://www.htbridge.com/ssl/api/v1/check/'.time().'.html', $headers);
            return json_decode($response->getBody()->getContents(), true);
        } catch (Exception $e) {
            app(Eye::class)->logger()->error('Unable to start SSL scan', $e, $domain);
        }

        return null;
    }