Skip to content
This repository

Change auto home detection for windows #28

Closed
wants to merge 1 commit into from

2 participants

Daniel Holmes Jeremy Lindblom
Daniel Holmes

If including the sdk without a config.inc.php, there is some auto detection of home directories.

Running cd ~ && pwd on Windows though doesn't work and outputs "The system cannot find the path specified."

Daniel Holmes Change auto home detection for windows - running `cd ~ && pwd` doesn'…
…t work and outputs "The system cannot find the path specified."
e0c3c2f
Jeremy Lindblom
Owner

Thanks, we'll see about getting this in soon.

Jeremy Lindblom
Owner

I have incorporated this change into my development branch. I will close this pull request when we release a version that contains this change.

Jeremy Lindblom
Owner

Completed in 1.5.7.

Jeremy Lindblom jeremeamia closed this June 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 18, 2012
Daniel Holmes Change auto home detection for windows - running `cd ~ && pwd` doesn'…
…t work and outputs "The system cannot find the path specified."
e0c3c2f
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. 12  sdk.class.php
12  sdk.class.php
@@ -1405,10 +1405,18 @@ public static function autoloader($class)
1405 1405
 	}
1406 1406
 	elseif (!isset($_ENV['HOME']) && !isset($_SERVER['HOME']))
1407 1407
 	{
1408  
-		$_ENV['HOME'] = `cd ~ && pwd`;
  1408
+		$os = strtolower(PHP_OS);
  1409
+		if (in_array($os, array('windows', 'winnt', 'win32')))
  1410
+		{
  1411
+			$_ENV['HOME'] = false;
  1412
+		}
  1413
+		else
  1414
+		{
  1415
+			$_ENV['HOME'] = `cd ~ && pwd`;
  1416
+		}
1409 1417
 		if (!$_ENV['HOME'])
1410 1418
 		{
1411  
-			switch (strtolower(PHP_OS))
  1419
+			switch ($os)
1412 1420
 			{
1413 1421
 				case 'darwin':
1414 1422
 					$_ENV['HOME'] = '/Users/' . get_current_user();
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.