protected function getPackageReleases()
    {
        if (empty($url = $this->config['repository_url'])) {
            throw new \Exception('No repository specified. Please enter a valid URL in your config.');
        }

        $format = str_replace('_VERSION_', '\d+\.\d+\.\d+',
                    str_replace('.', '\.', $this->config['pkg_filename_format'])
                  ).'.zip';
        $count = preg_match_all(
            "/<a.*href=\".*$format\">($format)<\/a>/i",
            $this->client->get($url)->getBody()->getContents(),
            $files);
        $collection = [];
        $url = preg_replace('/\/$/', '', $url);
        for ($i = 0; $i < $count; $i++) {
            $basename = preg_replace("/^$this->prepend/", '',
                          preg_replace("/$this->append$/", '',
                            preg_replace('/.zip$/', '', $files[1][$i])
                        ));
            array_push($collection, (object) [
                'name' => $basename,
                'zipball_url' => $url.'/'.$files[1][$i],
            ]);
        }
        // Sort collection alphabetically descending to have newest package as first
        array_multisort($collection, SORT_DESC);

        return new Collection($collection);
    }
protected function getPackageReleases()
    {
        if (empty($url = $this->config['repository_url'])) {
            throw new \Exception('No repository specified. Please enter a valid URL in your config.');
        }

        $format = str_replace('_VERSION_', '\d+\.\d+\.\d+',
                    str_replace('.', '\.', $this->config['pkg_filename_format'])
                  ).'.zip';
        $count = preg_match_all(
            "/<a.*href=\".*$format\">($format)<\/a>/i",
            $this->client->get($url)->getBody()->getContents(),
            $files);
        $collection = [];
        $url = preg_replace('/\/$/', '', $url);
        for ($i = 0; $i < $count; $i++) {
            $basename = preg_replace("/^$this->prepend/", '',
                          preg_replace("/$this->append$/", '',
                            preg_replace('/.zip$/', '', $files[1][$i])
                        ));
            array_push($collection, (object) [
                'name' => $basename,
                'zipball_url' => $url.'/'.$files[1][$i],
            ]);
        }
        // Sort collection alphabetically descending to have newest package as first
        array_multisort($collection, SORT_DESC);

        return new Collection($collection);
    }
protected function getPackageReleases ( ) { if ( empty ( $ url = $ this -> config [ 'repository_url' ] ) ) { throw new \ Exception ( 'No repository specified. Please enter a valid URL in your config.' ) ; } $ format = str_replace ( '_VERSION_' , '\d+\.\d+\.\d+' , str_replace ( '.' , '\.' , $ this -> config [ 'pkg_filename_format' ] ) ) . '.zip' ; $ count = preg_match_all ( "/<a.*href=\".*$format\">($format)<\/a>/i" , $ this -> client -> get ( $ url ) -> getBody ( ) -> getContents ( ) , $ files ) ; $ collection = [ ] ; $ url = preg_replace ( '/\/$/' , '' , $ url ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ basename = preg_replace ( "/^$this->prepend/" , '' , preg_replace ( "/$this->append$/" , '' , preg_replace ( '/.zip$/' , '' , $ files [ 1 ] [ $ i ] ) ) ) ; array_push ( $ collection , ( object ) [ 'name' => $ basename , 'zipball_url' => $ url . '/' . $ files [ 1 ] [ $ i ] , ] ) ; } // Sort collection alphabetically descending to have newest package as first array_multisort ( $ collection , SORT_DESC ) ; return new Collection ( $ collection ) ; }
Retrieve html body with list of all releases from archive URL.

@throws \Exception

@return mixed|\Psr\Http\Message\ResponseInterface
Retrieve html body with list of all releases from archive URL .