From fff0f291b0dd60a7d2ee74b7da700e894705014a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 10 Mar 2018 23:49:03 -0500 Subject: [PATCH] Add profiling docs here. --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 305c4a5..277f830 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,60 @@ This table represents current known information about compatibility between this | XHGUI Collector version | XHGUI Version | Compatibility | |-------------------------|---------------|------------------------------------------| -| 1.0.0 | 0.2.0 - 0.7.1 | presumed compatible - schema is the same | +| 1.x | 0.2.0 - 0.7.1 | presumed compatible - schema is the same | ## Usage -You can use this to build your own saving library or just configure as described in [XHGUI][2] manual -and include `external/header.php` as an auto_prepend_file (also described in [XHGUI][2] manual) +### Profile an Application or Site + +The simplest way to profile an application is to use `external/header.php`. +`external/header.php` is designed to be combined with PHP's +[auto_prepend_file][4] directive. You can enable `auto_prepend_file` system-wide +through `php.ini`. Alternatively, you can enable `auto_prepend_file` per virtual +host. + +With apache this would look like: + +```apache + + php_admin_value auto_prepend_file "/Users/markstory/Sites/xhgui/external/header.php" + DocumentRoot "/Users/markstory/Sites/awesome-thing/app/webroot/" + ServerName site.localhost + +``` +With Nginx in fastcgi mode you could use: + +```nginx +server { + listen 80; + server_name site.localhost; + root /Users/markstory/Sites/awesome-thing/app/webroot/; + fastcgi_param PHP_VALUE "auto_prepend_file=/Users/markstory/Sites/xhgui/external/header.php"; +} +``` + +### Profile a CLI Script + +The simplest way to profile a CLI is to use `external/header.php`. +`external/header.php` is designed to be combined with PHP's +[auto_prepend_file][4] directive. You can enable `auto_prepend_file` system-wide +through `php.ini`. Alternatively, you can enable include the `header.php` at the +top of your script: + +```php +