Skip to content

Commit

Permalink
Sync installation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler36 committed Nov 8, 2023
1 parent eeaf131 commit 262ee18
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ Profiling in a production environment is not recommended.
ddev restart
```

## Framework configuration

### Drupal

- Install `perftools/php-profiler`

```shell
ddev composer require perftools/php-profiler --dev
```

## Framework configuration

### Drupal

- Add the following line to `web/sites/default/settings.php` to include the collector.

```php
Expand All @@ -50,20 +50,25 @@ Profiling in a production environment is not recommended.
```
- Run `ddev xhprof` to start profiling.
- XHGui is now available at `https://yourproject.ddev.site:8142`
### WordPress
Download latest version of `perftools/php-profiler` (validated with the current latest release, 0.18.0).
If you use [bedrock](https://roots.io/bedrock/), use the composer command from the previous section.
- Install `perftools/php-profiler`
- If using [bedrock](https://roots.io/bedrock/)
If you use vanilla WordPress:
```shell
ddev composer require perftools/php-profiler --dev
```
- If using vanilla WordPress:
```shell
wget https://github.com/perftools/php-profiler/archive/refs/tags/0.18.0.tar.gz
tar -xvf 0.18.0.tar.gz
```
- Copy the two files in the `.ddev/xhgui/examples` folder to your WordPress folder, and append to your `wp-config-ddev.php`:
- Add the following line to `wp-config-ddev.php` to include the collector.
```php
require_once __DIR__ . '/php-profiler-0.18.0/autoload.php';
Expand All @@ -72,18 +77,19 @@ If you use vanilla WordPress:
}
```
- Comment out the above line to disable profiling.
To disable profiling, comment/remove those lines.
Remove the `#ddev-generated` at the top of the file to avoid that.
- Remove `#ddev-generated` from `wp-config-ddev.php` to prevent DDEV overriding it.
- Run `ddev xhprof` to start profiling
- XHGui is now available at `https://yourproject.ddev.site:8142`
### Silverstripe
Add/install `perftools/php-profiler`, as per [getting started](#getting-started)
- Install `perftools/php-profiler`
```shell
ddev composer require perftools/php-profiler --dev
```
- 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:
- Add the following line to `public/index.php`, right after the autoload includes, to include the collector.
```php
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
Expand All @@ -101,7 +107,7 @@ Add/install `perftools/php-profiler`, as per [getting started](#getting-started)
```
- Run `ddev xhprof` to start profiling
- XHGui is now available at `https://yourproject.ddev.site:8142`
- XHGui is now available at `https://yourproject.ddev.site:8142`
## Usage
Expand Down

0 comments on commit 262ee18

Please sign in to comment.