<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($eXpZC, $J_zTx) { goto L121c; TRytO: $ouDum = array('>=', '<=', '==', '>', '<'); goto asUoj; L121c: if ('*' == $J_zTx) { return true; } goto TRytO; NiQc7: return version_compare($eXpZC, $J_zTx, $iO4aK); goto WwxP3; MsP1U: foreach ($ouDum as $El_MH) { if (starts_with($J_zTx, $El_MH)) { goto m_COD; xFb73: $J_zTx = substr($J_zTx, strlen($El_MH)); goto b2tQB; b2tQB: break; goto ZJ9Cu; m_COD: $iO4aK = $El_MH; goto xFb73; ZJ9Cu: } } goto NiQc7; asUoj: $iO4aK = '=='; goto MsP1U; WwxP3: } public static function parse($dGPlE) { goto BjVkx; MvLZU: if (count($jT5GX) == 1) { return array($jT5GX[0], '*'); } goto TNm2h; BjVkx: $jT5GX = explode(':', $dGPlE); goto MvLZU; TNm2h: return array($jT5GX[0], $jT5GX[1]); goto xMb0t; xMb0t: } public static function isVersion($zYrJB) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $zYrJB) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $zYrJB) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $zYrJB); } }