#!/usr/bin/env bash
export PATH=$PATH:/usr/sbin:/sbin
phpenmod xdebug
if [ "${DDEV_WEBSERVER_TYPE:-}" = "generic" ]; then
  # we don't know what process is running php, restart all web_extra_daemons
  supervisorctl restart 'webextradaemons:*' || true
else
  killall -USR2 php-fpm 2>/dev/null || true
fi
# if xdebug is not enabled, there will be a visible warning in stderr
php -m >/dev/null || true
echo "Enabled xdebug"
