Upload
northpoint-digital
View
134
Download
0
Tags:
Embed Size (px)
Citation preview
NORTHPOINT DIGITAL HELPS OPTIMIZE YOUR DIGITAL PRESENCE THROUGH THE PERFECT BLEND OF STRATEGY, EXPERIENCE AND TECHNOLOGY
NorthPoint Digital is headquartered in New York with offices throughout the North East.
LOCATIONS
NEW YORK BOSTON PHILADELPHIA
PHP consists of a lot of successful but extremely
isolated libraries (see WordPress, Drupal, Symfony, Zend, and others)
Before Composer 1. How do you autoload PHP Classes from external libraries
Autoloading is the background machine that makes it possible to reference php classes without using require or include statements.
2. Dependencies Dependencies mean another library or libraries to download and configure.
3. Where to store the downloaded library(ies) in the project? Commit the whole thing or only part of it?
Composer is a executable file https://getcomposer.org/download/
Composer itself is just an executable file
If you see any errors or warnings during
the download step you may need to tweak your php configuration.
You only need to tweak your php configurations on your development machine since Composer is not run on production
nor does composer.phar need to be included in your repo
Composer's main job is to download third party libraries into the
vendor directory of your project
To tell composer the libraries your project needs, you need to create a
composer.json file
We are going to use Composer to easily bring
Guzzle and Symfony/finder(time permitting)
into a Drupal project
Instead of creating the composer.json file by hand, we can use a composer command:
php composer.phar init
For the first set of questions, unless you're planning on open-sourcing
your project, you don't have to worry about your answers.
Define Dependencies
Which third party libraries you want to include in your project
https://packagist.org/packages/guzzlehttp/guzzle
https://packagist.org/packages/symfony/finder
A package is just a third party directory that you want to download into your project
https://packagist.org/
Include the vendor/autoload.php file somewhere in your project.
require DRUPAL_ROOT . '/vendor/autoload.php';
New York Office 130 West 42nd StreetNew York, NY 10036Tel: 212-819-1700
Boston Office 470 Atlantic Avenue Boston, MA 02110Tel: 617-725-8888
Philadelphia Office 1650 Market StreetPhiladelphia, PA 19103Tel: 215-558-2700
[email protected] / www.northpointdigital.com / @northps
Thank you
Eric Sod @EricSod
NorthPoint Digital [email protected]
http://ericsod.net/ https://github.com/esod