<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PlatformUtil { const WINDOWS = 'windows'; const LINUX = 'linux'; const OSX = 'osx'; const UNKNOWN = 'unknown'; private static function name() { return strtoupper(PHP_OS); } public static function isWindows() { return substr(self::name(), 0, 3) == 'WIN'; } public static function isOsx() { return self::name() == 'DARWIN'; } public static function isLinux() { return self::name() == 'LINUX'; } public static function isType($o99g9) { return in_array(self::type(), $o99g9); } public static function type() { goto mrTCw; mNJc3: if (self::isLinux()) { return self::LINUX; } goto RVsZJ; mrTCw: if (self::isOsx()) { return self::OSX; } goto hDH7k; hDH7k: if (self::isWindows()) { return self::WINDOWS; } goto mNJc3; RVsZJ: return self::UNKNOWN; goto Ynn7D; Ynn7D: } }