About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:recommended_tools:composer

Composer

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 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 composer.local.json.dist example) and then run “composer update” to add everything. See pull request #1425 for more details.

GitHub API Limits

As of this writing, VuFind's default dependencies are largely fetched from 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 this page for more details.

development/recommended_tools/composer.txt · Last modified: 2020/09/22 14:22 by demiankatz