Skip to content

Commit 20ba0ec

Browse files
committed
New is_windows_os testable implementation.
1 parent e727cfc commit 20ba0ec

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/classes/System/OS.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Illuminated\Helpers\System;
4+
5+
class OS
6+
{
7+
public static function isWindows()
8+
{
9+
return (strtoupper(substr(php_uname(), 0, 7)) === 'WINDOWS');
10+
}
11+
}

src/system.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

3+
use Illuminated\Helpers\System\OS;
4+
35
if (!function_exists('is_windows_os')) {
46
function is_windows_os()
57
{
6-
return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
8+
return OS::isWindows();
79
}
810
}

0 commit comments

Comments
 (0)