Class to store and retrieve the version of Zend Framework.

package Default

 Methods

Compare the specified Zend Framework version string $version with the current Zend\Version\Version::VERSION of Zend Framework.

compareVersion(string $version) : integer
Static

Parameters

$version

string

A version string (e.g. "0.7.1").

Returns

integer-1 if the $version is older, 0 if they are the same, and +1 if $version is newer.

Fetches the version of the latest stable release.

getLatest(string $service = self::VERSION_SERVICE_ZEND, \Zend\Http\Client $httpClient = null) : string
Static

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
link https://api.github.com/repos/zendframework/zf2/git/refs/tags/release-
link http://framework.zend.com/api/zf-version?v=2

Parameters

$service

string

Version service with which to retrieve the version

$httpClient

\Zend\Http\Client

HTTP client with which to retrieve the version

Returns

string

Returns true if the running version of Zend Framework is the latest (or newer??) than the latest tag on GitHub, which is returned by self::getLatest().

isLatest() : boolean
Static

Returns

boolean

Get the API response to a call from a configured HTTP client

getApiResponse(\Zend\Http\Client $httpClient) : string | false
Static

Parameters

$httpClient

\Zend\Http\Client

Configured HTTP client

Returns

stringfalseAPI response or false on error

Get the latest version from Github

getLatestFromGithub(\Zend\Http\Client $httpClient = null) : string | null
Static

Parameters

$httpClient

\Zend\Http\Client

Configured HTTP client

Returns

stringnullAPI response or false on error

Get the latest version from framework.zend.com

getLatestFromZend(\Zend\Http\Client $httpClient = null) : string | null
Static

Parameters

$httpClient

\Zend\Http\Client

Configured HTTP client

Returns

stringnullAPI response or false on error

 Properties

 

The latest stable version Zend Framework available

$latestVersion : string

Default

Static

 Constants

 

Zend Framework version identification - see compareVersion()

VERSION = '2.4.9' 
 

Github Service Identifier for version information is retrieved from

VERSION_SERVICE_GITHUB = 'GITHUB' 
 

Zend (framework.zend.com) Service Identifier for version information is retrieved from

VERSION_SERVICE_ZEND = 'ZEND'