diff --git a/.claude/hooks/SessionStart.sh b/.claude/hooks/SessionStart.sh index 911d580..2c38859 100755 --- a/.claude/hooks/SessionStart.sh +++ b/.claude/hooks/SessionStart.sh @@ -32,6 +32,30 @@ 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-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