<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($xKPGr, $VEY5l) { goto mnd5D; bOpPP: return version_compare($xKPGr, $VEY5l, $EuyzD); goto vvxwd; KzD1j: $Nh6Qg = array('>=', '<=', '==', '>', '<'); goto HlaKJ; mnd5D: if ('*' == $VEY5l) { return true; } goto KzD1j; cRBSs: foreach ($Nh6Qg as $Esk0p) { if (starts_with($VEY5l, $Esk0p)) { goto Y8FBz; cd2fW: break; goto F62QQ; Y8FBz: $EuyzD = $Esk0p; goto wOscD; wOscD: $VEY5l = substr($VEY5l, strlen($Esk0p)); goto cd2fW; F62QQ: } } goto bOpPP; HlaKJ: $EuyzD = '=='; goto cRBSs; vvxwd: } public static function parse($wjtYc) { goto NaXDc; iScXG: return array($q26cr[0], $q26cr[1]); goto aCHp_; NaXDc: $q26cr = explode(':', $wjtYc); goto ntorP; ntorP: if (count($q26cr) == 1) { return array($q26cr[0], '*'); } goto iScXG; aCHp_: } public static function isVersion($sMmNC) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $sMmNC) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $sMmNC) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $sMmNC); } }