From 5c70875f8be13ba830857164603ba3e79f407a92 Mon Sep 17 00:00:00 2001 From: Stefan Langer Date: Tue, 21 Jan 2014 13:53:59 -0500 Subject: [PATCH] Added 'islandora_os_check' function, primarily for Windows detection. --- islandora.module | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/islandora.module b/islandora.module index 99a5740b..ef1bf8cc 100644 --- a/islandora.module +++ b/islandora.module @@ -1865,3 +1865,19 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre } return $result; } + +/** + * Determines the server's operating system. + * + * @return string + * The name of the operating system being used. + */ +function islandora_os_check() { + // Determine if PHP is currently running on Windows. (The constant + // "PHP_OS" may return "Windows," "WIN32," "WINNT," "CYGWIN_NT-5.1," etc.) + if ((strtolower(substr(PHP_OS, 0, 3)) == 'win') || + (strtolower(substr(PHP_OS, 0, 6)) == 'cygwin')) { + return 'Windows'; + } + return 'Unix'; +}