mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-06 16:46:48 +01:00
Improved working with OS for serverType
This commit is contained in:
@@ -14,20 +14,15 @@ class System
|
||||
}
|
||||
}
|
||||
|
||||
const OS_UNKNOWN = 'Linux';
|
||||
const OS_WIN = 'Windows';
|
||||
const OS_LINUX = 'Linux';
|
||||
const OS_OSX = 'Mac';
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
public function getOS() {
|
||||
switch (true) {
|
||||
case stristr(PHP_OS, 'DAR'): return self::OS_OSX;
|
||||
case stristr(PHP_OS, 'WIN'): return self::OS_WIN;
|
||||
case stristr(PHP_OS, 'LINUX'): return self::OS_LINUX;
|
||||
default : return self::OS_UNKNOWN;
|
||||
case stristr(PHP_OS, 'DAR'): return 'Mac';
|
||||
case stristr(PHP_OS, 'WIN'): return 'Windows';
|
||||
case stristr(PHP_OS, 'LINUX'): return 'Linux';
|
||||
default : return 'Linux';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user