From 3047df8bee888225bebb4bb12338a86c23b4a86f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 15 Dec 2025 00:47:08 +0000 Subject: [PATCH 1/2] feat: auto-install php-pear in SessionStart hook Add logic to check if pecl is available and install php-pear if needed. This ensures pecl is available before attempting to install xdebug. --- .claude/hooks/SessionStart.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.claude/hooks/SessionStart.sh b/.claude/hooks/SessionStart.sh index 911d580..2180165 100755 --- a/.claude/hooks/SessionStart.sh +++ b/.claude/hooks/SessionStart.sh @@ -32,6 +32,32 @@ pre-commit install --hook-type commit-msg echo "Pre-commit hooks installed successfully!" +# Check if pecl is available, install php-pear if not +echo "Checking for pecl..." +if ! command -v pecl &> /dev/null; then + echo "pecl is not installed. Installing php-pear..." + + # Try to install php-pear using apt + if command -v apt &> /dev/null; then + apt update && apt install -y php-pear + elif command -v apt-get &> /dev/null; then + apt-get update && apt-get install -y php-pear + else + echo "Error: apt package manager is not available. Cannot install php-pear." + exit 1 + fi + + # Verify installation + if ! command -v pecl &> /dev/null; then + echo "Error: Failed to install php-pear/pecl." + exit 1 + fi + + echo "php-pear and pecl installed successfully!" +else + echo "pecl is already available." +fi + pecl install xdebug || true composer install From 32035b3fff1364730a9c46aa9a5463d738b58b38 Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Sun, 14 Dec 2025 19:48:43 -0500 Subject: [PATCH 2/2] chore: only use apt-get --- .claude/hooks/SessionStart.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.claude/hooks/SessionStart.sh b/.claude/hooks/SessionStart.sh index 2180165..2c38859 100755 --- a/.claude/hooks/SessionStart.sh +++ b/.claude/hooks/SessionStart.sh @@ -38,9 +38,7 @@ if ! command -v pecl &> /dev/null; then echo "pecl is not installed. Installing php-pear..." # Try to install php-pear using apt - if command -v apt &> /dev/null; then - apt update && apt install -y php-pear - elif command -v apt-get &> /dev/null; then + if command -v apt-get &> /dev/null; then apt-get update && apt-get install -y php-pear else echo "Error: apt package manager is not available. Cannot install php-pear."