Skip to content

Commit

Permalink
Add Silverstripe instructions to readme (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesphere authored Nov 7, 2023
1 parent 1c70c3b commit 427f51c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Framework configuration](#framework-configuration)
- [Drupal 8+](#drupal-8)
- [Wordpress](#wordpress)
- [Silverstripe](#silverstripe)
- [Usage](#usage)

## Introduction
Expand Down Expand Up @@ -79,6 +80,30 @@ If you want to stop profiling, you can just comment/remove those lines.
Take into account that with the default configuration, every time you `ddev start`, DDEV will recreate this file. You can remove the `#ddev-generated` at the top of the file if you want to avoid that.
### Silverstripe
Add/install `perftools/php-profiler`, as per [getting started](#getting-started)
- Copy the files from `.ddev/xhgui/examples` folder to your `public` folder (`cp .ddev/xhgui/examples/*.php public/`)
- Add the requirement to your `public/index.php`, right after the autoload includes:
```php
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
require __DIR__ . '/../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
} else {
header('HTTP/1.1 500 Internal Server Error');
echo "autoload.php not found";
exit(1);
}
if (file_exists(__DIR__ . '/xhgui.collector.php')) {
require_once __DIR__ . '/xhgui.collector.php';
}
```
- Run `ddev xhprof` to start profiling
- XHGui is now available at <https://>`yourproject.ddev.site`:8142
## Usage
The service will automatically start when run: `ddev start` or `ddev restart`.
Expand Down

0 comments on commit 427f51c

Please sign in to comment.