<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($o7TdV, $n5noJ) { goto Obe0K; PiriX: $JFElN = array('>=', '<=', '==', '>', '<'); goto yX4ZI; Obe0K: if ('*' == $n5noJ) { return true; } goto PiriX; TQ9CY: return version_compare($o7TdV, $n5noJ, $sXdOy); goto VbXKH; BccXc: foreach ($JFElN as $OV1o4) { if (starts_with($n5noJ, $OV1o4)) { goto UtvqC; QSsap: $n5noJ = substr($n5noJ, strlen($OV1o4)); goto Jc4vg; Jc4vg: break; goto sl6N5; UtvqC: $sXdOy = $OV1o4; goto QSsap; sl6N5: } } goto TQ9CY; yX4ZI: $sXdOy = '=='; goto BccXc; VbXKH: } public static function parse($cG1j0) { goto b7eq9; NL4_a: if (count($QhMxe) == 1) { return array($QhMxe[0], '*'); } goto YS80a; YS80a: return array($QhMxe[0], $QhMxe[1]); goto tlLCs; b7eq9: $QhMxe = explode(':', $cG1j0); goto NL4_a; tlLCs: } public static function isVersion($nr5b0) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $nr5b0) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $nr5b0) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $nr5b0); } }