The following column will introduce you to the Composer generation environment from the composer tutorial column, I hope it will be helpful to friends in need!
composer analysis
If you are in a hurry, please go directly to the last command
composer configuration items
For specific details of each configuration item, please refer to the Composer official website
Configuration list
ID | Configuration Item | Description |
---|---|---|
1 | name |
The name of the package, It includes the vendor name and project name, separated by /. |
2 | description |
Package description |
3 | version |
Version |
4 | type | ##Installation Type|
keywords
| Keywords||
homepage
| Project Homepage||
time
| Version Release Time||
license
| License Agreement||
authors
| author||
support | Support, obtain the related information objects supported by the project. ||
require
| Auto-loaded package||
require-dev |
Package automatically loaded under DEV |
|
conflict |
The packages in this list conflict with this version of the current package. They will not be allowed to be installed at the same time Package good work. These are just messages and are displayed after the dependent packages have been installed to give your users a suggestion as to which more packages they can add. |
|
autoload |
Automatic loading, there are four loading mechanisms | psr-4psr-0 |
file |
| ##16
include-path
Retain tradition, it is not recommended to use
| 17
to define the current package Installation target folder
|
18 | |
When installing the package, filter the package by stability by default Behavior, dev | alphabeta | |
stable | Optional
|
19
prefer-stable When installing packages, give priority to using more stable package versions, "prefer-stable": true
|
repositories |
Use custom package resource libraries. By default composer only uses packagist as the package repository. By specifying a resource library, you can obtain resource bundles from elsewhere. |
21 |
Configuration parameters, eg: process-timeout | vendor -dir||
22 | scripts |
Composer allows you to hook scripts at various stages during the installation process .
23 |
Any extra data for use by scripts . |
||
bin |
This attribute is used to mark a group of files that should be considered binary scripts. They will It is soft-linked to the directory marked by the bin-dir attribute (in the config object) for calling by other dependent packages. |
25 |
These options are used when creating a package archive.
|
Development configuration details | |
require |
|
Identifier |
"barryvdh/laravel-cors": "^0.10.0" | Install the latest version of laravel-cors||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Identifies the last interval version installed |
"barryvdh/laravel-cors": "~0.10.0", | Install laravel-cors 0.10.0-0.10.9
|
||||||||||||
CMD | 说明 | 应用场景 |
---|---|---|
composer dump-autoload |
打印自动加载索引,就是将 autoload 中的各项加载到本该指定的目录。 |
开发环境 你更新了 autoload 中的各项, |
composer dump-autoload -o |
转换 PSR-0/4 autoloading 到 classmap 获得更快的载入速度 | 适用于生产环境 |
composer dump-autoload -o --no-dev |
禁用 autoload-dev 规则 | 适用于生产环境 |
composer dump-autoload --classmap-authoritative |
只加载 ClassMap中的文件,必到磁盘文件系统进行任何检查 | 适用于生产环境 |
因此生产请使用
composer dump-autoload -o --no-dev --classmap-authoritative
The above is the detailed content of What does Composer look like in your production environment?. For more information, please follow other related articles on the PHP Chinese website!

本文由composer教程栏目给大家介绍关于在Debian11上是怎么一步步安装,以及使用Composer的 ,非常详细哦~希望对需要的朋友有所帮助!

Composer是PHP的依赖管理工具,它允许开发者将第三方库和框架与自己的项目进行集成。它的主要功能包括:1、依赖管理;2、版本控制;3、自动加载;4、扩展开发;5、集成其他工具。它简化了PHP项目的依赖管理过程,确保项目的稳定性和可维护性。通过使用Composer,开发者可以更加高效地管理自己的项目和集成第三方库和框架。

composer修改php路径的方法:1、搜索“composer.bat”并复制到项目文件夹;2、编辑“composer.bat”,将内容修改为“@ECHO OFF php "%~dp0composer.phar" %*”即可。

在PHP开发中,我们经常要处理各种依赖包,这些依赖包可能是其他开发者编写的PHP库文件,也可能是一些第三方工具和框架。为了方便管理这些依赖包,我们可以使用Composer来进行相关的安装和管理工作。Composer是一个开源的PHP依赖管理工具,它可以帮助我们自动化安装、更新和卸载PHP依赖包。通过Composer,我们可以轻松地管理我们应用中的不同依赖,同

Composer是一个PHP的依赖管理工具,可以帮助开发者有效地管理项目中的依赖关系。通过Composer,我们可以轻松地引入第三方库、框架以及其他项目所需的各种资源。创建一个Composer项目非常简单,只需按照以下步骤进行操作:首先需要确保在本地已经安装了Composer。可以在终端中运行composer-v命令来确认是否已经安装成功。在项目的根目录中

随着PHP的日益流行,PHP开发人员面临着许多挑战,其中包括代码管理、可重用性和依赖性管理。这些问题可以使用包管理器来解决,而Composer是PHP最受欢迎的包管理器之一。在本文中,我们将探讨使用Composer和PHP包管理器的最佳实践,从而提高您的PHP开发效率和代码质量。何为Composer?Composer是一款PHP包管理器,它可以轻松管理PHP

composer是PHP的依赖管理工具,可以方便地安装、更新和管理项目所需的第三方库和依赖。本文将介绍composer的安装与使用,并提供详细的代码示例。一、安装Composer要使用composer,首先需要将其安装到本地开发环境中。以下演示了在Windows系统中安装composer的步骤:打开Composer的官方网站(https://getcompo

要保存 Composer 动画,可以使用 Lottie 文件格式,具体步骤为:导出为 JSON 文件;使用 Lottie 工具创建 Lottie 文件;从 Lottie 文件导出为多种格式,包括 JSON、GIF、MP4、SWF、HTML。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version
God-level code editing software (SublimeText3)
