CommunityID/libs/Zend/Version.php

54 lines
1.8 KiB
PHP
Raw Normal View History

2019-07-17 20:08:50 +00:00
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Version
2019-07-17 20:19:00 +00:00
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
2019-07-17 20:08:50 +00:00
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Version.php 19195 2009-11-23 16:24:58Z matthew $
2019-07-17 20:08:50 +00:00
*/
/**
* Class to store and retrieve the version of Zend Framework.
*
* @category Zend
* @package Zend_Version
2019-07-17 20:19:00 +00:00
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
2019-07-17 20:08:50 +00:00
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
final class Zend_Version
{
/**
* Zend Framework version identification - see compareVersion()
*/
const VERSION = '1.9.6';
2019-07-17 20:08:50 +00:00
/**
* Compare the specified Zend Framework version string $version
2019-07-17 20:16:19 +00:00
* with the current Zend_Version::VERSION of Zend Framework.
2019-07-17 20:08:50 +00:00
*
* @param string $version A version string (e.g. "0.7.1").
* @return boolean -1 if the $version is older,
* 0 if they are the same,
* and +1 if $version is newer.
*
*/
public static function compareVersion($version)
{
$version = strtolower($version);
$version = preg_replace('/(\d)pr(\d?)/', '$1a$2', $version);
return version_compare($version, strtolower(self::VERSION));
2019-07-17 20:08:50 +00:00
}
}