This repository has been archived by the owner on Dec 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Adding Libraries
gehrc edited this page Nov 28, 2014
·
3 revisions
Adding a new library to your project is incredibly simple using Composer. The following are the steps involved:
- Open composer.json
- Under the "require" section, add a new line with the following format:
- "{Library Name}": "{version}"
- Ensure you add a comma on the previous line if another package has been specified
- This information will come from the installation instructions for the library you're attempting to install
- You can also search for the library on Packagist
- Save the modified composer.json
- Run
composer install
from your Terminal
The library will be downloaded and included in the 'vendor' directory in your project. Usage will depend on the library itself, but installation just adds the files to your project. Afterwards, you can load the classes in your application to use them.
Any errors encountered are likely to come from syntax issues in composer.json, or if the library has not been found on Packagist. Pay attention to the error message to determine the exact issue.
THINKer Framework + Libraries Copyright © Cory Gehr. All rights reserved.