aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/dev/xdebug.md
blob: be198cca8096e336b9975cd987186c06e3c3f39e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Xdebug

Composer restarts itself without Xdebug loaded, because Xdebug makes PHP
several times slower. Shirabe is written in Rust, where Xdebug does not exist,
but it invokes a PHP command for plugins, scripts and platform queries.
When Shirabe spawns a PHP worker, Xdebug is disabled as Composer does.

The PHP worker is spawned with the `-d xdebug.mode=off` flag and the
`XDEBUG_MODE=off` environment variable. The way to disable Xdebug in Shirabe is
different from Composer: Composer restarts its own process with a temporary
INI file, where Xdebug extension is disabled. The difference probably does not
matter, both for users and for plugin authors.

## Enable Xdebug in Shirabe's PHP worker

It is the same as Composer: setting `COMPOSER_ALLOW_XDEBUG` to 1 makes Shirabe
leave Xdebug enabled.

```
$ COMPOSER_ALLOW_XDEBUG=1 shirabe install
```

## Xdebug 2 support

Shirabe does not try to disable Xdebug version 2 because Xdebug 2 has no
`xdebug.mode` or `XDEBUG_MODE`, while Composer disables Xdebug 2 too. The
performance penalty seems to be small as Shirabe's CPU-heavy workloads are
written in Rust.