compareVersion()
getLatest()
isLatest()
getApiResponse()
getLatestFromGithub()
getLatestFromZend()
$latestVersion
VERSION
VERSION_SERVICE_GITHUB
VERSION_SERVICE_ZEND
Class to store and retrieve the version of Zend Framework.
compareVersion(string $version) : int
string
A version string (e.g. "0.7.1").
int
-1 if the $version is older, 0 if they are the same, and +1 if $version is newer.getLatest(string $service, \Zend\Http\Client $httpClient) : string
By default, this uses the API provided by framework.zend.com for version retrieval.
If $service is set to VERSION_SERVICE_GITHUB, this will use the GitHub API (v3) and only returns refs that begin with * 'tags/release-'. Because GitHub returns the refs in alphabetical order, we need to reduce the array to a single value, comparing the version numbers with version_compare().
see | \Zend\Version\http://developer.github.com/v3/git/refs/#get-all-references |
---|---|
link | https://api.github.com/repos/zendframework/zf2/git/refs/tags/release- |
link | http://framework.zend.com/api/zf-version?v=2 |
string
Version service with which to retrieve the version
string
isLatest() : bool
bool
getApiResponse(\Zend\Http\Client $httpClient) : string | false
string
false
API response or false on errorgetLatestFromGithub(\Zend\Http\Client $httpClient) : string | null
string
null
API response or false on errorgetLatestFromZend(\Zend\Http\Client $httpClient) : string | null
string
null
API response or false on error$latestVersion : string
VERSION
VERSION_SERVICE_GITHUB
VERSION_SERVICE_ZEND