<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($srIbg, $IS6md) { goto Mh8iA; Mh8iA: if ('*' == $IS6md) { return true; } goto dtUdM; dtUdM: $tdk7y = array('>=', '<=', '==', '>', '<'); goto kOXei; kOXei: $Iexxy = '=='; goto DLG9j; DLG9j: foreach ($tdk7y as $V563N) { if (starts_with($IS6md, $V563N)) { goto GoBYM; GoBYM: $Iexxy = $V563N; goto E9y1w; DqZR1: break; goto sTQj2; E9y1w: $IS6md = substr($IS6md, strlen($V563N)); goto DqZR1; sTQj2: } } goto Wtn2u; Wtn2u: return version_compare($srIbg, $IS6md, $Iexxy); goto eiScg; eiScg: } public static function parse($ShTGe) { goto TbdL0; TbdL0: $FSrde = explode(':', $ShTGe); goto yUtpV; yUtpV: if (count($FSrde) == 1) { return array($FSrde[0], '*'); } goto Wci87; Wci87: return array($FSrde[0], $FSrde[1]); goto q163c; q163c: } public static function isVersion($WLq_n) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $WLq_n) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $WLq_n) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $WLq_n); } }