@param string $remote

@return mixed

@throws \Exception
499348
public function getPrivileges(string $remote)
    {
        $url = $this->base_url.'/privileges?'.http_build_query(['remote' => $remote]);

        return $this->curl->get($url);
    }
843695
protected function getRemoteJsonData($remoteUrl, $options) {
    // This is expensive, reason why we process and store in cache
    if (empty($remoteUrl)){
      // No need to alarm. all good. If not URL just return.
      return [];
    }
    if (!UrlHelper::isValid($remoteUrl, $absolute = TRUE)) {
      $this->messenger->addError(
        $this->t('We can not fetch Data from @$remoteUrl, check your URL',
          ['@$remoteUrl' =>  $remoteUrl]
        )
      );
      return [];
    }


    try {
      $request = $this->httpClient->get($remoteUrl, $options);
    }
    catch(ClientException $exception) {
      $responseMessage = $exception->getMessage();
      $this->messenger->addError(
        $this->t('We tried to contact @url but we could not. <br> The WEB says: @response. <br> Check that URL!',
          [
            '@url' => $remoteUrl,
            '@response' => $responseMessage
          ]
        )
      );
      return [];
    }
    $body = $request->getBody()->getContents();
    return $body;
  }
50348
public function putFile($local, $remote)
    {
        return ftp_put($this->connection, $remote, $local, $this->getTransferenceEncoding($local));
    }
1062159
public function get($local, $remote, $mode = FTP_BINARY)
    {
        return ($this->isConnected() === true) ? ftp_get($this->getConnection(), $local, $remote, $mode) : false;
    }
1224146
function GetLastModifiedDate($remotepath) 
	{
		$curl = curl_init($remotepath);
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ET_Util::shouldVerifySslPeer($this->sslVerifyPeer));
		curl_setopt($curl, CURLOPT_NOBODY, true);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($curl, CURLOPT_FILETIME, true);

		if (!empty($this->proxyHost)) {
			curl_setopt($curl, CURLOPT_PROXY, $this->proxyHost);
		}
		if (!empty($this->proxyPort)) {
			curl_setopt($curl, CURLOPT_PROXYPORT, $this->proxyPort);
		}
		if (!empty($this->proxyUserName) && !empty($this->proxyPassword)) {
			curl_setopt($curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
			curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxyUserName.':'.$this->proxyPassword);
		}

		$result = curl_exec($curl);
		
		if ($result === false) {
			throw new Exception(curl_error($curl)); 
		}
		
		return curl_getinfo($curl, CURLINFO_FILETIME);
	}
454280
public function setRemoteDataUrl(string $remoteDataUrl): void
    {
        if (empty($remoteDataUrl)) {
            throw new Exception('the parameter $remoteDataUrl can not be empty', Exception::DATA_URL_MISSING);
        }

        $this->remoteDataUrl = $remoteDataUrl;
    }
687435
public static function getRepositoryByUrl($url)
	{
		$remoteRepos = self::_getRemoteRepositories();
		foreach ($remoteRepos as $repo)
		{
			$config = $repo->getRepoConfig();
			if ($config['url'] == $url)
			{
				return $repo;
			}
		}
		return null;
	}
27314
public function setRemoteVersionUrl(string $remoteVerUrl): void
    {
        if (empty($remoteVerUrl)) {
            throw new Exception('the parameter $remoteVerUrl can not be empty', Exception::VERSION_URL_MISSING);
        }

        $this->remoteVersionUrl = $remoteVerUrl;
    }
1317806
public static function get($key)
		{
			self::_cleanPrevious();

			if(!isset($_SESSION[self::$_sessionKey.$key]) && self::$_defaultReturn=="ST__EXCEPTION")
			{
				throw new \Exception("Message with key: ".$key." doesn't exist",404);
			}

			$message = isset($_SESSION[self::$_sessionKey.$key]) ? $_SESSION[self::$_sessionKey.$key] : null;
			if(isset($message[2]['readOnce']) && $message[2]['readOnce'])
			{
				self::remove($key);
			}

			return $message ? $message[1] : self::$_defaultReturn;
		}
373328
public function exec($cmd)
    {
        
        if ($this->jumphost) {
            $cmd = "ssh " . $this->jumphost . " " . $cmd;
        }
        
        if ( ! ($stream = ssh2_exec($this->connection, $cmd))) {
            throw new \Exception('SSH command failed');
        }
        stream_set_blocking($stream, true);
        $data = "";
        while ($buf = fread($stream, 4096)) {
            $data .= $buf;
        }
        fclose($stream);
        
        return $data;
    }
67061
protected static function simpleMerge(string $base, string $remote, string $local)
    {
        // Skip complex merging if there is nothing to do.
        if ($base == $remote) {
            return $local;
        }
        if ($base == $local) {
            return $remote;
        }
        if ($remote == $local) {
            return $remote;
        }
        // Return nothing and let sub-classes deal with it.
        return null;
    }
1049638
public function get($key)
    {
        if (!$this->has($key)) {
            throw new Exception(sprintf(Exception::SETTING_KEY_NOT_EXISTS, $key));
        }

        return $this->getCachedSettings()->offsetGet($key);
    }
901108
public function pull($remote = null, $branch = null, $rebase = false)
    {
        if ($remote instanceof Remote) {
            $remote = $remote->getName();
        }
        if ($branch instanceof Branch) {
            $branch = $branch->getName();
        }
        $this->clearAll();
        $this->addCommandName(self::GIT_PULL_COMMAND);
        if ($rebase) {
            $this->addCommandArgument('--rebase');
        }
        if (!is_null($remote)) {
            $this->addCommandSubject($remote);
        }
        if (!is_null($branch)) {
            $this->addCommandSubject2($branch);
        }

        return $this->getCommand();
    }
755793
public function getBasicTagDataByRemoteId($remoteId)
    {
        $query = $this->handler->createSelectQuery();
        $query
            ->select('*')
            ->from($this->handler->quoteTable('eztags'))
            ->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('remote_id'),
                    $query->bindValue($remoteId, null, PDO::PARAM_STR)
                )
            );

        $statement = $query->prepare();
        $statement->execute();

        if ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
            return $row;
        }

        throw new NotFoundException('tag', $remoteId);
    }
463874
public function options($options = [])
    {
        // remote options
        if (is_string($options)) {
            return $this->loadRemoteOptions(...func_get_args());
        }

        if ($options instanceof Arrayable) {
            $options = $options->toArray();
        }

        if (is_callable($options)) {
            $this->options = $options;
        } else {
            $this->options = (array) $options;
        }

        return $this;
    }
1045010
public function push($remote = 'origin')
    {
        if (!$this->hasCheckout) {
            throw new \RuntimeException('This operation requires an active checkout.');
        }

        try {
            return $this->execute('push', array('--porcelain' => true, $remote));
        } catch (\RuntimeException $e) {
            // ignore output on stderr: it contains
            // progress information, for example about hooks
        }

        return null;
    }
1110071
public function fetch($remote = null)
    {
        if ($this->isFetched) {
            return false;
        }

        if (!$this->hasClone) {
            $this->checkout();
        }

        $args = array();
        if (null !== $remote) {
            $args[] = $remote;
        }

        $this->execute('fetch', $args);

        $this->isFetched = true;

        return true;
    }