Browse Source

Use `env()` to fetch the `PATH` environment variable.
On Windows based systems the variable is named `Path`, making it
inaccessible via `$_SERVER['PATH']`.

ndm2 12 years ago
parent
commit
7fe246d212
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/Console/Command/Task/ProjectTask.php

+ 4 - 3
src/Console/Command/Task/ProjectTask.php

@@ -103,9 +103,10 @@ class ProjectTask extends BakeTask {
 			}
 		}
 		$composer = false;
-		if (!empty($_SERVER['PATH'])) {
-			$path = explode(PATH_SEPARATOR, $_SERVER['PATH']);
-			$composer = $this->_searchPath($path);
+		$path = env('PATH');
+		if (!empty($path)) {
+			$paths = explode(PATH_SEPARATOR, $path);
+			$composer = $this->_searchPath($paths);
 		}
 		return $composer;
 	}