Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Cross-platform home directory detection for Windows compatibility #34

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

vijaythecoder
Copy link
Contributor

This pull request addresses the issue #32 where the application doesn't run on Windows due to undefined 'HOME' environment variable.

Changes made:

  1. Updated config/database.php to use a cross-platform way of detecting the home directory.
  2. Updated config/filesystems.php to use a cross-platform way of detecting the home directory.

The fix involves using both $_SERVER['HOME'] and $_SERVER['USERPROFILE'] to ensure compatibility with both Unix-like systems and Windows. This approach allows the application to find the correct home directory regardless of the operating system.

Why this is a fix:

  • Windows uses 'USERPROFILE' instead of 'HOME' for the user's home directory.
  • By checking for both variables, we ensure that the application can run on both Unix-like systems and Windows without throwing errors related to the 'HOME' environment variable.

Testing:

  1. Windows users should update their global installation of the package:

  2. Run the dexor command.

The application should now run without throwing any errors related to the 'HOME' environment variable.

This fix improves the cross-platform compatibility of the application and resolves the issue reported by Windows users.

Closes #32

@vijaythecoder vijaythecoder changed the base branch from main to dev-1.1.1 July 26, 2024 06:45
@vijaythecoder vijaythecoder mentioned this pull request Jul 26, 2024
@vijaythecoder vijaythecoder merged commit 68c0d74 into dev-1.1.1 Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't run
1 participant