Zend_Version.xml 1.8 KB

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