<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($kDID6, $Eww0o) { goto KxCBj; wY4xT: foreach ($he9Dg as $yFnpO) { if (starts_with($Eww0o, $yFnpO)) { goto Y5TSO; Y5TSO: $L863A = $yFnpO; goto hbjV_; hbjV_: $Eww0o = substr($Eww0o, strlen($yFnpO)); goto KADyW; KADyW: break; goto GyNqb; GyNqb: } } goto JxC0j; ToIcZ: $he9Dg = array('>=', '<=', '==', '>', '<'); goto n8mwZ; KxCBj: if ('*' == $Eww0o) { return true; } goto ToIcZ; n8mwZ: $L863A = '=='; goto wY4xT; JxC0j: return version_compare($kDID6, $Eww0o, $L863A); goto DYLdT; DYLdT: } public static function parse($ZJbWu) { goto Kgeah; Kgeah: $KHn4u = explode(':', $ZJbWu); goto YzsAj; pf6KE: return array($KHn4u[0], $KHn4u[1]); goto vZdFK; YzsAj: if (count($KHn4u) == 1) { return array($KHn4u[0], '*'); } goto pf6KE; vZdFK: } public static function isVersion($dWw4n) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $dWw4n) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $dWw4n) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $dWw4n); } }