-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e5bdf7
commit cb70d53
Showing
2 changed files
with
11 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -813,4 +813,13 @@ public static function setDotNotation(&$array, $key, $value, $merge = false) | |
|
||
return $array; | ||
} | ||
|
||
/** | ||
* Utility method to determine if the current OS is Windows | ||
* | ||
* @return bool | ||
*/ | ||
public static function isWindows() { | ||
return strncasecmp(PHP_OS, 'WIN', 3) == 0; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
flaviocopes
Author
Contributor
|
||
} | ||
} |
Maybe checking the DIRECTORY_SEPARATOR, PHP_SHLIB_SUFFIX or PATH_SEPARATOR constants can be faster and possibly more "future proof".
e.g.:
return DIRECTORY_SEPARATOR == '\';
See "Example #2" in http://php.net/manual/en/function.php-uname.php