<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class VersionUtil { public static function match($ar9pi, $UojOr) { goto poQ2y; rqaBd: foreach ($uXOcE as $nsWl0) { if (starts_with($UojOr, $nsWl0)) { goto KT3FM; KT3FM: $whyDb = $nsWl0; goto J49QX; GbqQO: break; goto Ka3SP; J49QX: $UojOr = substr($UojOr, strlen($nsWl0)); goto GbqQO; Ka3SP: } } goto G0Mkt; poQ2y: if ('*' == $UojOr) { return true; } goto Zha0V; G0Mkt: return version_compare($ar9pi, $UojOr, $whyDb); goto cgORM; Zha0V: $uXOcE = array('>=', '<=', '==', '>', '<'); goto NwTfz; NwTfz: $whyDb = '=='; goto rqaBd; cgORM: } public static function parse($GpIxq) { goto Mrmk4; oxPfy: if (count($kaMU7) == 1) { return array($kaMU7[0], '*'); } goto fUUyf; Mrmk4: $kaMU7 = explode(':', $GpIxq); goto oxPfy; fUUyf: return array($kaMU7[0], $kaMU7[1]); goto Glm4U; Glm4U: } public static function isVersion($AvXIK) { return preg_match('/^\\d+\\.\\d+\\.\\d+$/i', $AvXIK) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)$/i', $AvXIK) || preg_match('/^\\d+\\.\\d+\\.\\d+\\-(alpha|beta|release)\\-\\d+$/i', $AvXIK); } }