Zend_Version.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 24249 -->
  4. <sect1 id="zend.version.reading">
  5. <title>Zend Framework のバージョンの取得</title>
  6. <para>
  7. <classname>Zend_Version</classname> が提供するクラス定数
  8. <constant>Zend_Version::VERSION</constant> には、
  9. インストールされている Zend Framework のバージョン番号を表す文字列が含まれます。
  10. <constant>Zend_Version::VERSION</constant> は、たとえば "1.7.4" のようになります。
  11. </para>
  12. <para>
  13. 静的メソッド <methodname>Zend_Version::compareVersion($version)</methodname>
  14. は、<acronym>PHP</acronym> の関数 <ulink
  15. url="http://php.net/version_compare"><methodname>version_compare()</methodname></ulink>
  16. に基づいたものです。このメソッドは、指定したバージョンが
  17. Zend Framework のバージョンより古い場合に -1、
  18. 同じ場合に 0、そして指定したバージョンのほうが
  19. Zend Framework のバージョンより新しい場合に +1 を返します。
  20. </para>
  21. <example id="zend.version.reading.example">
  22. <title>compareVersion() メソッドの例</title>
  23. <programlisting language="php"><![CDATA[
  24. // -1、0 あるいは 1 を返します
  25. $cmp = Zend_Version::compareVersion('2.0.0');
  26. ]]></programlisting>
  27. </example>
  28. <!-- TODO : to be translated -->
  29. <para>
  30. The static method <methodname>Zend_Version::getLatest()</methodname> provides the version
  31. number of the last stable release available for download on the site
  32. <ulink url="http://framework.zend.com/download/latest">Zend Framework</ulink>.
  33. </para>
  34. <example id="zend.version.latest.example">
  35. <title>getLatest() メソッドの例</title>
  36. <programlisting language="php"><![CDATA[
  37. // 1.11.0 またはそれ以降のバージョンを返します
  38. echo Zend_Version::getLatest();
  39. ]]></programlisting>
  40. </example>
  41. </sect1>
  42. <!--
  43. vim:se ts=4 sw=4 et:
  44. -->