Files
kiri-core/System/Environmental.php
T

47 lines
552 B
PHP
Raw Normal View History

2021-03-04 14:40:33 +08:00
<?php
2021-08-11 01:04:57 +08:00
namespace Kiri;
2021-03-04 14:40:33 +08:00
use JetBrains\PhpStorm\Pure;
/**
* Class Environmental
2021-08-11 01:04:57 +08:00
* @package Kiri
2021-03-04 14:40:33 +08:00
*/
class Environmental
{
/**
* @return bool
*/
#[Pure] public function isMac(): bool
{
$output = strtolower(PHP_OS | PHP_OS_FAMILY);
if (str_contains('mac', $output)) {
return true;
} else if (str_contains('darwin', $output)) {
return true;
} else {
return false;
}
}
/**
* @return bool
*/
#[Pure] public function isLinux(): bool
{
if (!static::isMac()) {
return true;
} else {
return false;
}
}
}