Check function_exists on posix_getpwuid to keep xampp happy, a=chris

Chris Pollett [2015-08-10 19:Aug:th]
Check function_exists on posix_getpwuid to keep xampp happy, a=chris
Filename
src/library/CrawlDaemon.php
diff --git a/src/library/CrawlDaemon.php b/src/library/CrawlDaemon.php
index c800a5979..923dfbc7f 100644
--- a/src/library/CrawlDaemon.php
+++ b/src/library/CrawlDaemon.php
@@ -127,7 +127,6 @@ class CrawlDaemon implements CrawlConstants
     public static function init($argv, $name, $exit_type = 1)
     {
         self::$name = $name;
-
         if (isset($argv[2]) && $argv[2] != "none") {
             self::$subname = $argv[2];
         } else {
@@ -217,14 +216,16 @@ class CrawlDaemon implements CrawlConstants
            of the owner of the webserver process so it can write
            a .hhvm.hhbc file
          */
-        $process_user_info = posix_getpwuid(posix_getuid());
-        $process_home = $process_user_info['dir'];
-        if (defined("FORCE_HHVM") || (
-            stristr(phpversion(), "hhvm") !==false &&
-            posix_access($process_home, POSIX_W_OK))) {
-            $php = 'hhvm -f ';
-            if (C\nsdefined("HHVM_PATH") ) {
-                $php = C\HHVM_PATH."/".$php;
+        if(function_exists("posix_getpwuid")) {
+            $process_user_info = posix_getpwuid(posix_getuid());
+            $process_home = $process_user_info['dir'];
+            if (C\nsdefined("FORCE_HHVM") || (
+                stristr(phpversion(), "hhvm") !==false &&
+                posix_access($process_home, POSIX_W_OK))) {
+                $php = 'hhvm -f ';
+                if (C\nsdefined("HHVM_PATH") ) {
+                    $php = C\HHVM_PATH."/".$php;
+                }
             }
         }
         if (strstr(PHP_OS, "WIN")) {
ViewGit