composer配置文件各字段記錄

composer配置文件各字段記錄

官網鏈接php

composer 配置文件內容

name

  • 所有小寫,格式是vendor/className

description

  • 只能有一行

version

  • X.Y.Z
  • vX.Y.Z
  • X.Y.Z-dev 除了-dev,還能夠有-patch -alpha -beta -RC

type

  • library 默認值,表示包
  • project 項目
  • metapackage 空包
  • composer-plugin 官網連接

keywords

  • 可選值,主要用於搜索和過濾

homepage

  • 項目主頁

time

  • 版本發佈時間

license

  • Apache-2.0
  • BSD-2-Clause
  • BSD-3-Clause
  • BSD-4-Clause
  • GPL-2.0
  • GPL-2.0+
  • GPL-3.0
  • GPL-3.0+
  • LGPL-2.1
  • LGPL-2.1+
  • LGPL-3.0
  • LGPL-3.0+
  • MIT

authors

  • name
  • email
  • homepage
  • role

support

  • email
  • issues
  • forum
  • wiki
  • irc
  • source

suggest

autoload

autoload-dev (root-only)

include_path (Not-Suggested)

  • 將下列路徑加入PHPinclude_path的路徑中

target-dir

  • 爲了解決命名空間與項目實際安裝位置存在衝突時,指定安裝路徑

minimum-stability (root-only)

  • stable
  • dev
  • alpha
  • beta
  • RC

prefer-stable (root-only)

repositories (root-only)

指定除了packagist以外的資源庫.html

  • composer
  • vcs
  • pear
  • package

官網資料git

config (root-only)

  • process-timeout 數字,進程處理最大時間
  • use-include-path true/false,是否從PHPinclude_path中查找類
  • preferred-install auto/dist/source,首先嚐試從哪裏下載類
  • github-protocols git/https/ssh,從git克隆項目時採用的協議
  • github-oauth 訪問github的私人倉庫 官網資料
  • vendor-dir 擴展安裝目錄,默認是vendor
  • bin-dir 默認是vendor/bin官網資料
  • cache-dir 緩存保存路徑
  • cache-files-dir
  • cache-repo-dir
  • cache-vcs-dir
  • cache-files-ttl 緩存文件保存時間
  • cache-files-maxsize 緩存最大時間
  • prepend-autoloader 不講autoloader.php加入到自動加載中
  • autoloader-suffix 做用不知
  • autoloader-suffix
  • optimize-autoloader
  • github-domains
  • notify-on-install
  • discard-changes

scripts (root-only)

extra

bin

archive

  • exclude

下面提到的全部對象,都應該是 包名 到 版本 的映射對象。

require

  • {packageName:version}

require-dev (root-only)

conflict

replace

provide