Browse Source

Add documentation for Composer\\Config::disableProcessTimeout

Kevin Boyd 6 years ago
parent
commit
5d615a16d1
2 changed files with 34 additions and 0 deletions
  1. 14 0
      doc/06-config.md
  2. 20 0
      doc/articles/scripts.md

+ 14 - 0
doc/06-config.md

@@ -9,6 +9,20 @@ Defaults to `300`. The duration processes like git clones can run before
 Composer assumes they died out. You may need to make this higher if you have a
 slow connection or huge vendors.
 
+To disable the process timeout on a custom command under `scripts`, a static
+helper is available:
+
+```json
+{
+    "scripts": {
+        "test": [
+            "Composer\\Config::disableProcessTimeout",
+            "phpunit"
+        ]
+    }
+}
+```
+
 ## use-include-path
 
 Defaults to `false`. If `true`, the Composer autoloader will also look for classes

+ 20 - 0
doc/articles/scripts.md

@@ -221,6 +221,26 @@ to the `phpunit` script.
 > are easily accessible. In this example no matter if the `phpunit` binary is
 > actually in `vendor/bin/phpunit` or `bin/phpunit` it will be found and executed.
 
+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
+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
+specific commands using an argument to the `run-script` command.
+
+A static helper also exists that can disable the process timeout for a specific
+script directly in composer.json:
+
+```json
+{
+    "scripts": {
+        "test": [
+            "Composer\\Config::disableProcessTimeout",
+            "phpunit"
+        ]
+    }
+}
+```
+
 ## Referencing scripts
 
 To enable script re-use and avoid duplicates, you can call a script from another