mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2026-07-30 00:30:19 +08:00
Merge commit 'de4bf25cb3' into release/8.4.0-beta
# Conflicts:
# public/legacy/data/SugarBean.php
# public/legacy/include/Smarty/plugins/function.sugarvar.php
# public/legacy/include/SugarDateTime.php
# public/legacy/include/database/MysqliManager.php
# public/legacy/modules/Alerts/metadata/listviewdefs.php
# public/legacy/modules/SugarFeed/Dashlets/SugarFeedDashlet/SugarFeedDashlet.php
# public/legacy/modules/Trackers/metadata/SearchFields.php
# public/legacy/modules/Trackers/metadata/listviewdefs.php
# public/legacy/modules/UpgradeWizard/SugarMerge/EditViewMerge.php
# public/legacy/suitecrm_version.php
36 lines
742 B
PHP
36 lines
742 B
PHP
<?php
|
|
|
|
namespace Api\V8\Helper;
|
|
|
|
/**
|
|
* Class OsHelper
|
|
*/
|
|
#[\AllowDynamicProperties]
|
|
class OsHelper
|
|
{
|
|
public const OS_WINDOWS = 'WINDOWS';
|
|
public const OS_LINUX = 'LINUX';
|
|
public 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');
|
|
}
|
|
}
|
|
}
|