Skip to content

Conversation

Thavarshan
Copy link
Owner

Purpose

Resolve issue #10
Resolve issue #9
Resolve issue #8

Approach

This release addresses several critical GitHub issues and significantly enhances cross-platform compatibility, particularly for WSL and Linux systems.

🚀 Added

  • Comprehensive version command support: Implemented `phpvm version`, `phpvm --version`, and `phpvm -v` commands with detailed information including author, repository link, and usage hints
  • Intelligent system PHP detection: Enhanced system PHP switching to properly detect and use Homebrew's main `php` formula as the system default on modern macOS
  • Post-install validation: Added checks for PHP binary availability after installation with helpful warnings if binaries are missing

🔧 Changed

  • Improved shebang for WSL compatibility: Changed from `#!/bin/sh` to `#!/bin/bash` for better compatibility with WSL and Linux distributions
  • Enhanced Homebrew link failure detection: Improved detection and handling of "already linked" warnings from Homebrew with proper error reporting and user guidance
  • Updated system PHP messaging: Changed misleading "macOS built-in PHP" references to accurate "Homebrew default PHP" messaging that reflects modern macOS reality
  • Improved PHP version detection on Linux: Enhanced `dpkg-query` usage for more reliable PHP version listing on Debian/Ubuntu systems
  • Enhanced unlinking logic: Replaced problematic wildcard unlinking with proper iteration through installed PHP formulas

🐛 Fixed

  • Fixed false success reporting on Homebrew link failures: Script now properly detects when `brew link` fails due to "already linked" status and returns error instead of false success
  • Fixed WSL script execution issues: Resolved problem where phpvm would exit silently without output on WSL/Ubuntu systems due to shell compatibility issues
  • Fixed system PHP switching on macOS: System switching now correctly links to Homebrew's main PHP installation instead of looking for non-existent `/usr/bin/php`
  • Fixed PHP version listing on Linux: Improved reliability of `phpvm list` command showing installed PHP versions on apt-based systems
  • Fixed error handling for missing PHP binaries: Added proper error handling when PHP commands are not available, preventing script crashes

Thavarshan and others added 3 commits August 15, 2025 16:21
…-a664-389a634410b6

Release v1.5.0: Critical GitHub Issues Fix and Cross-Platform Compatibility Enhancements
@Thavarshan Thavarshan requested a review from Copilot August 15, 2025 11:07
@Thavarshan Thavarshan self-assigned this Aug 15, 2025
@Thavarshan Thavarshan added the enhancement New feature or request label Aug 15, 2025
Copilot

This comment was marked as outdated.

Thavarshan and others added 2 commits August 15, 2025 16:39
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Thavarshan Thavarshan requested a review from Copilot August 15, 2025 11:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses several critical issues (#8, #9, #10) to improve cross-platform compatibility, particularly for WSL and Linux systems, while fixing system PHP detection on macOS and enhancing error handling throughout the script.

  • Enhanced cross-platform compatibility by switching from #!/bin/sh to #!/bin/bash and improving WSL/Linux support
  • Fixed system PHP detection to use Homebrew's main PHP formula instead of non-existent built-in PHP on modern macOS
  • Improved error handling for Homebrew operations, PHP binary detection, and version switching

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
phpvm.sh Core script updates including shebang change, version command implementation, improved error handling, and system PHP detection fixes
CHANGELOG.md Documentation of all changes and fixes in v1.5.0 release

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return 1
}
elif echo "$link_output" | grep -q "Error"; then
Copy link
Preview

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link_output variable captures both stdout and stderr, but the subsequent grep commands may not handle multiline output correctly. Consider using more robust pattern matching or adding explicit line-by-line processing.

Copilot uses AI. Check for mistakes.

@Thavarshan Thavarshan merged commit 8a1339a into main Aug 15, 2025
3 checks passed
@Thavarshan Thavarshan deleted the fix/github-issues-v1.5.0 branch August 15, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants