SlideShare a Scribd company logo
1 of 13
presents 
Lightning Talk => Composer
A quick slide about Me 
Eric Van Johnson 
PHP Developer, Architect and an Organizer of SDPHP 
● Github: https://github.com/shocm 
● LinkedIn: http://www.linkedin.com/in/vanjohnson 
● Joind.in: https://joind.in/user/view/1770 
● Twitter: @shocm 
● IRC: @shocm 
● eric@sdphp.org 
● Website: www.shocm.com
The Issues 
● Your app depends on libraries 
● There is maintenance to keep 
these libraries up to date 
● Libraries also have dependency 
on other libraries
We’ve (php) tried to 
address this issue before 
PEAR : A Library for PHP 
PHP Extension and Application Repository 
Used by many developers 
Problems with PEAR 
● In general, PEAR is meant to be installed on a system level. Although with 
some tweaking this can be avoided. However, using PEAR at a system 
level can make it difficult to migrate code from system to system. 
● There are a TON of PEAR Libraries and not all of them are very well 
documented.
Enter Composer 
What Does Composer Do? 
● You tell Composer what libraries you want 
● Composer then manages the libraries and the 
dependencies for those libraries 
● Installs everything for you 
● Creates an autoloader
Installing Composer 
You can install Composer in a local directory 
using the command 
curl -s https://getcomposer.org/installer | php 
A more common practice is to install composer 
globally 
curl -s https://getcomposer.org/composer.phar  
-o $HOME/local/bin/composer 
chmod +x $HOME/local/bin/composer 
This gives you access to 
composer install
Using Composer 
composer create-project laravel/laravel --prefer-dist 
The above command downloads and installs the core 
libraries for a Laravel Project. It also downloads and install 
all the dependencies such as several symfony 
components. 
End result
The composer.json File 
This is where a lot of magic 
happens. 
“require” is the key to the 
strength of Composer. This 
tells composer what core 
libraries, and their versions, 
you would like to install. 
Composer then figures out 
the dependencies and their 
versions and installs them.
Where do these Packages 
come from? 
Packagist 
Main Repository 
https://packagist.org/ 
Create your own 
with Satis 
https://github.com/composer/satis
Autoloading 
index.php 
<?php 
require ‘vendor/autoload.php’; 
// You can now use your dependencies 
// without requiring them 
use 
SymfonyComponentConsoleApplication;
Updating with Composer 
To add a library, you can edit the composer.json file directly or 
use the command-line 
composer require vendor/package:2.* vendor/package2:dev-master 
Then simply run 
composer update 
‘composer update’ will also update all the existing packages and 
dependencies based on the composer.json configuration.
Summary 
● Very Simple to Install and Implement 
● Cool “Magical” dependency resolution 
● You can make and contribute your own packages 
● Composer autoloader make life easy and is PSR compliant
THANK YOU! 
Eric Van Johnson 
● Twitter: @shocm 
● IRC: @shocm 
● eric@sdphp.org 
● Website: www.shocm.com

More Related Content

What's hot

php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
 
Brief introduction to Symfony Flex
Brief introduction to Symfony FlexBrief introduction to Symfony Flex
Brief introduction to Symfony FlexFedir Kryvytskyi
 
Material Design and Seaside
Material Design and SeasideMaterial Design and Seaside
Material Design and SeasidePharo
 
Jenkins on Docker
Jenkins on DockerJenkins on Docker
Jenkins on DockerCraig Trim
 
Laravel Code Generators and Packages
Laravel Code Generators and PackagesLaravel Code Generators and Packages
Laravel Code Generators and PackagesPovilas Korop
 
Why You Should Use Oracle SQL Developer
Why You Should Use Oracle SQL DeveloperWhy You Should Use Oracle SQL Developer
Why You Should Use Oracle SQL DeveloperJeffrey Kemp
 
Symfony Nano Framework
Symfony Nano FrameworkSymfony Nano Framework
Symfony Nano FrameworkLoïc Faugeron
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Rafael Dohms
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$Joe Ferguson
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerJackson F. de A. Mafra
 
