Différences entre les versions de « Programmation PHP/Composer »

=== repositories ===
Pour spécifier des dépôts privés (qui ne sont pas accessibles sans communiquer leur URL).
 
=== Exemple complet ===
Exemple de mediawiki/core<ref>https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/composer.json</ref> :
<syntaxhighlight lang=json>
{
"name": "mediawiki/core",
"description": "Free software wiki application developed by the Wikimedia Foundation and others",
"type": "mediawiki-core",
"keywords": [
"mediawiki",
"wiki"
],
"homepage": "https://www.mediawiki.org/",
"authors": [
{
"name": "MediaWiki Community",
"homepage": "https://www.mediawiki.org/wiki/Special:Version/Credits"
}
],
"license": "GPL-2.0-or-later",
"support": {
"issues": "https://bugs.mediawiki.org/",
"irc": "irc://irc.libera.chat/mediawiki",
"wiki": "https://www.mediawiki.org/"
},
"prefer-stable": true,
"require": {
"composer/semver": "3.2.4",
"cssjanus/cssjanus": "2.0.0",
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-iconv": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"guzzlehttp/guzzle": "7.2.0",
"liuggio/statsd-php-client": "1.0.18",
"monolog/monolog": "2.2.0",
"oojs/oojs-ui": "0.42.0",
"pear/mail": "1.4.1",
"pear/mail_mime": "1.10.9",
"pear/net_smtp": "1.9.2",
"php": ">=7.2.22",
"psr/container": "1.1.1",
"psr/log": "1.1.3",
"ralouphie/getallheaders": "3.0.3",
"wikimedia/assert": "0.5.0",
"wikimedia/at-ease": "2.1.0",
"wikimedia/base-convert": "2.0.1",
"wikimedia/cdb": "1.4.1",
"wikimedia/cldr-plural-rule-parser": "2.0.0",
"wikimedia/common-passwords": "0.3.0",
"wikimedia/composer-merge-plugin": "2.0.1",
"wikimedia/html-formatter": "3.0.1",
"wikimedia/ip-set": "3.0.0",
"wikimedia/ip-utils": "3.0.2",
"wikimedia/less.php": "3.1.0",
"wikimedia/minify": "2.2.4",
"wikimedia/normalized-exception": "1.0.1",
"wikimedia/object-factory": "3.0.2",
"wikimedia/parsoid": "^0.14.0-a14@alpha",
"wikimedia/php-session-serializer": "2.0.0",
"wikimedia/purtle": "1.0.7",
"wikimedia/relpath": "3.0.0",
"wikimedia/remex-html": "2.3.2",
"wikimedia/request-timeout": "1.1.0",
"wikimedia/running-stat": "1.2.1",
"wikimedia/scoped-callback": "3.0.0",
"wikimedia/services": "2.0.1",
"wikimedia/shellbox": "2.0.0",
"wikimedia/utfnormal": "3.0.2",
"wikimedia/timestamp": "3.0.0",
"wikimedia/wait-condition-loop": "2.0.2",
"wikimedia/wrappedstring": "3.2.0",
"wikimedia/xmp-reader": "0.8.1",
"zordius/lightncandy": "1.2.5"
},
"require-dev": {
"composer/spdx-licenses": "1.5.4",
"doctrine/dbal": "2.10.4||3.0.0",
"doctrine/sql-formatter": "1.1.1",
"giorgiosironi/eris": "^0.10.0",
"hamcrest/hamcrest-php": "^2.0",
"johnkary/phpunit-speedtrap": "^3.1",
"justinrainbow/json-schema": "~5.2",
"mediawiki/mediawiki-codesniffer": "37.0.0",
"mediawiki/mediawiki-phan-config": "0.10.6",
"nikic/php-parser": "4.10.2",
"nmred/kafka-php": "0.1.5",
"php-parallel-lint/php-console-highlighter": "0.5",
"php-parallel-lint/php-parallel-lint": "1.3.0",
"phpunit/phpunit": "^8.5",
"psy/psysh": "0.10.5",
"seld/jsonlint": "1.8.3",
"symfony/yaml": "~3.4|~5.1",
"wikimedia/testing-access-wrapper": "~2.0",
"wmde/hamcrest-html-matchers": "^1.0.0"
},
"replace": {
"symfony/polyfill-ctype": "1.99",
"symfony/polyfill-mbstring": "1.99"
},
"suggest": {
"ext-apcu": "Local data cache for greatly improved performance",
"ext-curl": "Improved http communication abilities",
"ext-openssl": "Cryptographical functions",
"ext-wikidiff2": "Diff accelerator",
"monolog/monolog": "Flexible debug logging system",
"nmred/kafka-php": "Send debug log events to kafka"
},
"autoload": {
"psr-0": {
"ComposerHookHandler": "includes/composer",
"ComposerVendorHtaccessCreator": "includes/composer",
"ComposerPhpunitXmlCoverageEdit": "includes/composer"
}
},
"autoload-dev": {
"files": [
"vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php",
"vendor/wmde/hamcrest-html-matchers/src/functions.php"
]
},
"scripts": {
"mw-install:sqlite": "php maintenance/install.php --server=http://localhost:4000 --dbtype sqlite --dbpath cache/ --scriptpath '' --pass adminpassword MediaWiki Admin",
"serve": "php -S localhost:4000",
"lint": "parallel-lint --exclude vendor",
"phan": "phan -d . --long-progress-bar",
"phpcs": "phpcs -p -s --cache",
"fix": [
"phpcbf"
],
"pre-install-cmd": "ComposerHookHandler::onPreInstall",
"pre-update-cmd": "ComposerHookHandler::onPreUpdate",
"post-install-cmd": "ComposerVendorHtaccessCreator::onEvent",
"post-update-cmd": "ComposerVendorHtaccessCreator::onEvent",
"test": [
"composer lint .",
"composer phpcs ."
],
"test-some": [
"composer lint",
"composer phpcs"
],
"phpunit": "phpunit",
"phpunit:unit": "phpunit --colors=always --testsuite=core:unit,extensions:unit,skins:unit",
"phpunit:integration": "phpunit --colors=always --testsuite=core:integration,extensions:integration,skins:integration",
"phpunit:coverage": "phpunit --testsuite=core:unit --exclude-group Dump,Broken",
"phpunit:coverage-edit": "ComposerPhpunitXmlCoverageEdit::onEvent",
"phpunit:entrypoint": "php tests/phpunit/phpunit.php"
},
"config": {
"optimize-autoloader": true,
"prepend-autoloader": false
},
"extra": {
"merge-plugin": {
"include": [
"composer.local.json"
],
"merge-dev": false
}
}
}
</syntaxhighlight>
 
== Changer de version de PHP ==