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

Mte90 /fix xhgui tickets #75

Merged
merged 14 commits into from
Nov 10, 2020
24 changes: 16 additions & 8 deletions tideways/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ function fetch_tideways_repo() {

function install_tideways_for_php_version() {
version=$1
if [[ ! $(command -v php-config$version) ]]; then
return
fi
echo " * Installing Tideways for PHP ${version}"
php_modules_path=$("php-config${version}" --extension-dir)
echo " * Copying tideways files for PHP ${version}"
Expand Down Expand Up @@ -68,11 +71,19 @@ function restart_php() {

function install_xhgui_frontend() {
cp -f "${DIR}/nginx.conf" "/etc/nginx/custom-utilities/xhgui.conf"
declare -a packages=()
for version in "7.0" "7.1" "7.2" "7.3" "7.4"; do
if [[ $(command -v php$version) ]]; then
packages+=("php${version}-sqlite3")
fi
done
apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install --fix-missing --fix-broken "${packages[@]}"
Mte90 marked this conversation as resolved.
Show resolved Hide resolved
if [[ ! -d "/srv/www/default/xhgui" ]]; then
echo -e " * Git cloning xhgui from https://github.com/perftools/xhgui.git"
cd /srv/www/default
noroot git clone "https://github.com/perftools/xhgui.git" xhgui
Mte90 marked this conversation as resolved.
Show resolved Hide resolved
cd xhgui
composer remove alcaeus/mongo-php-adapter
Mte90 marked this conversation as resolved.
Show resolved Hide resolved
echo " * Installing xhgui"
sudo php install.php
Mte90 marked this conversation as resolved.
Show resolved Hide resolved
else
Expand All @@ -84,13 +95,6 @@ function install_xhgui_frontend() {
cp -f "${DIR}/config.php" "/srv/www/default/xhgui/config/config.php"
if [[ ! -d "/srv/www/default/php-profiler" ]]; then
echo -e " * Installing php-profiler for Xhgui"
declare -a packages=()
for version in "7.0" "7.1" "7.2" "7.3" "7.4"; do
if [[ $(command -v php$version) ]]; then
packages+=("php${version}-sqlite3")
fi
done
apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install --fix-missing --fix-broken "${packages[@]}"
cd /srv/www/default
noroot mkdir ./php-profiler && cd ./php-profiler
echo " * Installing php-profiler"
Expand Down Expand Up @@ -123,4 +127,8 @@ install_xhgui_frontend
enable_tideways_by_site
restart_php

echo " * Tideways and XHGui installed"
if [[ ! -f "/srv/www/default/xhgui/composer.lock" ]]
echo " * XHGUI installtion failed!"
Mte90 marked this conversation as resolved.
Show resolved Hide resolved
else
echo " * Tideways and XHGui installed"
fi