perlcc made easy or, how to make a CGI Moose app
perlcc made easy or, how to make a CGI Moose appperlcc made easy or, how to make a CGI Moose app
perlcc made easy or, how to make a CGI Moose appcPanel
 
10 less-known Laravel Packages: May 2016
10 less-known Laravel Packages: May 201610 less-known Laravel Packages: May 2016
10 less-known Laravel Packages: May 2016Povilas Korop
 
You are not_hiding_from_me_.net
You are not_hiding_from_me_.netYou are not_hiding_from_me_.net
You are not_hiding_from_me_.netChung Wee Jing
 

What's hot (20)

php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
composer_talk_20160209
composer_talk_20160209composer_talk_20160209
composer_talk_20160209
 
PHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-onPHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-on
 
Brief introduction to Symfony Flex
Brief introduction to Symfony FlexBrief introduction to Symfony Flex
Brief introduction to Symfony Flex
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
Material Design and Seaside
Material Design and SeasideMaterial Design and Seaside
Material Design and Seaside
 
Jenkins on Docker
Jenkins on DockerJenkins on Docker
Jenkins on Docker
 
Laravel Code Generators and Packages
Laravel Code Generators and PackagesLaravel Code Generators and Packages
Laravel Code Generators and Packages
 
Why You Should Use Oracle SQL Developer
Why You Should Use Oracle SQL DeveloperWhy You Should Use Oracle SQL Developer
Why You Should Use Oracle SQL Developer
 
Magento Meetup New Delhi- Console
Magento Meetup New Delhi- ConsoleMagento Meetup New Delhi- Console
Magento Meetup New Delhi- Console
 
Symfony Nano Framework
Symfony Nano FrameworkSymfony Nano Framework
Symfony Nano Framework
 
Subversion Saves The Day
Subversion Saves The DaySubversion Saves The Day
Subversion Saves The Day
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Perl ides
Perl idesPerl ides
Perl ides
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant Killer
 
perlcc made easy or, how to make a CGI Moose app
perlcc made easy or, how to make a CGI Moose appperlcc made easy or, how to make a CGI Moose app
perlcc made easy or, how to make a CGI Moose app
 
10 less-known Laravel Packages: May 2016
10 less-known Laravel Packages: May 201610 less-known Laravel Packages: May 2016
10 less-known Laravel Packages: May 2016
 
You are not_hiding_from_me_.net
You are not_hiding_from_me_.netYou are not_hiding_from_me_.net
You are not_hiding_from_me_.net
 

Similar to Composer Lightning Talk

Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Clark Everetts
 
Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Clark Everetts
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHPTareq Hasan
 
Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)James Titcumb
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboardsDenis Ristic
 
Introducing composer - a php dependency manager
Introducing composer  - a php dependency managerIntroducing composer  - a php dependency manager
Introducing composer - a php dependency managerDigvijay Tiwari
 
Using Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesAnna Ladoshkina
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right wayChristian Varela
 
Volunteering atyouseeforit services
Volunteering atyouseeforit servicesVolunteering atyouseeforit services
Volunteering atyouseeforit servicesYouSee
 

Similar to Composer Lightning Talk (20)

Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
Composer: Dependency Manager for PHP
Composer: Dependency Manager for PHPComposer: Dependency Manager for PHP
Composer: Dependency Manager for PHP
 
Composer
ComposerComposer
Composer
 
Composer intro
Composer introComposer intro
Composer intro
 
Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHP
 
Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)
 
Php
PhpPhp
Php
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 
Composer
ComposerComposer
Composer
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboards
 
Introducing composer - a php dependency manager
Introducing composer  - a php dependency managerIntroducing composer  - a php dependency manager
Introducing composer - a php dependency manager
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
 
Guzzle Drupal 7
Guzzle Drupal 7Guzzle Drupal 7
Guzzle Drupal 7
 
Using Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websites
 
Composer
ComposerComposer
Composer
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
 
Volunteering atyouseeforit services
Volunteering atyouseeforit servicesVolunteering atyouseeforit services
Volunteering atyouseeforit services
 

