Skip to content

Commit

Permalink
Improve handling of xhprof_prepend.php (#28)
Browse files Browse the repository at this point in the history
* Claim and return ownership of xhprof_prepend.php
Fixes #11

* use traditional HEREDOC delimiter

---------

Co-authored-by: tyler36 <[email protected]>
  • Loading branch information
tyler36 and tyler36 authored May 28, 2024
1 parent 40f5ef2 commit 4284e94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
18 changes: 18 additions & 0 deletions config.xhgui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@ hooks:
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS xhgui; GRANT ALL ON xhgui.* to 'db'@'%';"
fi
service: db
- exec: |
cat <<-EOF > .ddev/xhprof/xhprof_prepend.php
<?php
// DDEV's built in xhprof handler breaks our own.
// We'll temporarily override it here, but return control back later.
// If you don't want this behavior, comment out the hooks in ".ddev/config.xhgui.yaml".
return;
EOF
pre-stop:
- exec: |
cat <<-EOF > .ddev/xhprof/xhprof_prepend.php
<?php
// #ddev-generated
// We'll give back control of this file to DDEV. Next time it checks, it will see it has ownership
// and override this file with the current default.
// If you don't want this behavior, comment out the hooks in .ddev/config.xhgui.yaml.
return;
EOF
1 change: 0 additions & 1 deletion install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ project_files:
- xhgui/collector/xhgui.collector.config.php
- xhgui/collector/xhgui.collector.php
- xhgui/nginx.conf
- xhprof/xhprof_prepend.php

removal_actions:
- if [[ "$DDEV_DATABASE_FAMILY" == "postgres" ]]; then ddev psql -U db -c "drop database xhgui"; fi
Expand Down
5 changes: 0 additions & 5 deletions xhprof/xhprof_prepend.php

This file was deleted.

0 comments on commit 4284e94

Please sign in to comment.