1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.version.reading">
<title>Getting the Zend Framework Version</title>
<para>
<classname>Zend_Version</classname> provides a class constant
<constant>Zend_Version::VERSION</constant> that contains a string
identifying the version number of your Zend Framework installation.
<constant>Zend_Version::VERSION</constant> might contain "1.7.4", for example.
</para>
<para>
The static method <methodname>Zend_Version::compareVersion($version)</methodname>
is based on the <acronym>PHP</acronym> function <ulink
url="http://php.net/version_compare"><methodname>version_compare()</methodname></ulink>.
This method returns -1 if the specified version
is older than the installed Zend Framework version, 0 if they are the same
and +1 if the specified version is newer than the
version of the Zend Framework installation.
</para>
<example id="zend.version.reading.example">
<title>Example of the compareVersion() Method</title>
<programlisting language="php"><![CDATA[
// returns -1, 0 or 1
$cmp = Zend_Version::compareVersion('2.0.0');
]]></programlisting>
</example>
<para>
The static method <methodname>Zend_Version::getLatest()</methodname> provides the version
number of the last stable release available for download on the site
<ulink url="http://framework.zend.com/download/latest">Zend Framework</ulink>.
</para>
<example id="zend.version.latest.example">
<title>Example of the getLatest() Method</title>
<programlisting language="php"><![CDATA[
// returns 1.11.0 (or a later version)
echo Zend_Version::getLatest();
]]></programlisting>
</example>
</sect1>
<!--
vim:se ts=4 sw=4 et:
-->
|