mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-02-06 06:50:04 +00:00
![j.dang](/assets/img/avatar_default.png)
- 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
35 lines
694 B
PHP
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');
|
|
}
|
|
}
|
|
}
|