0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-02-06 06:50:04 +00:00
salesagility_SuiteCRM/Api/V8/Helper/OsHelper.php
j.dang 5874287eeb Fix #8420 - V8 API issues fails on windows
- Add helper class to determine OS and whether to check key permissions.
- Generate CryptKey instances to pass to Auth Server instead of raw keys.
- Update slim settings to not set content length header
2021-05-24 16:37:41 +01:00

35 lines
694 B
PHP

<?php
namespace Api\V8\Helper;
/**
* Class OsHelper
*/
class OsHelper
{
const OS_WINDOWS = 'WINDOWS';
const OS_LINUX = 'LINUX';
const OS_OSX = 'OSX';
/**
* @return string
*
* @throws \RuntimeException When unable to determine OS.
*/
public static function getOS()
{
switch (true) {
case stristr(PHP_OS, 'DAR'):
return self::OS_OSX;
case stristr(PHP_OS, 'WIN'):
return self::OS_WINDOWS;
case stristr(PHP_OS, 'LINUX'):
return self::OS_LINUX;
default:
throw new \RuntimeException('Unable to determine OS');
}
}
}