In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to configure information in composer.json, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Config
Below, the composer command uses the tutorials column to introduce you to the configuration-related information in composer.json.
Process-timeout request process timeout setting
The default request timeout is set to 300 seconds, and as with Clone using Git, Composer can run until the request times out until the installation is complete. If your network is not fast enough, or if you have a lot of content to load, you can set the timeout higher.
Use-include-path uses include path settings
The default setting is false, and if set to true, the Composer autoloader automatically looks for classes contained in the PHP path.
Preferred-install installation preference Settings
Auto mode is set by default, which can be set to source, dist or auto mode. This option allows you to set Composer to your preferred mode. For more precise installation preference settings, you can use hash mode.
{"config": {"preferred-install": {"my-organization/stable-package": "dist", "my-organization/*": "source", "partner-organization/*": "auto", "*": "dist"}
Note that it is important to set the order in which option modes are used. The precise setting mode should be used before the broad setting mode for the precise mode setting to take effect. In global and package settings, when a string is mixed with a hash, the string setting item is converted to * mode.
Store-auths
There are three options for actions taken after verifying the pop-up box:
True always stores authentication information
False does not store authentication information
"prompt" requires revalidation each time, which is the default.
Github-protocols
Default is ["https", "ssh", "git"]. The protocol priority list used when cloning from github.com, git protocol is not encrypted transfer, so only if the secure-http entry is set to off, the git protocol will be preferred for cloning. If you want to set up remote Push URL to use HTTPS protocol instead of SSH (git@github.com:...) Protocol, you can just set ["https"] so that Composer will stop rewriting Push URL to SSH protocol.
Github-oauth
A list of domain names and Oauth Keys. For example, using {"github.com": "oauthtoken"} as the value of this option, oauthtoken will be used to access private repositories on github and bypass IP-based API usage frequency. Click here for information on how to get the OAuth token of GitHub.
Gitlab-oauth
A list of domain names and Oauth Keys. For example, using {"gitlab.com": "oauthtoken"} as the value of this option, oauthtoken will be used to access the private warehouse on Gitlab. Please note: if your code is not hosted on gitlab.com, you also need to configure this parameter-gitlab-domains.
Gitlab-token
A list of domain names and Private Token. For example, using {"gitlab.com": "privatetoken"} as the value of this option, privatetoken will be used to access the private warehouse on Gitlab. Please note: if your code is not hosted on gitlab.com, you must also specify this parameter-gitlab-domains.
Disable-tls
The default is false. If set to true, all HTTPS URL will be replaced with HTTP, and network layer encryption will not be used. Turning on this option has a security risk, so it is not recommended to turn it on. A better way is to open the php_openssl extension in php.ini.
Secure-http
The default is true. If set to true, only HTTPS URL is allowed to be used in Composer. If you are sure you need to use HTTP to access something, you can turn it off, but using a vendor like Let's Encrypt to get a free SSL certificate is a better choice.
Bitbucket-oauth
A list of domain names and user names. For example, use {"bitbucket.org": {"consumer-key": "myKey", "consumer-secret": "mySecret"}}. For more information, see learn how to create a consumer in BitBucket.
Cafile
The location of the authentication certificate in the local file system. In PHP 5.6 + you should set it through openssl.cafile in php.ini, although this is automatically obtained in PHP 5.6 +.
Capath
If the certificate file is not specified or the certificate is not found in that location, the system looks for an appropriate certificate in the file specified by capath. Capath must be a directory where the certificate encrypted by the correct hash exists.
Http-basic
A list of domain names and user names and passwords required for storage authentication. For example, using {"example.org": {"username": "alice", "password": "foo"}} as its value will let Composer authenticate example.org with the specified username and password.
Note: settings related to validation, such as http-basic and github-oauth, can also be defined in the auth.json file, away from composer.json. In this way you can have Git ignore it, and each developer can store their own authentication credentials.
Platform
Lets you disguise the platform extension pack (PHP and its extensions) to simulate the production environment and define your target platform in the settings. For example: {"php": "7.0.3", "ext-something": "4.0.3"}.
Vendor-dir
The default is vendor. You can also install the required dependencies in a different directory. $HOME and ~ will be replaced with your HOME directory in vendor and all the *-dir directories below.
Bin-dir
The default is vendor/bin. If a project contains executable files, they will make symbolic links in this directory.
Data-dir
The default is C:\ Users\\ AppData\ Roaming\ Composer in WIndows, $XDG_DATA_HOME/composer in unix systems that follow the XDG directory definition, and $home in other unix systems. Now it is only used to store older versions of composer.phar files in case of rollback. See COMPOSER_HOME for details.
Cache-dir
The default is C:\ Users\\ AppData\ Local\ Composer in WIndows, $XDG_CACHE_HOME/composer in unix systems that follow the XDG directory definition, and $home/cache in other unix systems. Stores all cache files used by Composer. See COMPOSER_HOME for details.
Cache-files-dir
The default is $cache-dir/files. A ZIP package that stores all expansion packages.
Cache-repo-dir
The default is $cache-dir/repo. A VCS repository that stores metadata for composer type repositories and svn, fossil, github, and bitbucket type repositories.
Cache-vcs-dir
The default is $cache-dir/vcs. Store all files cloned by the git/hg type repository to speed up installation.
Cache-files-ttl
The default is 15552000 (6 months). Composer caches files built by all expansion packs it downloads (zip, tar,..). If you don't use it for 6 months by default, it will be emptied. This setting allows you to change the expiration time (in seconds) or set it to 0 to disable it completely.
Cache-files-maxsize
The default is 300MiB. Composer caches files built by all expansion packs it downloads (zip, tar,..). This is the maximum amount of space it allows cache files to occupy when performing garbage collection on a regular basis. Older or infrequently used caches are cleared.
Bin-compat
The default is auto. Determines the compatibility required for the installation of executables. If set to auto, only .bat files are installed in Windows. If set to full, the script files required by the unix system will also be installed in addition to .bat. This is mainly to deal with the inconsistency between the execution of Composer and the system on which the project is running.
Prepend-autoloader
The default is true. If the autoloader is set to false,Composer, it will not be preloaded into the existing autoloader. This can sometimes be used to fix problems caused by sharing with other loaders.
Autoloader-suffix
The default is null. The string that will be used as the suffix of the Composer autoloader. If empty, a set of random strings is generated.
Optimize-autoloader
The default is false. If set to true, optimizations are always made when the autoloader is generated.
Sort-packages
The default is false. If set to true, the extension package names in the composer.json file are always kept alphabetically when the require command is executed.
Classmap-authoritative
The default is false. If set to true,Composer autoloader, only classes in classmap will be loaded. This item enables optimize-autoloader.
Apcu-autoloader
The default is false. If set to true,Composer, the autoloader checks APCu and uses it to cache found and unfound classes when the extension is enabled.
Github-domains
The default is ["github.com"]. A list of domain names used in gitHub mode. This may be used by GitHub Enterprise.
Github-expose-hostname
The default is true. If set to false, the OAuth token created to access Github API will have a date instead of a hostname.
Gitlab-domains
The default is ["gitlab.com"]. A list of domain names for the Gitlab server. This may be used if you are using the gitlab repository type.
Notify-on-install
The default is true. Composer allows the repository to define a notification URL to receive notifications when extension packs based on this repository are installed. This allows you to disable this behavior.
Discard-changes
The default is false and can be set to true,false or "stash". This allows you to set the default behavior in the event of a conflict during the upgrade process. True discards changes in vendors, while "stash" tries to save them temporarily for recovery. You can use this setting if your CI server or deployment script may change vendors.
Archive-format
The default is tar. Composer allows you to set the default compression format when the workflow needs to create a specific format package.
Archive-dir
The default is... Composer allows you to set the default storage path for compressed files when the workflow needs to create a specific format package. It also makes it easier to develop between modules.
For example:
{"config": {"archive-dir": "/ home/user/.composer/repo"}}
Htaccess-protect
The default is true. If set to false,Composer, the .htaccess file is not created in the COMPOSER_HOME, cache, and data directories.
Thank you for reading this article carefully. I hope the article "how to configure Information in composer.json" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.