composer-schema.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. {
  2. "name": "Package",
  3. "type": "object",
  4. "additionalProperties": false,
  5. "properties": {
  6. "name": {
  7. "type": "string",
  8. "description": "Package name, including 'vendor-name/' prefix.",
  9. "required": true
  10. },
  11. "type": {
  12. "description": "Package type, either 'library' for common packages, 'composer-installer' for custom installers, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.",
  13. "type": "string"
  14. },
  15. "target-dir": {
  16. "description": "Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.",
  17. "type": "string"
  18. },
  19. "description": {
  20. "type": "string",
  21. "description": "Short package description.",
  22. "required": true
  23. },
  24. "keywords": {
  25. "type": "array",
  26. "items": {
  27. "type": "string",
  28. "description": "A tag/keyword that this package relates to."
  29. }
  30. },
  31. "homepage": {
  32. "type": "string",
  33. "description": "Homepage URL for the project.",
  34. "format": "uri"
  35. },
  36. "version": {
  37. "type": "string",
  38. "description": "Package version, see http://getcomposer.org/doc/04-schema.md#version for more info on valid schemes."
  39. },
  40. "time": {
  41. "type": "string",
  42. "description": "Package release date, in 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' format."
  43. },
  44. "license": {
  45. "type": ["string", "array"],
  46. "description": "License name. Or an array of license names."
  47. },
  48. "authors": {
  49. "type": "array",
  50. "description": "List of authors that contributed to the package. This is typically the main maintainers, not the full list.",
  51. "items": {
  52. "type": "object",
  53. "additionalProperties": false,
  54. "properties": {
  55. "name": {
  56. "type": "string",
  57. "description": "Full name of the author.",
  58. "required": true
  59. },
  60. "email": {
  61. "type": "string",
  62. "description": "Email address of the author.",
  63. "format": "email"
  64. },
  65. "homepage": {
  66. "type": "string",
  67. "description": "Homepage URL for the author.",
  68. "format": "uri"
  69. },
  70. "role": {
  71. "type": "string",
  72. "description": "Author's role in the project."
  73. }
  74. }
  75. }
  76. },
  77. "require": {
  78. "type": "object",
  79. "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.",
  80. "additionalProperties": true
  81. },
  82. "replace": {
  83. "type": "object",
  84. "description": "This is a hash of package name (keys) and version constraints (values) that can be replaced by this package.",
  85. "additionalProperties": true
  86. },
  87. "conflict": {
  88. "type": "object",
  89. "description": "This is a hash of package name (keys) and version constraints (values) that conflict with this package.",
  90. "additionalProperties": true
  91. },
  92. "provide": {
  93. "type": "object",
  94. "description": "This is a hash of package name (keys) and version constraints (values) that this package provides in addition to this package's name.",
  95. "additionalProperties": true
  96. },
  97. "require-dev": {
  98. "type": "object",
  99. "description": "This is a hash of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).",
  100. "additionalProperties": true
  101. },
  102. "suggest": {
  103. "type": "object",
  104. "description": "This is a hash of package name (keys) and descriptions (values) that this package suggests work well with it (this will be suggested to the user during installation).",
  105. "additionalProperties": true
  106. },
  107. "config": {
  108. "type": "object",
  109. "description": "Composer options.",
  110. "properties": {
  111. "process-timeout": {
  112. "type": "integer",
  113. "description": "The timeout in seconds for process executions, defaults to 300 (5mins)."
  114. },
  115. "use-include-path": {
  116. "type": "boolean",
  117. "description": "If true, the Composer autoloader will also look for classes in the PHP include path."
  118. },
  119. "notify-on-install": {
  120. "type": "boolean",
  121. "description": "Composer allows repositories to define a notification URL, so that they get notified whenever a package from that repository is installed. This option allows you to disable that behaviour, defaults to true."
  122. },
  123. "github-protocols": {
  124. "type": "array",
  125. "description": "A list of protocols to use for github.com clones, in priority order, defaults to [\"git\", \"https\", \"http\"].",
  126. "items": {
  127. "type": "string"
  128. }
  129. },
  130. "github-oauth": {
  131. "type": "object",
  132. "description": "A hash of domain name => github API oauth tokens, typically {\"github.com\":\"<token>\"}.",
  133. "additionalProperties": true
  134. },
  135. "vendor-dir": {
  136. "type": "string",
  137. "description": "The location where all packages are installed, defaults to \"vendor\"."
  138. },
  139. "bin-dir": {
  140. "type": "string",
  141. "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
  142. },
  143. "cache-dir": {
  144. "type": "string",
  145. "description": "The location where all caches are located, defaults to \"~/.composer/cache\" on *nix and \"%LOCALAPPDATA%\\Composer\" on windows."
  146. },
  147. "cache-files-dir": {
  148. "type": "string",
  149. "description": "The location where files (zip downloads) are cached, defaults to \"{$cache-dir}/files\"."
  150. },
  151. "cache-repo-dir": {
  152. "type": "string",
  153. "description": "The location where repo (git/hg repo clones) are cached, defaults to \"{$cache-dir}/repo\"."
  154. },
  155. "cache-vcs-dir": {
  156. "type": "string",
  157. "description": "The location where vcs infos (git clones, github api calls, etc. when reading vcs repos) are cached, defaults to \"{$cache-dir}/vcs\"."
  158. },
  159. "cache-ttl": {
  160. "type": "integer",
  161. "description": "The default cache time-to-live, defaults to 15552000 (6 months)."
  162. },
  163. "cache-files-ttl": {
  164. "type": "integer",
  165. "description": "The cache time-to-live for files, defaults to the value of cache-ttl."
  166. },
  167. "cache-files-maxsize": {
  168. "type": ["string", "integer"],
  169. "description": "The cache max size for the files cache, defaults to \"300MiB\"."
  170. }
  171. }
  172. },
  173. "extra": {
  174. "type": ["object", "array"],
  175. "description": "Arbitrary extra data that can be used by custom installers, for example, package of type composer-installer must have a 'class' key defining the installer class name.",
  176. "additionalProperties": true
  177. },
  178. "autoload": {
  179. "type": "object",
  180. "description": "Description of how the package can be autoloaded.",
  181. "properties": {
  182. "psr-0": {
  183. "type": "object",
  184. "description": "This is a hash of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.",
  185. "additionalProperties": true
  186. },
  187. "classmap": {
  188. "type": "array",
  189. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  190. },
  191. "files": {
  192. "type": "array",
  193. "description": "This is an array of files that are always required on every request."
  194. }
  195. }
  196. },
  197. "repositories": {
  198. "type": ["object", "array"],
  199. "description": "A set of additional repositories where packages can be found.",
  200. "additionalProperties": true
  201. },
  202. "minimum-stability": {
  203. "type": ["string"],
  204. "description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable."
  205. },
  206. "bin": {
  207. "type": ["array"],
  208. "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
  209. "items": {
  210. "type": "string"
  211. }
  212. },
  213. "include-path": {
  214. "type": ["array"],
  215. "description": "DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.",
  216. "items": {
  217. "type": "string"
  218. }
  219. },
  220. "scripts": {
  221. "type": ["object"],
  222. "description": "Scripts listeners that will be executed before/after some events.",
  223. "properties": {
  224. "pre-install-cmd": {
  225. "type": ["array", "string"],
  226. "description": "Occurs before the install command is executed, contains one or more Class::method callables."
  227. },
  228. "post-install-cmd": {
  229. "type": ["array", "string"],
  230. "description": "Occurs after the install command is executed, contains one or more Class::method callables."
  231. },
  232. "pre-update-cmd": {
  233. "type": ["array", "string"],
  234. "description": "Occurs before the update command is executed, contains one or more Class::method callables."
  235. },
  236. "post-update-cmd": {
  237. "type": ["array", "string"],
  238. "description": "Occurs after the update command is executed, contains one or more Class::method callables."
  239. },
  240. "pre-package-install": {
  241. "type": ["array", "string"],
  242. "description": "Occurs before a package is installed, contains one or more Class::method callables."
  243. },
  244. "post-package-install": {
  245. "type": ["array", "string"],
  246. "description": "Occurs after a package is installed, contains one or more Class::method callables."
  247. },
  248. "pre-package-update": {
  249. "type": ["array", "string"],
  250. "description": "Occurs before a package is updated, contains one or more Class::method callables."
  251. },
  252. "post-package-update": {
  253. "type": ["array", "string"],
  254. "description": "Occurs after a package is updated, contains one or more Class::method callables."
  255. },
  256. "pre-package-uninstall": {
  257. "type": ["array", "string"],
  258. "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables."
  259. },
  260. "post-package-uninstall": {
  261. "type": ["array", "string"],
  262. "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables."
  263. }
  264. }
  265. },
  266. "support": {
  267. "type": "object",
  268. "properties": {
  269. "email": {
  270. "type": "string",
  271. "description": "Email address for support.",
  272. "format": "email"
  273. },
  274. "issues": {
  275. "type": "string",
  276. "description": "URL to the Issue Tracker.",
  277. "format": "uri"
  278. },
  279. "forum": {
  280. "type": "string",
  281. "description": "URL to the Forum.",
  282. "format": "uri"
  283. },
  284. "wiki": {
  285. "type": "string",
  286. "description": "URL to the Wiki.",
  287. "format": "uri"
  288. },
  289. "irc": {
  290. "type": "string",
  291. "description": "IRC channel for support, as irc://server/channel.",
  292. "format": "uri"
  293. },
  294. "source": {
  295. "type": "string",
  296. "description": "URL to browse or download the sources.",
  297. "format": "uri"
  298. }
  299. }
  300. }
  301. }
  302. }