composer-schema.json 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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-plugin' for plugins, '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": "DEPRECATED: 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. "preferred-install": {
  120. "type": "string",
  121. "description": "The install method Composer will prefer to use, defaults to auto and can be any of source, dist or auto."
  122. },
  123. "notify-on-install": {
  124. "type": "boolean",
  125. "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."
  126. },
  127. "github-protocols": {
  128. "type": "array",
  129. "description": "A list of protocols to use for github.com clones, in priority order, defaults to [\"git\", \"https\", \"http\"].",
  130. "items": {
  131. "type": "string"
  132. }
  133. },
  134. "github-oauth": {
  135. "type": "object",
  136. "description": "A hash of domain name => github API oauth tokens, typically {\"github.com\":\"<token>\"}.",
  137. "additionalProperties": true
  138. },
  139. "http-basic": {
  140. "type": "object",
  141. "description": "A hash of domain name => {\"username\": \"...\", \"password\": \"...\"}.",
  142. "additionalProperties": true
  143. },
  144. "store-auths": {
  145. "type": ["string", "boolean"],
  146. "description": "What to do after prompting for authentication, one of: true (store), false (do not store) or \"prompt\" (ask every time), defaults to prompt."
  147. },
  148. "vendor-dir": {
  149. "type": "string",
  150. "description": "The location where all packages are installed, defaults to \"vendor\"."
  151. },
  152. "bin-dir": {
  153. "type": "string",
  154. "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
  155. },
  156. "cache-dir": {
  157. "type": "string",
  158. "description": "The location where all caches are located, defaults to \"~/.composer/cache\" on *nix and \"%LOCALAPPDATA%\\Composer\" on windows."
  159. },
  160. "cache-files-dir": {
  161. "type": "string",
  162. "description": "The location where files (zip downloads) are cached, defaults to \"{$cache-dir}/files\"."
  163. },
  164. "cache-repo-dir": {
  165. "type": "string",
  166. "description": "The location where repo (git/hg repo clones) are cached, defaults to \"{$cache-dir}/repo\"."
  167. },
  168. "cache-vcs-dir": {
  169. "type": "string",
  170. "description": "The location where vcs infos (git clones, github api calls, etc. when reading vcs repos) are cached, defaults to \"{$cache-dir}/vcs\"."
  171. },
  172. "cache-ttl": {
  173. "type": "integer",
  174. "description": "The default cache time-to-live, defaults to 15552000 (6 months)."
  175. },
  176. "cache-files-ttl": {
  177. "type": "integer",
  178. "description": "The cache time-to-live for files, defaults to the value of cache-ttl."
  179. },
  180. "cache-files-maxsize": {
  181. "type": ["string", "integer"],
  182. "description": "The cache max size for the files cache, defaults to \"300MiB\"."
  183. },
  184. "discard-changes": {
  185. "type": ["string", "boolean"],
  186. "description": "The default style of handling dirty updates, defaults to false and can be any of true, false or \"stash\"."
  187. },
  188. "autoloader-suffix": {
  189. "type": "string",
  190. "description": "Optional string to be used as a suffix for the generated Composer autoloader. When null a random one will be generated."
  191. },
  192. "optimize-autoloader": {
  193. "type": "boolean",
  194. "description": "Always optimize when dumping the autoloader."
  195. },
  196. "prepend-autoloader": {
  197. "type": "boolean",
  198. "description": "If false, the composer autoloader will not be prepended to existing autoloaders, defaults to true."
  199. },
  200. "github-domains": {
  201. "type": "array",
  202. "description": "A list of domains to use in github mode. This is used for GitHub Enterprise setups, defaults to [\"github.com\"].",
  203. "items": {
  204. "type": "string"
  205. }
  206. }
  207. }
  208. },
  209. "extra": {
  210. "type": ["object", "array"],
  211. "description": "Arbitrary extra data that can be used by plugins, for example, package of type composer-plugin may have a 'class' key defining an installer class name.",
  212. "additionalProperties": true
  213. },
  214. "autoload": {
  215. "type": "object",
  216. "description": "Description of how the package can be autoloaded.",
  217. "properties": {
  218. "psr-0": {
  219. "type": "object",
  220. "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.",
  221. "additionalProperties": true
  222. },
  223. "psr-4": {
  224. "type": "object",
  225. "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.",
  226. "additionalProperties": true
  227. },
  228. "classmap": {
  229. "type": "array",
  230. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  231. },
  232. "files": {
  233. "type": "array",
  234. "description": "This is an array of files that are always required on every request."
  235. }
  236. }
  237. },
  238. "autoload-dev": {
  239. "type": "object",
  240. "description": "Description of additional autoload rules for development purpose (eg. a test suite).",
  241. "properties": {
  242. "psr-0": {
  243. "type": "object",
  244. "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.",
  245. "additionalProperties": true
  246. },
  247. "psr-4": {
  248. "type": "object",
  249. "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.",
  250. "additionalProperties": true
  251. },
  252. "classmap": {
  253. "type": "array",
  254. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  255. },
  256. "files": {
  257. "type": "array",
  258. "description": "This is an array of files that are always required on every request."
  259. }
  260. }
  261. },
  262. "archive": {
  263. "type": ["object"],
  264. "description": "Options for creating package archives for distribution.",
  265. "properties": {
  266. "exclude": {
  267. "type": "array",
  268. "description": "A list of patterns for paths to exclude or include if prefixed with an exclamation mark."
  269. }
  270. }
  271. },
  272. "repositories": {
  273. "type": ["object", "array"],
  274. "description": "A set of additional repositories where packages can be found.",
  275. "additionalProperties": true
  276. },
  277. "minimum-stability": {
  278. "type": ["string"],
  279. "description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable."
  280. },
  281. "prefer-stable": {
  282. "type": ["boolean"],
  283. "description": "If set to true, stable packages will be prefered to dev packages when possible, even if the minimum-stability allows unstable packages."
  284. },
  285. "bin": {
  286. "type": ["array"],
  287. "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
  288. "items": {
  289. "type": "string"
  290. }
  291. },
  292. "include-path": {
  293. "type": ["array"],
  294. "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.",
  295. "items": {
  296. "type": "string"
  297. }
  298. },
  299. "scripts": {
  300. "type": ["object"],
  301. "description": "Scripts listeners that will be executed before/after some events.",
  302. "properties": {
  303. "pre-install-cmd": {
  304. "type": ["array", "string"],
  305. "description": "Occurs before the install command is executed, contains one or more Class::method callables or shell commands."
  306. },
  307. "post-install-cmd": {
  308. "type": ["array", "string"],
  309. "description": "Occurs after the install command is executed, contains one or more Class::method callables or shell commands."
  310. },
  311. "pre-update-cmd": {
  312. "type": ["array", "string"],
  313. "description": "Occurs before the update command is executed, contains one or more Class::method callables or shell commands."
  314. },
  315. "post-update-cmd": {
  316. "type": ["array", "string"],
  317. "description": "Occurs after the update command is executed, contains one or more Class::method callables or shell commands."
  318. },
  319. "pre-status-cmd": {
  320. "type": ["array", "string"],
  321. "description": "Occurs before the status command is executed, contains one or more Class::method callables or shell commands."
  322. },
  323. "post-status-cmd": {
  324. "type": ["array", "string"],
  325. "description": "Occurs after the status command is executed, contains one or more Class::method callables or shell commands."
  326. },
  327. "pre-package-install": {
  328. "type": ["array", "string"],
  329. "description": "Occurs before a package is installed, contains one or more Class::method callables or shell commands."
  330. },
  331. "post-package-install": {
  332. "type": ["array", "string"],
  333. "description": "Occurs after a package is installed, contains one or more Class::method callables or shell commands."
  334. },
  335. "pre-package-update": {
  336. "type": ["array", "string"],
  337. "description": "Occurs before a package is updated, contains one or more Class::method callables or shell commands."
  338. },
  339. "post-package-update": {
  340. "type": ["array", "string"],
  341. "description": "Occurs after a package is updated, contains one or more Class::method callables or shell commands."
  342. },
  343. "pre-package-uninstall": {
  344. "type": ["array", "string"],
  345. "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables or shell commands."
  346. },
  347. "post-package-uninstall": {
  348. "type": ["array", "string"],
  349. "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables or shell commands."
  350. },
  351. "pre-autoload-dump": {
  352. "type": ["array", "string"],
  353. "description": "Occurs before the autoloader is dumped, contains one or more Class::method callables or shell commands."
  354. },
  355. "post-autoload-dump": {
  356. "type": ["array", "string"],
  357. "description": "Occurs after the autoloader is dumped, contains one or more Class::method callables or shell commands."
  358. },
  359. "post-root-package-install": {
  360. "type": ["array", "string"],
  361. "description": "Occurs after the root-package is installed, contains one or more Class::method callables or shell commands."
  362. },
  363. "post-create-project-cmd": {
  364. "type": ["array", "string"],
  365. "description": "Occurs after the create-project command is executed, contains one or more Class::method callables or shell commands."
  366. }
  367. }
  368. },
  369. "support": {
  370. "type": "object",
  371. "properties": {
  372. "email": {
  373. "type": "string",
  374. "description": "Email address for support.",
  375. "format": "email"
  376. },
  377. "issues": {
  378. "type": "string",
  379. "description": "URL to the Issue Tracker.",
  380. "format": "uri"
  381. },
  382. "forum": {
  383. "type": "string",
  384. "description": "URL to the Forum.",
  385. "format": "uri"
  386. },
  387. "wiki": {
  388. "type": "string",
  389. "description": "URL to the Wiki.",
  390. "format": "uri"
  391. },
  392. "irc": {
  393. "type": "string",
  394. "description": "IRC channel for support, as irc://server/channel.",
  395. "format": "uri"
  396. },
  397. "source": {
  398. "type": "string",
  399. "description": "URL to browse or download the sources.",
  400. "format": "uri"
  401. }
  402. }
  403. }
  404. }
  405. }