<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($pWP8Q, $H4_TW) { goto K6h4E; K6h4E: if ('*' == $H4_TW) { return true; } goto kRd0A; SCiI2: return version_compare($pWP8Q, $H4_TW, $BJfDb); goto EVK3f; SGMBM: foreach ($jZ0pr as $P1uVJ) { if (starts_with($H4_TW, $P1uVJ)) { goto waObo; avNwY: break; goto SxaLL; vrfqm: $H4_TW = substr($H4_TW, strlen($P1uVJ)); goto avNwY; waObo: $BJfDb = $P1uVJ; goto vrfqm; SxaLL: } } goto SCiI2; WOlse: $BJfDb = '=='; goto SGMBM; kRd0A: $jZ0pr = array('>=', '<=', '==', '>', '<'); goto WOlse; EVK3f: } public static function parse($L0ytH) { goto Noqg2; mg7tC: return array($TsqdX[0], $TsqdX[1]); goto VV9zR; Noqg2: $TsqdX = explode(':', $L0ytH); goto gJofw; gJofw: if (count($TsqdX) == 1) { return array($TsqdX[0], '*'); } goto mg7tC; VV9zR: } public static function isVersion($W_oHC) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $W_oHC) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $W_oHC) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $W_oHC); } }