Explorar el Código

add documentation for preferred-install changes

Steve Buzonas hace 10 años
padre
commit
20745f839c
Se han modificado 1 ficheros con 23 adiciones y 2 borrados
  1. 23 2
      doc/04-schema.md

+ 23 - 2
doc/04-schema.md

@@ -743,7 +743,8 @@ The following options are supported:
   will also look for classes in the PHP include path.
   will also look for classes in the PHP include path.
 * **preferred-install:** Defaults to `auto` and can be any of `source`, `dist` or
 * **preferred-install:** Defaults to `auto` and can be any of `source`, `dist` or
   `auto`. This option allows you to set the install method Composer will prefer to
   `auto`. This option allows you to set the install method Composer will prefer to
-  use.
+  use. Can optionally be a hash of patterns for more granular install preferences.
+  See example below.
 * **store-auths:** What to do after prompting for authentication, one of:
 * **store-auths:** What to do after prompting for authentication, one of:
   `true` (always store), `false` (do not store) and `"prompt"` (ask every
   `true` (always store), `false` (do not store) and `"prompt"` (ask every
   time), defaults to `"prompt"`.
   time), defaults to `"prompt"`.
@@ -822,6 +823,26 @@ Example:
 > besides your `composer.json`. That way you can gitignore it and every
 > besides your `composer.json`. That way you can gitignore it and every
 > developer can place their own credentials in there.
 > developer can place their own credentials in there.
 
 
+preferred-install Example:
+
+```json
+{
+    "config": {
+        "preferred-install": {
+            "my-organization/stable-package": "dist",
+		    "my-organization/*": "source",
+			"partner-organization/*": "auto",
+			"*": "dist"
+        }
+    }
+}
+```
+
+> **Note:** Order matters. More specific patterns should be earlier than
+> more relaxed patterns. When mixing the string notation with the hash
+> configuration in global and package configurations the string notation
+> is translated to a `*` package pattern.
+
 ### scripts <span>(root-only)</span>
 ### scripts <span>(root-only)</span>
 
 
 Composer allows you to hook into various parts of the installation process
 Composer allows you to hook into various parts of the installation process
@@ -910,4 +931,4 @@ Then "composer show -s" will give you `versions : * dev-latest-testing`.
 
 
 Optional.
 Optional.
 
 
-&larr; [Command-line interface](03-cli.md)  |  [Repositories](05-repositories.md) &rarr;
+&larr; [Command-line interface](03-cli.md)  |  [Repositories](05-repositories.md) &rarr;