====== Composer ====== [[http://getcomposer.org|Composer]] is a popular solution for managing PHP dependencies -- it automates the installation and integration of third-party libraries into VuFind. ===== Installation ===== You can obtain Composer (and read full documentation) at [[http://getcomposer.org]]. ===== Usage ===== Early in 2016, the VuFind team stopped committing third-party dependencies into the project's Git repo, instead relying on Composer to download the files. When you first check out a new copy of VuFind, or any time that pulling changes results in modifications to the composer.json file, you should run: composer install ===== Notes ===== ==== Composer Merge Plugin ==== Starting with VuFind 6.1, VuFind uses the [[https://github.com/wikimedia/composer-merge-plugin|Wikimedia Composer Merge Plugin]] to help developers add dependencies to local VuFind instances more easily. If you want to add a new dependency to a local instance of VuFind without having to override the existing composer.json/composer.lock (which can cause merge conflicts in the future), you can instead create a composer.local.json (based on the provided [[https://github.com/vufind-org/vufind/blob/dev/composer.local.json.dist|composer.local.json.dist]] example) and then run "composer update" to add everything. See [[https://github.com/vufind-org/vufind/pull/1425|pull request #1425]] for more details. ==== GitHub API Limits ==== As of this writing, VuFind's default dependencies are largely fetched from [[https://packagist.org/|Packagist]] and should not be subject to any particular limits. However, if you add dependencies that are fetched directly from GitHub (or if VuFind's dependencies change in the future), Composer may occasionally complain about GitHub API rate limits while fetching information -- especially if you are using an automated deployment system that installs VuFind many times. To get around this problem, it may be necessary to set up an OAuth token. See [[https://github.com/composer/composer/blob/dev/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens|this page]] for more details.