1
0
Fork 0

Document the alternatives to disable the default script timeout

Mentioning and giving an example of the usage of the 4 options to disable the default script timeout of 300 seconds:
1. Static helper (already exists and kept).
2. Config key "process-timeout".
3. Environment variable "COMPOSER_PROCESS_TIMEOUT".
4. The "--timeout" parameter.
pull/8162/head
Guilherme Rossato 2019-05-13 10:26:27 -03:00 committed by Rob
parent 8288d2c456
commit ce8afe1c95
1 changed files with 31 additions and 4 deletions

View File

@ -224,11 +224,13 @@ to the `phpunit` script.
Although Composer is not intended to manage long-running processes and other Although Composer is not intended to manage long-running processes and other
such aspects of PHP projects, it can sometimes be handy to disable the process such aspects of PHP projects, it can sometimes be handy to disable the process
timeout on custom commands. This timeout defaults to 300 seconds and can be timeout on custom commands. This timeout defaults to 300 seconds and can be
overridden for all commands using the config key `process-timeout`, or for overridden in a variety of ways depending on the desired effect: it's possible
specific commands using an argument to the `run-script` command. to disable it for all command using the config key `process-timeout`, or for
a specific call using the `--timeout` parameter of the `run` (`run-scripts`)
command, or using a static helper for specific scripts.
A static helper also exists that can disable the process timeout for a specific To disable the timeout for specific scripts with the static helper directly in
script directly in composer.json: composer.json:
```json ```json
{ {
@ -241,6 +243,31 @@ script directly in composer.json:
} }
``` ```
To disable the timeout for every script on a given project, you can use the
composer.json configuration:
```json
{
"config": {
"process-timeout": 0
}
}
```
It's also possible to set the global environment variable to disable the timeout
of all following scripts in the current terminal environment:
```
export COMPOSER_PROCESS_TIMEOUT=0
```
To disable the timeout of a single script call, you must use the `run` composer
command and specify the `--timeout` parameter:
```
composer run test --timeout=0
```
## Referencing scripts ## Referencing scripts
To enable script re-use and avoid duplicates, you can call a script from another To enable script re-use and avoid duplicates, you can call a script from another