More from Eric Johnson

Deploy Laravel on Heroku
Deploy Laravel on HerokuDeploy Laravel on Heroku
Deploy Laravel on HerokuEric Johnson
 
Git - the stupid content tracker
Git - the stupid content trackerGit - the stupid content tracker
Git - the stupid content trackerEric Johnson
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP Eric Johnson
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)Eric Johnson
 
Intro to CakePHP - SDPHP MeetUp Dec 2012
Intro to CakePHP - SDPHP MeetUp Dec 2012Intro to CakePHP - SDPHP MeetUp Dec 2012
Intro to CakePHP - SDPHP MeetUp Dec 2012Eric Johnson
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHPEric Johnson
 

More from Eric Johnson (6)

Deploy Laravel on Heroku
Deploy Laravel on HerokuDeploy Laravel on Heroku
Deploy Laravel on Heroku
 
Git - the stupid content tracker
Git - the stupid content trackerGit - the stupid content tracker
Git - the stupid content tracker
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
 
Intro to CakePHP - SDPHP MeetUp Dec 2012
Intro to CakePHP - SDPHP MeetUp Dec 2012Intro to CakePHP - SDPHP MeetUp Dec 2012
Intro to CakePHP - SDPHP MeetUp Dec 2012
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Composer Lightning Talk

  • 2. A quick slide about Me Eric Van Johnson PHP Developer, Architect and an Organizer of SDPHP ● Github: https://github.com/shocm ● LinkedIn: http://www.linkedin.com/in/vanjohnson ● Joind.in: https://joind.in/user/view/1770 ● Twitter: @shocm ● IRC: @shocm ● eric@sdphp.org ● Website: www.shocm.com
  • 3. The Issues ● Your app depends on libraries ● There is maintenance to keep these libraries up to date ● Libraries also have dependency on other libraries
  • 4. We’ve (php) tried to address this issue before PEAR : A Library for PHP PHP Extension and Application Repository Used by many developers Problems with PEAR ● In general, PEAR is meant to be installed on a system level. Although with some tweaking this can be avoided. However, using PEAR at a system level can make it difficult to migrate code from system to system. ● There are a TON of PEAR Libraries and not all of them are very well documented.
  • 5. Enter Composer What Does Composer Do? ● You tell Composer what libraries you want ● Composer then manages the libraries and the dependencies for those libraries ● Installs everything for you ● Creates an autoloader
  • 6. Installing Composer You can install Composer in a local directory using the command curl -s https://getcomposer.org/installer | php A more common practice is to install composer globally curl -s https://getcomposer.org/composer.phar -o $HOME/local/bin/composer chmod +x $HOME/local/bin/composer This gives you access to composer install
  • 7. Using Composer composer create-project laravel/laravel --prefer-dist The above command downloads and installs the core libraries for a Laravel Project. It also downloads and install all the dependencies such as several symfony components. End result
  • 8. The composer.json File This is where a lot of magic happens. “require” is the key to the strength of Composer. This tells composer what core libraries, and their versions, you would like to install. Composer then figures out the dependencies and their versions and installs them.
  • 9. Where do these Packages come from? Packagist Main Repository https://packagist.org/ Create your own with Satis https://github.com/composer/satis
  • 10. Autoloading index.php <?php require ‘vendor/autoload.php’; // You can now use your dependencies // without requiring them use SymfonyComponentConsoleApplication;
  • 11. Updating with Composer To add a library, you can edit the composer.json file directly or use the command-line composer require vendor/package:2.* vendor/package2:dev-master Then simply run composer update ‘composer update’ will also update all the existing packages and dependencies based on the composer.json configuration.
  • 12. Summary ● Very Simple to Install and Implement ● Cool “Magical” dependency resolution ● You can make and contribute your own packages ● Composer autoloader make life easy and is PSR compliant
  • 13. THANK YOU! Eric Van Johnson ● Twitter: @shocm ● IRC: @shocm ● eric@sdphp.org ● Website: www.shocm.com