<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($u9DMa, $eaLQP) { goto MInWz; Cosia: return version_compare($u9DMa, $eaLQP, $wEIvo); goto VJifP; y4lBm: $a1dFJ = array('>=', '<=', '==', '>', '<'); goto IqQSP; IqQSP: $wEIvo = '=='; goto EEn8M; EEn8M: foreach ($a1dFJ as $Xvngd) { if (starts_with($eaLQP, $Xvngd)) { goto a3oIn; vXu_Z: break; goto iAYjj; a3oIn: $wEIvo = $Xvngd; goto on0Q1; on0Q1: $eaLQP = substr($eaLQP, strlen($Xvngd)); goto vXu_Z; iAYjj: } } goto Cosia; MInWz: if ('*' == $eaLQP) { return true; } goto y4lBm; VJifP: } public static function parse($quKjW) { goto O41TQ; O41TQ: $TDAzu = explode(':', $quKjW); goto uHaMf; Yokxc: return array($TDAzu[0], $TDAzu[1]); goto TP7im; uHaMf: if (count($TDAzu) == 1) { return array($TDAzu[0], '*'); } goto Yokxc; TP7im: } public static function isVersion($kY2Zg) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $kY2Zg) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $kY2Zg) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $kY2Zg); } }