Home  >  Article  >  Development Tools  >  About the configuration settings of composer.json

About the configuration settings of composer.json

藏色散人
藏色散人forward
2020-08-15 15:32:105048browse

The following tutorial column from composer will tell you about the configuration settings of composer.json. I hope it will be helpful to friends in need!

About the configuration settings of composer.json

The value of the configuration file is key:val and must be wrapped in double quotes

# #1. Configuration file

Name nameThe package name consists of the user name and the warehouse name
Package version restrictions to request the Monolog package 1.0 .*. This means any version in the 1.0 development branch, or any version greater than or equal to 1.0 and less than 1.1 (>=1.0 8b3bb043a4262e736f1f51639dfa5b6d=1.0, >=1.0, 8aeaf7e3f7eb6ecdcf166f4926dd8a46等同于  使用包里的 lib\类文件---->类名

再次运行composer dump-autoload

如果您需要在多个目录中搜索相同的前缀,则可以将它们指定为数组:

"autoload": {
          "psr-4": { "Monolog\\": ["src/", "lib/"] }
  }

如果您想要有一个可以在任何命名空间中查找的备用目录,您可以使用一个空的前缀,如:

  "autoload": {
          "psr-4": { ""exclude" }
  }

The above is the detailed content of About the configuration settings of composer.json. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete