* Determine whether current OS is a Windows variant.
*/
function drush_is_windows($os = NULL) {
- return strtoupper(substr($os ?: PHP_OS, 0, 3)) === 'WIN';
+ // The _drush_get_os() function may not be available, so resolve "LOCAL"
+ if (!$os || $os == "LOCAL") {
+ $os = PHP_OS;
+ }
+ return strtoupper(substr($os, 0, 3)) === 'WIN';
}
function drush_escapeshellarg($arg, $os = NULL, $raw = FALSE) {
}
// Always use pcntl_exec if it exists.
- $use_pcntl_exec = function_exists("pcntl_exec");
+ $use_pcntl_exec = function_exists("pcntl_exec") && (strpos(ini_get('disable_functions'), 'pcntl_exec') === FALSE);
// If we have posix_getppid, then pass in the shell pid so
// that 'site-set' et. al. can work correctly.