From e423c69d8eb6b844c717fc3dbe3bf773bcfc6215 Mon Sep 17 00:00:00 2001 From: David Zuelke Date: Mon, 14 Jan 2013 19:01:09 +0100 Subject: [PATCH 1/2] Rename "vendor bins" to "vendor binaries" Because a binary is not a receptacle :) Less confusing this way. --- doc/03-cli.md | 2 +- doc/04-schema.md | 2 +- doc/articles/vendor-bins.md | 44 ++++++++++++++++++------------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/03-cli.md b/doc/03-cli.md index 870509c3a..bfb1919f9 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -380,7 +380,7 @@ directory other than `vendor`. ### COMPOSER_BIN_DIR -By setting this option you can change the `bin` ([Vendor Bins](articles/vendor-bins.md)) +By setting this option you can change the `bin` ([Vendor Binaries](articles/vendor-bins.md)) directory to something other than `vendor/bin`. ### http_proxy or HTTP_PROXY diff --git a/doc/04-schema.md b/doc/04-schema.md index f95230695..34c5ccd2d 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -646,7 +646,7 @@ Optional. A set of files that should be treated as binaries and symlinked into the `bin-dir` (from config). -See [Vendor Bins](articles/vendor-bins.md) for more details. +See [Vendor Binaries](articles/vendor-bins.md) for more details. Optional. diff --git a/doc/articles/vendor-bins.md b/doc/articles/vendor-bins.md index d9b87214d..2068130a0 100644 --- a/doc/articles/vendor-bins.md +++ b/doc/articles/vendor-bins.md @@ -2,22 +2,22 @@ tagline: Expose command-line scripts from packages --> -# bin and vendor/bin +# Vendor binaries and the `vendor/bin` directory -## What is a bin? +## What is a vendor binary? Any command line script that a Composer package would like to pass along -to a user who installs the package should be listed as a bin. +to a user who installs the package should be listed as a vendor binary. If a package contains other scripts that are not needed by the package users (like build or compile scripts) that code should not be listed -as a bin. +as a vendor binary. ## How is it defined? It is defined by adding the `bin` key to a project's `composer.json`. -It is specified as an array of files so multiple bins can be added +It is specified as an array of files so multiple binaries can be added for any given project. { @@ -25,26 +25,26 @@ for any given project. } -## What does defining a bin in composer.json do? +## What does defining a vendor binary in composer.json do? -It instructs Composer to install the package's bins to `vendor/bin` +It instructs Composer to install the package's binaries to `vendor/bin` for any project that **depends** on that project. This is a convenient way to expose useful scripts that would otherwise be hidden deep in the `vendor/` directory. -## What happens when Composer is run on a composer.json that defines bins? +## What happens when Composer is run on a composer.json that defines vendor binaries? -For the bins that a package defines directly, nothing happens. +For the binaries that a package defines directly, nothing happens. -## What happens when Composer is run on a composer.json that has dependencies with bins listed? +## What happens when Composer is run on a composer.json that has dependencies with vendor binaries listed? -Composer looks for the bins defined in all of the dependencies. A -symlink is created from each dependency's bins to `vendor/bin`. +Composer looks for the binaries defined in all of the dependencies. A +symlink is created from each dependency's binaries to `vendor/bin`. -Say package `my-vendor/project-a` has bins setup like this: +Say package `my-vendor/project-a` has binaries setup like this: { "name": "my-vendor/project-a", @@ -75,23 +75,23 @@ this is accomplished by creating a symlink. Packages managed entirely by Composer do not *need* to contain any `.bat` files for Windows compatibility. Composer handles installation -of bins in a special way when run in a Windows environment: +of binaries in a special way when run in a Windows environment: - * A `.bat` files is generated automatically to reference the bin - * A Unix-style proxy file with the same name as the bin is generated + * A `.bat` files is generated automatically to reference the binary + * A Unix-style proxy file with the same name as the binary is generated automatically (useful for Cygwin or Git Bash) Packages that need to support workflows that may not include Composer are welcome to maintain custom `.bat` files. In this case, the package -should **not** list the `.bat` file as a bin as it is not needed. +should **not** list the `.bat` file as a binary as it is not needed. -## Can vendor bins be installed somewhere other than vendor/bin? +## Can vendor binaries be installed somewhere other than vendor/bin? -Yes, there are two ways that an alternate vendor bin location can be specified. +Yes, there are two ways an alternate vendor binary location can be specified: - * Setting the `bin-dir` configuration setting in `composer.json` - * Setting the environment variable `COMPOSER_BIN_DIR` + 1. Setting the `bin-dir` configuration setting in `composer.json` + 1. Setting the environment variable `COMPOSER_BIN_DIR` An example of the former looks like this: @@ -102,5 +102,5 @@ An example of the former looks like this: } Running `composer install` for this `composer.json` will result in -all of the vendor bins being installed in `scripts/` instead of +all of the vendor binaries being installed in `scripts/` instead of `vendor/bin/`. From 7e1f81dc1ec771cbc9059ec674be23f02a534d54 Mon Sep 17 00:00:00 2001 From: David Zuelke Date: Mon, 14 Jan 2013 19:42:12 +0100 Subject: [PATCH 2/2] rename vendor-bins.md to vendor-binaries.md --- doc/03-cli.md | 2 +- doc/04-schema.md | 2 +- doc/articles/{vendor-bins.md => vendor-binaries.md} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename doc/articles/{vendor-bins.md => vendor-binaries.md} (100%) diff --git a/doc/03-cli.md b/doc/03-cli.md index bfb1919f9..045c9f871 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -380,7 +380,7 @@ directory other than `vendor`. ### COMPOSER_BIN_DIR -By setting this option you can change the `bin` ([Vendor Binaries](articles/vendor-bins.md)) +By setting this option you can change the `bin` ([Vendor Binaries](articles/vendor-binaries.md)) directory to something other than `vendor/bin`. ### http_proxy or HTTP_PROXY diff --git a/doc/04-schema.md b/doc/04-schema.md index 34c5ccd2d..d95a385ba 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -646,7 +646,7 @@ Optional. A set of files that should be treated as binaries and symlinked into the `bin-dir` (from config). -See [Vendor Binaries](articles/vendor-bins.md) for more details. +See [Vendor Binaries](articles/vendor-binaries.md) for more details. Optional. diff --git a/doc/articles/vendor-bins.md b/doc/articles/vendor-binaries.md similarity index 100% rename from doc/articles/vendor-bins.md rename to doc/articles/vendor-binaries.md