/** * Function that attempts to return the kind of platform. * @return string OS kind ('win', 'lin' or 'osx'). */ protected static function _getOS() { if (self::$_os == '') { if (stristr(PHP_OS, 'WIN') && !stristr(PHP_OS, 'DAR')) { self::$_os = 'win'; } elseif (`uname | grep -i linux` != '') { self::$_os = 'lin'; } elseif (`uname | grep -i darwin` != '') { self::$_os = 'osx'; } else { throw new Exception('WKPDF couldn\'t determine OS.'); } } return self::$_os; }