web/lib/Zend/Version.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Version
    16  * @package    Zend_Version
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Version.php 23455 2010-11-29 16:24:55Z matthew $
    19  * @version    $Id: Version.php 25289 2013-03-13 16:51:14Z matthew $
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * Class to store and retrieve the version of Zend Framework.
    23  * Class to store and retrieve the version of Zend Framework.
    24  *
    24  *
    25  * @category   Zend
    25  * @category   Zend
    26  * @package    Zend_Version
    26  * @package    Zend_Version
    27  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    27  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    28  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    28  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    29  */
    29  */
    30 final class Zend_Version
    30 final class Zend_Version
    31 {
    31 {
    32     /**
    32     /**
    33      * Zend Framework version identification - see compareVersion()
    33      * Zend Framework version identification - see compareVersion()
    34      */
    34      */
    35     const VERSION = '1.11.1';
    35     const VERSION = '1.12.3';
    36 
    36 
    37     /**
    37     /**
    38      * The latest stable version Zend Framework available
    38      * The latest stable version Zend Framework available
    39      * 
    39      *
    40      * @var string
    40      * @var string
    41      */
    41      */
    42     protected static $_lastestVersion;
    42     protected static $_latestVersion;
    43 
    43 
    44     /**
    44     /**
    45      * Compare the specified Zend Framework version string $version
    45      * Compare the specified Zend Framework version string $version
    46      * with the current Zend_Version::VERSION of Zend Framework.
    46      * with the current Zend_Version::VERSION of Zend Framework.
    47      *
    47      *
    58         return version_compare($version, strtolower(self::VERSION));
    58         return version_compare($version, strtolower(self::VERSION));
    59     }
    59     }
    60 
    60 
    61     /**
    61     /**
    62      * Fetches the version of the latest stable release
    62      * Fetches the version of the latest stable release
    63      * 
    63      *
    64      * @link http://framework.zend.com/download/latest
    64      * @link http://framework.zend.com/download/latest
    65      * @return string
    65      * @return string
    66      */
    66      */
    67     public static function getLatest()
    67     public static function getLatest()
    68     {
    68     {
    69         if (null === self::$_lastestVersion) {
    69         if (null === self::$_latestVersion) {
    70             self::$_lastestVersion = 'not available';
    70             self::$_latestVersion = 'not available';
    71 
    71 
    72             $handle = fopen('http://framework.zend.com/api/zf-version', 'r');        
    72             $handle = fopen('http://framework.zend.com/api/zf-version', 'r');
    73             if (false !== $handle) {
    73             if (false !== $handle) {
    74                 self::$_lastestVersion = stream_get_contents($handle);
    74                 self::$_latestVersion = stream_get_contents($handle);
    75                 fclose($handle);
    75                 fclose($handle);
    76             }
    76             }
    77         }
    77         }
    78 
    78 
    79         return self::$_lastestVersion;
    79         return self::$_latestVersion;
    80     }
    80     }
    81 }
    81 }