public function getPackageVersions($packageHandle)
    {
        $this->start();
        try {
            $this->getUserControl()->checkRateLimit();
            $this->getUserControl()->checkGenericAccess(__FUNCTION__);
            $package = $this->app->make(PackageRepository::class)->findOneBy(['handle' => $packageHandle]);
            if ($package === null) {
                throw new UserMessageException(t('Unable to find the specified package'), Response::HTTP_NOT_FOUND);
            }
            $versions = [];
            foreach ($package->getSortedVersions(true, null) as $packageVersion) {
                $versions[] = $packageVersion->getVersion();
            }
            $result = $this->buildJsonResponse($versions);
        } catch (Exception $x) {
            $result = $this->buildErrorResponse($x);
        } catch (Throwable $x) {
            $result = $this->buildErrorResponse($x);
        }

        return $this->finish($result);
    }
public function getPackageVersions($packageHandle)
    {
        $this->start();
        try {
            $this->getUserControl()->checkRateLimit();
            $this->getUserControl()->checkGenericAccess(__FUNCTION__);
            $package = $this->app->make(PackageRepository::class)->findOneBy(['handle' => $packageHandle]);
            if ($package === null) {
                throw new UserMessageException(t('Unable to find the specified package'), Response::HTTP_NOT_FOUND);
            }
            $versions = [];
            foreach ($package->getSortedVersions(true, null) as $packageVersion) {
                $versions[] = $packageVersion->getVersion();
            }
            $result = $this->buildJsonResponse($versions);
        } catch (Exception $x) {
            $result = $this->buildErrorResponse($x);
        } catch (Throwable $x) {
            $result = $this->buildErrorResponse($x);
        }

        return $this->finish($result);
    }
public function getPackageVersions ( $ packageHandle ) { $ this -> start ( ) ; try { $ this -> getUserControl ( ) -> checkRateLimit ( ) ; $ this -> getUserControl ( ) -> checkGenericAccess ( __FUNCTION__ ) ; $ package = $ this -> app -> make ( PackageRepository :: class ) -> findOneBy ( [ 'handle' => $ packageHandle ] ) ; if ( $ package === null ) { throw new UserMessageException ( t ( 'Unable to find the specified package' ) , Response :: HTTP_NOT_FOUND ) ; } $ versions = [ ] ; foreach ( $ package -> getSortedVersions ( true , null ) as $ packageVersion ) { $ versions [ ] = $ packageVersion -> getVersion ( ) ; } $ result = $ this -> buildJsonResponse ( $ versions ) ; } catch ( Exception $ x ) { $ result = $ this -> buildErrorResponse ( $ x ) ; } catch ( Throwable $ x ) { $ result = $ this -> buildErrorResponse ( $ x ) ; } return $ this -> finish ( $ result ) ; }
Get the list of versions of a package.


@param string $packageHandle

@return Response

@example http://www.example.com/api/package/concrete5/versions/
Get the list of versions of a package .