protected function getContents($url, $fetchingRepoData = false)
    {
        $url = $this->getValidContentUrl($url);

        if (null !== $this->redirectApi) {
            return parent::getContents($url, $fetchingRepoData);
        }

        try {
            $contents = $this->getRemoteContents($url);
            $this->redirectApi = false;

            return $contents;
        } catch (TransportException $e) {
            if ($this->hasRedirectUrl($url)) {
                $url = $this->getValidContentUrl($url);
            }

            return parent::getContents($url, $fetchingRepoData);
        }
    }
protected function getContents($url, $fetchingRepoData = false)
    {
        $url = $this->getValidContentUrl($url);

        if (null !== $this->redirectApi) {
            return parent::getContents($url, $fetchingRepoData);
        }

        try {
            $contents = $this->getRemoteContents($url);
            $this->redirectApi = false;

            return $contents;
        } catch (TransportException $e) {
            if ($this->hasRedirectUrl($url)) {
                $url = $this->getValidContentUrl($url);
            }

            return parent::getContents($url, $fetchingRepoData);
        }
    }
protected function getContents ( $ url , $ fetchingRepoData = false ) { $ url = $ this -> getValidContentUrl ( $ url ) ; if ( null !== $ this -> redirectApi ) { return parent :: getContents ( $ url , $ fetchingRepoData ) ; } try { $ contents = $ this -> getRemoteContents ( $ url ) ; $ this -> redirectApi = false ; return $ contents ; } catch ( TransportException $ e ) { if ( $ this -> hasRedirectUrl ( $ url ) ) { $ url = $ this -> getValidContentUrl ( $ url ) ; } return parent :: getContents ( $ url , $ fetchingRepoData ) ; } }
Get the remote content.

@param string $url              The URL of content
@param bool   $fetchingRepoData Fetching the repo data or not

@return mixed The result
Get the remote content .