Terminal User Guide
Popular Alternatives to NoScript for Windows, Linux, Mac, Firefox, Chrome and more. Explore 10 apps like NoScript, all suggested and ranked by the AlternativeTo user community. With this script you can kill all, Kill Aura and other OP commands in Prison Life, make other players mad and have fun:D to execute this script recommended to use Paid Exploit example: Synapse X, SirHurt, etc. But you can enjoy it with free exploit too, but some features may not work properly. 'Consider switching to the Firefox Web browser with the NoScript plug-in. NoScript selectively, and non-intrusively, blocks all scripts, plug-ins, and other code on Web pages that could be used to attack your system during visits' (Rich Mogull on TidBITS, Should Mac Users Run Antivirus Software?). Having the same issue. Also with the stealth tutorial project, having finished assignment 106. Finished the other tutorial projects without any hassle. Reimporting didn't help yet. Also deleting all meta-files didn't help. There are no console errors. I've also converted the scripts from UTF-8 to ANSI Coding, but to no avail.
Shell scripts must be executable files in order to run. You can use the chmod command to indicate that the text file is executable (that is, its contents can be run as a shell script).
In the Terminal app on your Mac, use the cd command to move into the directory that contains the file you want to make executable. For example:
Enter the chmod command. For example:
% chmod 755 YourScriptName.sh
After making the shell script file executable, you can run it by entering its pathname. For example:
or
% cd ~/Documents/Dev/
% ./YourScriptName.sh
- config
- Environment variables
- COMPOSER_HOME
You've already learned how to use the command-line interface to do somethings. This chapter documents all the available commands.
To get help from the command-line, call composer
or composer list
to see the complete list of commands, then --help
combined with any of thosecan give you more information.
As Composer uses symfony/console you can call commands by short name if it's not ambiguous.
calls composer dump-autoload
.
Global Options#
The following options are available with every command:
- --verbose (-v): Increase verbosity of messages.
- --help (-h): Display help information.
- --quiet (-q): Do not output any message.
- --no-interaction (-n): Do not ask any interactive question.
- --no-plugins: Disables plugins.
- --no-cache: Disables the use of the cache directory. Same as setting the COMPOSER_CACHE_DIRenv var to /dev/null (or NUL on Windows).
- --working-dir (-d): If specified, use the given directory as working directory.
- --profile: Display timing and memory usage information
- --ansi: Force ANSI output.
- --no-ansi: Disable ANSI output.
- --version (-V): Display this application version.
Process Exit Codes#
- 0: OK
- 1: Generic/unknown error code
- 2: Dependency solving error code
init#
In the Libraries chapter we looked at how to create acomposer.json
by hand. There is also an init
command available to do this.
When you run the command it will interactively ask you to fill in the fields,while using some smart defaults.
Options
- --name: Name of the package.
- --description: Description of the package.
- --author: Author name of the package.
- --type: Type of package.
- --homepage: Homepage of the package.
- --require: Package to require with a version constraint. Should bein format
foo/bar:1.0.0
. - --require-dev: Development requirements, see --require.
- --stability (-s): Value for the
minimum-stability
field. - --license (-l): License of package.
- --repository: Provide one (or more) custom repositories. They will be storedin the generated composer.json, and used for auto-completion when prompting forthe list of requires. Every repository can be either an HTTP URL pointingto a
composer
repository or a JSON string which similar to what therepositories key accepts.
install / i#
The install
command reads the composer.json
file from the currentdirectory, resolves the dependencies, and installs them into vendor
.
If there is a composer.lock
file in the current directory, it will use theexact versions from there instead of resolving them. This ensures thateveryone using the library will get the same versions of the dependencies.
If there is no composer.lock
file, Composer will create one after dependencyresolution.
Options
- --prefer-source: There are two ways of downloading a package:
source
anddist
. For stable versions Composer will use thedist
by default.Thesource
is a version control repository. If--prefer-source
isenabled, Composer will install fromsource
if there is one. This isuseful if you want to make a bugfix to a project and get a local gitclone of the dependency directly. - --prefer-dist: Reverse of
--prefer-source
, Composer will installfromdist
if possible. This can speed up installs substantially on buildservers and other use cases where you typically do not run updates of thevendors. It is also a way to circumvent problems with git if you do nothave a proper setup. - --dry-run: If you want to run through an installation without actuallyinstalling a package, you can use
--dry-run
. This will simulate theinstallation and show you what would happen. - --dev: Install packages listed in
require-dev
(this is the default behavior). - --no-dev: Skip installing packages listed in
require-dev
. The autoloadergeneration skips theautoload-dev
rules. - --no-autoloader: Skips autoloader generation.
- --no-scripts: Skips execution of scripts defined in
composer.json
. - --no-progress: Removes the progress display that can mess with someterminals or scripts which don't handle backspace characters.
- --optimize-autoloader (-o): Convert PSR-0/4 autoloading to classmap to get a fasterautoloader. This is recommended especially for production, but can takea bit of time to run so it is currently not done by default.
- --classmap-authoritative (-a): Autoload classes from the classmap only.Implicitly enables
--optimize-autoloader
. - --apcu-autoloader: Use APCu to cache found/not-found classes.
- --apcu-autoloader-prefix: Use a custom prefix for the APCu autoloader cache.Implicitly enables
--apcu-autoloader
. - --ignore-platform-reqs: ignore all platform requirements (
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machine doesnot fulfill these.See also theplatform
config option. - --ignore-platform-req: ignore a specific platform requirement(
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machinedoes not fulfill it.
update / u#
In order to get the latest versions of the dependencies and to update thecomposer.lock
file, you should use the update
command. This command is alsoaliased as upgrade
as it does the same as upgrade
does if you are thinkingof apt-get
or similar package managers.
This will resolve all dependencies of the project and write the exact versionsinto composer.lock
.
If you only want to update a few packages and not all, you can list them as such:
You can also use wildcards to update a bunch of packages at once:
If you want to downgrade a package to a specific version without changing yourcomposer.json you can use --with
and provide a custom version constraint:
The custom constraint has to be a subset of the existing constraint you have,and this feature is only available for your root package dependencies.
If you only want to update the package(s) for which you provide custom constraintsusing --with
, you can skip --with
and just use constraints with the partialupdate syntax:
Options
- --prefer-source: Install packages from
source
when available. - --prefer-dist: Install packages from
dist
when available. - --dry-run: Simulate the command without actually doing anything.
- --dev: Install packages listed in
require-dev
(this is the default behavior). - --no-dev: Skip installing packages listed in
require-dev
. The autoloader generation skips theautoload-dev
rules. - --no-install: Does not run the install step after updating the composer.lock file.
- --lock: Only updates the lock file hash to suppress warning about thelock file being out of date.
- --with: Temporary version constraint to add, e.g. foo/bar:1.0.0 or foo/bar=1.0.0
- --no-autoloader: Skips autoloader generation.
- --no-scripts: Skips execution of scripts defined in
composer.json
. - --no-progress: Removes the progress display that can mess with someterminals or scripts which don't handle backspace characters.
- --with-dependencies (-w): Update also dependencies of packages in the argument list, except those which are root requirements.
- --with-all-dependencies (-W): Update also dependencies of packages in the argument list, including those which are root requirements.
- --optimize-autoloader (-o): Convert PSR-0/4 autoloading to classmap to get a fasterautoloader. This is recommended especially for production, but can takea bit of time to run, so it is currently not done by default.
- --classmap-authoritative (-a): Autoload classes from the classmap only.Implicitly enables
--optimize-autoloader
. - --apcu-autoloader: Use APCu to cache found/not-found classes.
- --apcu-autoloader-prefix: Use a custom prefix for the APCu autoloader cache.Implicitly enables
--apcu-autoloader
. - --ignore-platform-reqs: ignore all platform requirements (
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machine doesnot fulfill these.See also theplatform
config option. - --ignore-platform-req: ignore a specific platform requirement(
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machinedoes not fulfill it. - --prefer-stable: Prefer stable versions of dependencies.
- --prefer-lowest: Prefer lowest versions of dependencies. Useful for testing minimalversions of requirements, generally used with
--prefer-stable
. - --interactive: Interactive interface with autocompletion to select the packages to update.
- --root-reqs: Restricts the update to your first degree dependencies.
Specifying one of the words mirrors
, lock
, or nothing
as an argument has the same effect as specifying the option --lock
, for example composer update mirrors
is exactly the same as composer update --lock
.
require#
The require
command adds new packages to the composer.json
file fromthe current directory. If no file exists one will be created on the fly.
After adding/changing the requirements, the modified requirements will beinstalled or updated.
If you do not want to choose requirements interactively, you can pass themto the command.
If you do not specify a package, composer will prompt you to search for a package, and given results, provide a list of matches to require.
Options
- --dev: Add packages to
require-dev
. - --dry-run: Simulate the command without actually doing anything.
- --prefer-source: Install packages from
source
when available. - --prefer-dist: Install packages from
dist
when available. - --no-progress: Removes the progress display that can mess with someterminals or scripts which don't handle backspace characters.
- --no-update: Disables the automatic update of the dependencies (implies --no-install).
- --no-install: Does not run the install step after updating the composer.lock file.
- --no-scripts: Skips execution of scripts defined in
composer.json
. - --update-no-dev: Run the dependency update with the
--no-dev
option. - --update-with-dependencies (-w): Also update dependencies of the newly required packages, except those that are root requirements.
- --update-with-all-dependencies (-W): Also update dependencies of the newly required packages, including those that are root requirements.
- --ignore-platform-reqs: ignore all platform requirements (
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machine doesnot fulfill these.See also theplatform
config option. - --ignore-platform-req: ignore a specific platform requirement(
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machinedoes not fulfill it. - --prefer-stable: Prefer stable versions of dependencies.
- --prefer-lowest: Prefer lowest versions of dependencies. Useful for testing minimalversions of requirements, generally used with
--prefer-stable
. - --sort-packages: Keep packages sorted in
composer.json
. - --optimize-autoloader (-o): Convert PSR-0/4 autoloading to classmap toget a faster autoloader. This is recommended especially for production, butcan take a bit of time to run, so it is currently not done by default.
- --classmap-authoritative (-a): Autoload classes from the classmap only.Implicitly enables
--optimize-autoloader
. - --apcu-autoloader: Use APCu to cache found/not-found classes.
- --apcu-autoloader-prefix: Use a custom prefix for the APCu autoloader cache.Implicitly enables
--apcu-autoloader
.
remove#
The remove
command removes packages from the composer.json
file fromthe current directory.
After removing the requirements, the modified requirements will beuninstalled.
Options
- --dev: Remove packages from
require-dev
. - --dry-run: Simulate the command without actually doing anything.
- --no-progress: Removes the progress display that can mess with someterminals or scripts which don't handle backspace characters.
- --no-update: Disables the automatic update of the dependencies (implies --no-install).
- --no-install: Does not run the install step after updating the composer.lock file.
- --no-scripts: Skips execution of scripts defined in
composer.json
. - --update-no-dev: Run the dependency update with the --no-dev option.
- --update-with-dependencies (-w): Also update dependencies of the removed packages.(Deprecrated, is now default behavior)
- --update-with-all-dependencies (-W): Allows all inherited dependencies to be updated,including those that are root requirements.
- --ignore-platform-reqs: ignore all platform requirements (
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machine doesnot fulfill these.See also theplatform
config option. - --ignore-platform-req: ignore a specific platform requirement(
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machinedoes not fulfill it. - --optimize-autoloader (-o): Convert PSR-0/4 autoloading to classmap toget a faster autoloader. This is recommended especially for production, butcan take a bit of time to run so it is currently not done by default.
- --classmap-authoritative (-a): Autoload classes from the classmap only.Implicitly enables
--optimize-autoloader
. - --apcu-autoloader: Use APCu to cache found/not-found classes.
- --apcu-autoloader-prefix: Use a custom prefix for the APCu autoloader cache.Implicitly enables
--apcu-autoloader
.
check-platform-reqs#
The check-platform-reqs command checks that your PHP and extensions versionsmatch the platform requirements of the installed packages. This can be usedto verify that a production server has all the extensions needed to run aproject after installing it for example.
Unlike update/install, this command will ignore config.platform settings andcheck the real platform packages so you can be certain you have the requiredplatform dependencies.
global#
The global command allows you to run other commands like install
, remove
, require
or update
as if you were running them from the COMPOSER_HOMEdirectory.
This is merely a helper to manage a project stored in a central location thatcan hold CLI tools or Composer plugins that you want to have available everywhere.
This can be used to install CLI utilities globally. Here is an example:
Now the php-cs-fixer
binary is available globally. Make sure your globalvendor binaries directory is in your $PATH
environment variable, you can get its location with the following command :
If you wish to update the binary later on you can run a global update:
search#
The search command allows you to search through the current project's packagerepositories. Usually this will be packagist. You pass it the terms you wantto search for.
You can also search for more than one term by passing multiple arguments.
Options
- --only-name (-N): Search only in name.
- --type (-t): Search for a specific package type.
show#
To list all of the available packages, you can use the show
command.
To filter the list you can pass a package mask using wildcards.
If you want to see the details of a certain package, you can pass the packagename.
You can even pass the package version, which will tell you the details of thatspecific version.
Options
- --all : List all packages available in all your repositories.
- --installed (-i): List the packages that are installed (this is enabled by default, and deprecated).
- --locked: List the locked packages from composer.lock.
- --platform (-p): List only platform packages (php & extensions).
- --available (-a): List available packages only.
- --self (-s): List the root package info.
- --name-only (-N): List package names only.
- --path (-P): List package paths.
- --tree (-t): List your dependencies as a tree. If you pass a package name it will show the dependency tree for that package.
- --latest (-l): List all installed packages including their latest version.
- --outdated (-o): Implies --latest, but this lists only packages that have a newer version available.
- --no-dev: Filters dev dependencies from the package list.
- --minor-only (-m): Use with --latest. Only shows packages that have minor SemVer-compatible updates.
- --direct (-D): Restricts the list of packages to your direct dependencies.
- --strict: Return a non-zero exit code when there are outdated packages.
- --format (-f): Lets you pick between text (default) or json output format.
outdated#
The outdated
command shows a list of installed packages that have updates available,including their current and latest versions. This is basically an alias forcomposer show -lo
.
The color coding is as such:
- green (=): Dependency is in the latest version and is up to date.
- yellow (
~
): Dependency has a new version available that includes backwards compatibility breaks according to semver, so upgrade whenyou can but it may involve work. - red (!): Dependency has a new version that is semver-compatible and you should upgrade it.
Options
- --all (-a): Show all packages, not just outdated (alias for
composer show -l
). - --direct (-D): Restricts the list of packages to your direct dependencies.
- --strict: Returns non-zero exit code if any package is outdated.
- --minor-only (-m): Only shows packages that have minor SemVer-compatible updates.
- --format (-f): Lets you pick between text (default) or json output format.
- --no-dev: Do not show outdated dev dependencies.
- --locked: Shows updates for packages from the lock file, regardless of what is currently in vendor dir.
browse / home#
The browse
(aliased to home
) opens a package's repository URL or homepagein your browser.
Options
- --homepage (-H): Open the homepage instead of the repository URL.
- --show (-s): Only show the homepage or repository URL.
suggests#
Lists all packages suggested by currently installed set of packages. You canoptionally pass one or multiple package names in the format of vendor/package
to limit output to suggestions made by those packages only.
Use the --by-package
(default) or --by-suggestion
flags to group the output bythe package offering the suggestions or the suggested packages respectively.
If you only want a list of suggested package names, use --list
.
Options
- --by-package: Groups output by suggesting package (default).
- --by-suggestion: Groups output by suggested package.
- --all: Show suggestions from all dependencies, including transitive ones (bydefault only direct dependencies' suggestions are shown).
- --list: Show only list of suggested package names.
- --no-dev: Excludes suggestions from
require-dev
packages.
fund#
Discover how to help fund the maintenance of your dependencies. This listsall funding links from the installed dependencies.
depends (why)#
The depends
command tells you which other packages depend on a certainpackage. As with installation require-dev
relationships are only consideredfor the root package.
You can optionally specify a version constraint after the package to limit thesearch.
Add the --tree
or -t
flag to show a recursive tree of why the package isdepended upon, for example:
Options
- --recursive (-r): Recursively resolves up to the root package.
- --tree (-t): Prints the results as a nested tree, implies -r.
prohibits (why-not)#
The prohibits
command tells you which packages are blocking a given packagefrom being installed. Specify a version constraint to verify whether upgradescan be performed in your project, and if not why not. See the followingexample:
Note that you can also specify platform requirements, for example to checkwhether you can upgrade your server to PHP 8.0:
As with depends
you can request a recursive lookup, which will list allpackages depending on the packages that cause the conflict.
Options
- --recursive (-r): Recursively resolves up to the root package.
- --tree (-t): Prints the results as a nested tree, implies -r.
validate#
You should always run the validate
command before you commit yourcomposer.json
file, and before you tag a release. It will check if yourcomposer.json
is valid.
Options
- --no-check-all: Do not emit a warning if requirements in
composer.json
use unbound or overly strict version constraints. - --no-check-lock: Do not emit an error if
composer.lock
exists and is not up to date. - --no-check-publish: Do not emit an error if
composer.json
is unsuitable for publishing as a package on Packagist but is otherwise valid. - --with-dependencies: Also validate the composer.json of all installed dependencies.
- --strict: Return a non-zero exit code for warnings as well as errors.
status#
If you often need to modify the code of your dependencies and they areinstalled from source, the status
command allows you to check if you havelocal changes in any of them.
With the --verbose
option you get some more information about what waschanged:
self-update (selfupdate)#
To update Composer itself to the latest version, run the self-update
command. It will replace your composer.phar
with the latest version.
If you would like to instead update to a specific release specify it:
If you have installed Composer for your entire system (see global installation),you may have to run the command with root
privileges
If Composer was not installed as a PHAR, this command is not available.(This is sometimes the case when Composer was installed by an operating system package manager.)
Options
- --rollback (-r): Rollback to the last version you had installed.
- --clean-backups: Delete old backups during an update. This makes thecurrent version of Composer the only backup available after the update.
- --no-progress: Do not output download progress.
- --update-keys: Prompt user for a key update.
- --stable: Force an update to the stable channel.
- --preview: Force an update to the preview channel.
- --snapshot: Force an update to the snapshot channel.
config#
The config
command allows you to edit composer config settings and repositoriesin either the local composer.json
file or the global config.json
file.
Additionally it lets you edit most properties in the local composer.json
.
Usage#
config [options] [setting-key] [setting-value1] ... [setting-valueN]
setting-key
is a configuration option name and setting-value1
is aconfiguration value. For settings that can take an array of values (likegithub-protocols
), more than one setting-value arguments are allowed.
You can also edit the values of the following properties:
description
, homepage
, keywords
, license
, minimum-stability
,name
, prefer-stable
, type
and version
.
See the Config chapter for valid configuration options.
Options
- --global (-g): Operate on the global config file located at
$COMPOSER_HOME/config.json
by default. Without this option, this commandaffects the local composer.json file or a file specified by--file
. - --editor (-e): Open the local composer.json file using in a text editor asdefined by the
EDITOR
env variable. With the--global
option, this opensthe global config file. - --auth (-a): Affect auth config file (only used for --editor).
- --unset: Remove the configuration element named by
setting-key
. - --list (-l): Show the list of current config variables. With the
--global
option this lists the global configuration only. - --file='...' (-f): Operate on a specific file instead of composer.json. Notethat this cannot be used in conjunction with the
--global
option. - --absolute: Returns absolute paths when fetching
*-dir
config valuesinstead of relative. - --json: JSON decode the setting value, to be used with
extra.*
keys. - --merge: Merge the setting value with the current value, to be used with
extra.*
keys in combination with--json
.
Modifying Repositories#
In addition to modifying the config section, the config
command also supports makingchanges to the repositories section by using it the following way:
If your repository requires more configuration options, you can instead pass its JSON representation :
Modifying Extra Values#
In addition to modifying the config section, the config
command also supports makingchanges to the extra section by using it the following way:
The dots indicate array nesting, a max depth of 3 levels is allowed though. The abovewould set 'extra': { 'foo': { 'bar': 'value' } }
.
If you have a complex value to add/modify, you can use the --json
and --merge
flagsto edit extra fields as json:
create-project#
You can use Composer to create new projects from an existing package. This isthe equivalent of doing a git clone/svn checkout followed by a composer install
of the vendors.
There are several applications for this:
- You can deploy application packages.
- You can check out any package and start developing on patches for example.
- Projects with multiple developers can use this feature to bootstrap theinitial application for development.
To create a new project using Composer you can use the create-project
command.Pass it a package name, and the directory to create the project in. You can alsoprovide a version as third argument, otherwise the latest version is used.
If the directory does not currently exist, it will be created during installation.
It is also possible to run the command without params in a directory with anexisting composer.json
file to bootstrap a project.
By default the command checks for the packages on packagist.org.
Options
- --stability (-s): Minimum stability of package. Defaults to
stable
. - --prefer-source: Install packages from
source
when available. - --prefer-dist: Install packages from
dist
when available. - --repository: Provide a custom repository to search for the package,which will be used instead of packagist. Can be either an HTTP URL pointingto a
composer
repository, a path to a localpackages.json
file, or aJSON string which similar to what the repositorieskey accepts. You can use this multiple times to configure multiple repositories. - --add-repository: Add the custom repository in the composer.json. If a lockfile is present it will be deleted and an update will be run instead of install.
- --dev: Install packages listed in
require-dev
. - --no-dev: Disables installation of require-dev packages.
- --no-scripts: Disables the execution of the scripts defined in the rootpackage.
- --no-progress: Removes the progress display that can mess with someterminals or scripts which don't handle backspace characters.
- --no-secure-http: Disable the secure-http config option temporarily whileinstalling the root package. Use at your own risk. Using this flag is a badidea.
- --keep-vcs: Skip the deletion of the VCS metadata for the createdproject. This is mostly useful if you run the command in non-interactivemode.
- --remove-vcs: Force-remove the VCS metadata without prompting.
- --no-install: Disables installation of the vendors.
- --ignore-platform-reqs: ignore all platform requirements (
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machine doesnot fulfill these.See also theplatform
config option. - --ignore-platform-req: ignore a specific platform requirement(
php
,hhvm
,lib-*
andext-*
) and force the installation even if the local machinedoes not fulfill it. - --ask: Ask user to provide target directory for new project.
dump-autoload (dumpautoload)#
If you need to update the autoloader because of new classes in a classmappackage for example, you can use dump-autoload
to do that without having togo through an install or update.
Additionally, it can dump an optimized autoloader that converts PSR-0/4 packagesinto classmap ones for performance reasons. In large applications with manyclasses, the autoloader can take up a substantial portion of every request'stime. Using classmaps for everything is less convenient in development, butusing this option you can still use PSR-0/4 for convenience and classmaps forperformance.
Options
- --no-scripts: Skips the execution of all scripts defined in
composer.json
file. - --optimize (-o): Convert PSR-0/4 autoloading to classmap to get a fasterautoloader. This is recommended especially for production, but can takea bit of time to run, so it is currently not done by default.
- --classmap-authoritative (-a): Autoload classes from the classmap only.Implicitly enables
--optimize
. - --apcu: Use APCu to cache found/not-found classes.
- --apcu-prefix: Use a custom prefix for the APCu autoloader cache.Implicitly enables
--apcu
. - --no-dev: Disables autoload-dev rules.
- --ignore-platform-reqs: ignore all
php
,hhvm
,lib-*
andext-*
requirements and skip the platform check for these.See also theplatform
config option. - --ignore-platform-req: ignore a specific platform requirement (
php
,hhvm
,lib-*
andext-*
) and skip the platform check for it.
clear-cache / clearcache / cc#
Deletes all content from Composer's cache directories.
licenses#
Lists the name, version and license of every package installed. Use--format=json
to get machine-readable output.
Options
- --format: Format of the output: text, json or summary (default: 'text')
- --no-dev: Remove dev dependencies from the output
run-script#
Options
- --timeout: Set the script timeout in seconds, or 0 for no timeout.
- --dev: Sets the dev mode.
- --no-dev: Disable dev mode.
- --list (-l): List user defined scripts.
To run scripts manually you can use this command,give it the script name and optionally any required arguments.
exec#
No Script For Mac
Executes a vendored binary/script. You can execute any command and this willensure that the Composer bin-dir is pushed on your PATH before the commandruns.
Options
- --list (-l): List the available composer binaries.
diagnose#
If you think you found a bug, or something is behaving strangely, you mightwant to run the diagnose
command to perform automated checks for many commonproblems.
archive#
This command is used to generate a zip/tar archive for a given package in agiven version. It can also be used to archive your entire project withoutexcluded/ignored files.
Options
- --format (-f): Format of the resulting archive: tar or zip (default:'tar')
- --dir: Write the archive to this directory (default: '.')
- --file: Write the archive with the given file name.
help#
To get more information about a certain command, you can use help
.
Command-line completion#
Command-line completion can be enabled by following instructionson this page.
Environment variables#
You can set a number of environment variables that override certain settings.Whenever possible it is recommended to specify these settings in the config
section of composer.json
instead. It is worth noting that the env vars willalways take precedence over the values specified in composer.json
.
COMPOSER#
By setting the COMPOSER
env variable it is possible to set the filename ofcomposer.json
to something else.
For example:
The generated lock file will use the same name: composer-other.lock
in this example.
COMPOSER_ALLOW_SUPERUSER#
If set to 1, this env disables the warning about running commands as root/super user.It also disables automatic clearing of sudo sessions, so you should really only set thisif you use Composer as super user at all times like in docker containers.
COMPOSER_ALLOW_XDEBUG#
If set to 1, this env allows running Composer when the Xdebug extension is enabled, without restarting PHP without it.
COMPOSER_AUTH#
The COMPOSER_AUTH
var allows you to set up authentication as an environment variable.The contents of the variable should be a JSON formatted object containing http-basic,github-oauth, bitbucket-oauth, ... objects as needed,and following thespec from the config.
COMPOSER_BIN_DIR#
By setting this option you can change the bin
(Vendor Binaries)directory to something other than vendor/bin
.
COMPOSER_CACHE_DIR#
The COMPOSER_CACHE_DIR
var allows you to change the Composer cache directory,which is also configurable via the cache-dir
option.
By default, it points to $COMPOSER_HOME/cache
on *nix and macOS, andC:Users<user>AppDataLocalComposer
(or %LOCALAPPDATA%/Composer
) on Windows.
COMPOSER_CAFILE#
By setting this environmental value, you can set a path to a certificate bundlefile to be used during SSL/TLS peer verification.
COMPOSER_DISABLE_XDEBUG_WARN#
If set to 1, this env suppresses a warning when Composer is running with the Xdebug extension enabled.
COMPOSER_DISCARD_CHANGES#
This env var controls the discard-changes
config option.
COMPOSER_HOME#
The COMPOSER_HOME
var allows you to change the Composer home directory. Thisis a hidden, global (per-user on the machine) directory that is shared betweenall projects.
By default, it points to C:Users<user>AppDataRoamingComposer
on Windowsand /Users/<user>/.composer
on macOS. On *nix systems that follow the XDG BaseDirectory Specifications,it points to $XDG_CONFIG_HOME/composer
. On other *nix systems, it points to/home/<user>/.composer
.
COMPOSER_HOME/config.json#
You may put a config.json
file into the location which COMPOSER_HOME
pointsto. Composer will merge this configuration with your project's composer.json
when you run the install
and update
commands.
This file allows you to set repositories andconfiguration for the user's projects.
In case global configuration matches local configuration, the localconfiguration in the project's composer.json
always wins.
COMPOSER_HTACCESS_PROTECT#
Defaults to 1
. If set to 0
, Composer will not create .htaccess
files in thecomposer home, cache, and data directories.
COMPOSER_MEMORY_LIMIT#
If set, the value is used as php's memory_limit.
COMPOSER_MIRROR_PATH_REPOS#
If set to 1, this env changes the default path repository strategy to mirror
insteadof symlink
. As it is the default strategy being set it can still be overwritten byrepository options.
COMPOSER_NO_INTERACTION#
If set to 1, this env var will make Composer behave as if you passed the--no-interaction
flag to every command. This can be set on build boxes/CI.
COMPOSER_PROCESS_TIMEOUT#
This env var controls the time Composer waits for commands (such as gitcommands) to finish executing. The default value is 300 seconds (5 minutes).
COMPOSER_ROOT_VERSION#
By setting this var you can specify the version of the root package, if itcannot be guessed from VCS info and is not present in composer.json
.
Noscript For Mac
COMPOSER_VENDOR_DIR#
By setting this var you can make Composer install the dependencies into adirectory other than vendor
.
http_proxy or HTTP_PROXY#
If you are using Composer from behind an HTTP proxy, you can use the standardhttp_proxy
or HTTP_PROXY
env vars. Set it to the URL of your proxy.Many operating systems already set this variable for you.
Using http_proxy
(lowercased) or even defining both might be preferable sincesome tools like git or curl will only use the lower-cased http_proxy
version.Alternatively you can also define the git proxy usinggit config --global http.proxy <proxy url>
.
If you are using Composer in a non-CLI context (i.e. integration into a CMS orsimilar use case), and need to support proxies, please provide the CGI_HTTP_PROXY
environment variable instead. See httpoxy.org for furtherdetails.
HTTP_PROXY_REQUEST_FULLURI#
If you use a proxy, but it does not support the request_fulluri flag, then youshould set this env var to false
or 0
to prevent Composer from setting therequest_fulluri option.
HTTPS_PROXY_REQUEST_FULLURI#
If you use a proxy, but it does not support the request_fulluri flag for HTTPSrequests, then you should set this env var to false
or 0
to prevent Composerfrom setting the request_fulluri option.
COMPOSER_SELF_UPDATE_TARGET#
If set, makes the self-update command write the new Composer phar file into that path instead of overwriting itself. Useful for updating Composer on read-only filesystem.
no_proxy or NO_PROXY#
If you are behind a proxy and would like to disable it for certain domains, youcan use the no_proxy
or NO_PROXY
env var. Set it to a comma separated list ofdomains the proxy should not be used for.
The env var accepts domains, IP addresses, and IP address blocks in CIDRnotation. You can restrict the filter to a particular port (e.g. :80
). Youcan also set it to *
to ignore the proxy for all HTTP requests.
COMPOSER_DISABLE_NETWORK#
If set to 1
, disables network access (best effort). This can be used for debugging orto run Composer on a plane or a starship with poor connectivity.
If set to prime
, GitHub VCS repositories will prime the cache, so it can then be usedfully offline with 1
.
COMPOSER_DEBUG_EVENTS#
If set to 1
, outputs information about events being dispatched, which can beuseful for plugin authors to identify what is firing when exactly.
← Libraries | Schema →
Found a typo? Something is wrong in this documentation? Fork and edit it!