SlideShare a Scribd company logo
1 of 29
Download to read offline
Composer

Dependency Management in PHP
Presentation by: Bradley Jacobs / @crazyjaco

@crazyjaco
Some assumptions

WordPress directory structure
JSON
Working with multiple WordPress sites
Talking Points

Goals
What is Dependency Management
Introduction to Composer
The composer.json file
The composer.lock file
Auto-loading
Package Repositories
Using Composer with WordPress
Wrap up Demo
TLDR;

Getting to a better workflow through Composer
Goal:
Rapidly create a WordPress server setup that can be replicated
quickly and consistently
WordPress Skeleton

https://github.com/markjaquith/WordPress-Skeleton
. w/
/p
.w/pamn
/pw-di/
.w/pcnet
/pw-otn/
.w/picue/
/pw-nlds
. w-otn/
/pcnet
.idxhm
/ne.tl
.w-ofgpp
/pcni.h
Dependency/Package
Management
What is a package?
A package is just a bunch of files in a folder
Dependencies are a type of package.
Why Package/Dependency Management?

Modern day web pages are rarely self-contained.
Frameworks
Libraries
Scripts
Dependency Management vs
Package Management
Introducing Composer
http://getcomposer.org
Demo 1 - PHPUnit

{

}

" ae: " rz j c/ hu i- e t,
nm" cayaoppntts"
" ecito" " ts o uigcmoe wt ppnt,
dsrpin: A et f sn opsr ih hui"
" ies" "rpitr"
lcne: poreay,
" eur" {
rqie:
"hui/hui"".."
ppntppnt: 37*
}
Installation

Mac/Linux

$cr -Shts/gtopsrogisalr |pp
ul s tp:/ecmoe.r/ntle
h
$m cmoe.hr/s/oa/i/opsr
v opsrpa urlclbncmoe

Windows:
Download and run the Composer-Setup.exe
composer.json
Schema Documentation
File acts as both a consumer and provider
{
" ae: " rd e /y ol rj c "
n m" ba ly mc o po et,
" ec it o" " hs p oe td e co s uf,
d s rp in : Ti r jc os ol t f"
" ew rs: [w rc m" " ot n,"o l ]
k y od" "o da p , b s o" c o" ,
" oe ae: " t p/ gt u. o /r zj c/ yo l rj c"
h m pg" ht :/ i hb cm ca ya o mc op oe t,
" ye: " ir r "
t p" lb ay,
" ie s" " I"
l c ne : M T,
" uh r" [
a t os :
{
" ae : "r de J cb "
nm " Ba l y a o s,
" mi " "j c b@ op ic cm ,
ea l: b ao so m hn .o "
" oe a e: "t p/ o mh n. o"
hm pg " h t: /o pi cc m
}
]
,
" eo io is:
r p st re"{
" ye : "o ps r ,
tp " cm o e"
" r " " tp / cs o- eo og
ul : ht :/ ut m rp .r "
}
,
" eu r" {
r q ie :
"op /r m wr " ". "
om hf ae ok : 32 ,
"ic ma y ai lb ay : "4 0
bg op n/ p- i rr " >. "
}
,
" eu r- e" {
r q ie dv :
"ut mr p /n tt se " ". ."
cs o- eo ui - et r: 2 3* ,
"og rl g e " " .. "
lg e/ og r : 1 7* ,
"eu /o l " " 2 0
db gt os : ~. "
}
,
" ug s" {
s g et :
"ol op n /x es o " " lo e tn in t te c r p or m
co cm ay et n in : Al w x e so o h o e rg a"
}
}
{

" ae:"rde/yolrjc"
nm" balymcopoet,
" ecito" "hspoetde co suf,
dsrpin: Ti rjc os ol tf"
" ewrs:[wrcm" "otn,"ol]
kyod" "odap, bso" co",
" oeae:"tp/gtu.o/rzjc/yolrjc"
hmpg" ht:/ihbcmcayaomcopoet,
" ye:"irr"
tp" lbay,
" ies" "I"
lcne: MT,
" uhr" [
atos:
{
"ae:"rde Jcb"
nm" Baly aos,
"mi " "jcb@opiccm,
eal: baosomhn.o"
"oeae:"tp/omhn.o"
hmpg " ht:/opiccm
}
]
,
" eoiois:
rpstre"{
"ye:"opsr,
tp" cmoe"
"r" "tp/cso-eoog
ul : ht:/utmrp.r"
}
,
" eur" {
rqie:
Composer.lock
Autoloading

*** All dependencies are loaded into the '/vendor' folder ***

rqie'edratla.h'
eur vno/uoodpp;

This one line gives you access to all of the classes in your
dependencies.
Package Repositories

Where do we find and get the packages for composer to install?
Packagist.org
Packagist.org
Using Composer w/
WordPress
custom installers, WPackagist.org
WPackagist.org
Custom Installers

It will be necessary for additional actions on occasion, like
installing something outside the /vendor folder.

http://composer.github.io/installers/ - An installer for packages
that need special installation based on package type
Hosted Plugin
{
" ae: " op i cc op ui "
n m" om hn /o l lg n,
" ye: " od r s- lg n,
t p" wr pe sp u i"
" eu r" {
r q ie :
"op sr i sa lr " ""
cm oe /n tl e s: *
}
}

Your Project
{
" ae: " rz j c/ od rs - op sr ts "
n m" ca ya ow r pe sc mo e- e t,
" ec it o" " t s o u i gc mo e wt W rP es,
d s rp in : A e t f sn o ps r ih o dr s "
" ie s" " rp it r "
l c ne : p o re ay ,
" eo io is: [
r p st re"
{
" ye : "o ps r ,
tp " cm o e"
" r " " tp / wa kg s. r"
ul : ht :/ pc a it og
}
]
,
" eu r" {
r q ie :
"pc ai t yt ao hr r lt dp ss pu i "" "
wa kg s/ e- n te -e ae -o t -l gn :* ,
"pc ai t w- ue -a h "" "
wa kg s/ ps p rc ce :* ,
"pc ai t jt ak :*
wa kg s/ ep c "" "
}
,
" eu r- e" {
r q ie dv :
"pc ai t dv lp r :*
wa kg s/ ee o e """
}
}
Demo 2

Using the Custom Installer for WordPress Plugins
{
" ae: " rz j c/ od rs - op sr ts "
n m" ca ya ow r pe sc mo e- e t,
" ec it o" " t s o u i gc mo e wt W rP es,
d s rp in : A e t f sn o ps r ih o dr s "
" ie s" " rp it r "
l c ne : p o re ay ,
" eo io is: [
r p st re"
{
" ye : "o ps r ,
tp " cm o e"
" r " " tp / wa kg s. r"
ul : ht :/ pc a it og
}
]
,
" eu r" {
r q ie :
"pc ai t yt ao hr r lt dp ss pu i "" "
wa kg s/ e- n te -e ae -o t -l gn :* ,
"pc ai t w- ue -a h "" "
wa kg s/ ps p rc ce :* ,
"pc ai t jt ak :*
wa kg s/ ep c "" "
}
,
" eu r- e" {
r q ie dv :
"pc ai t dv lp r :*
wa kg s/ ee o e """
}
}
Final Demo - WordPress Endgame
Goal: Generate the WordPress Skeleton
. w/
/p
.w/pamn
/pw-di/
.w/pcnet
/pw-otn/
.w/picue/
/pw-nlds
. w-otn/
/pcnet
.idxhm
/ne.tl
.w-ofgpp
/pcni.h
{
" ae: " rz j c/ pf l- e o,
nm" cayaow-uldm"
" ecito" "ulWrPesIsalDm"
dsrpin: Fl odrs ntl eo,
" ewrs:[WrPes,"hm" "lgn,"op" ,
kyod" "odrs" tee, pui" Omh]
" oeae:"tp/omhn.o/,
hmpg" ht:/opiccm"
" ye:"rjc"
tp" poet,
" ies" "rpitr"
lcne: poreay,
" uhr" [
atos:
{
"ae:"rde Jcb -Omh,
nm" Baly aos
op"
"mi " "jcb@opiccm,
eal: baosomhn.o"
"oeae:"tp/omhn.o"
hmpg " ht:/opiccm
}
]
,
" eoiois:[
rpstre"
{
"ye:"opsr,
tp" cmoe"
"r" "tp/wakgs.r"
ul : ht:/pcaitog
}
,
{
Where do we go from here
Integration of Source Control (SVN, Git, Hg)
Pre/Post install hooks
WP-CLI commands
Wrapping Up

Goals
What is Dependency Management
Introduction to Composer
The composer.json file
The composer.lock file
Auto-loading
Package Repositories
Using Composer with WordPress
Wrap up Demo
Resources:
Composer Documentation
http://composer.rarst.net/
Trac ticket #23912 - Add composer support to WordPress
Thank You!

@crazyjaco | github.com/crazyjaco

More Related Content

What's hot

Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbSmartTools
 
Bash script (mask off remix)
Bash script (mask off remix)Bash script (mask off remix)
Bash script (mask off remix)Elaine Yeung
 
Taming Pythons with ZooKeeper
Taming Pythons with ZooKeeperTaming Pythons with ZooKeeper
Taming Pythons with ZooKeeperJyrki Pulliainen
 
Microprocessors and interfacing d.a.godse a.p.godse
Microprocessors and interfacing   d.a.godse a.p.godseMicroprocessors and interfacing   d.a.godse a.p.godse
Microprocessors and interfacing d.a.godse a.p.godseImdad LaLbaqo
 
20141030 html5j-firefox os-deviceapi
20141030 html5j-firefox os-deviceapi20141030 html5j-firefox os-deviceapi
20141030 html5j-firefox os-deviceapiNoritada Shimizu
 
Oliver Pirate Project
Oliver Pirate ProjectOliver Pirate Project
Oliver Pirate ProjectJoan Bennett
 
আদর্শ রমণী – আব্দুল হামীদ ফাইযী
আদর্শ রমণী – আব্দুল হামীদ ফাইযীআদর্শ রমণী – আব্দুল হামীদ ফাইযী
আদর্শ রমণী – আব্দুল হামীদ ফাইযীrasikulindia
 

What's hot (11)

Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
 
2.36
2.362.36
2.36
 
Bash script (mask off remix)
Bash script (mask off remix)Bash script (mask off remix)
Bash script (mask off remix)
 
Jsconf.us.2013
Jsconf.us.2013Jsconf.us.2013
Jsconf.us.2013
 
Taming Pythons with ZooKeeper
Taming Pythons with ZooKeeperTaming Pythons with ZooKeeper
Taming Pythons with ZooKeeper
 
Microprocessors and interfacing d.a.godse a.p.godse
Microprocessors and interfacing   d.a.godse a.p.godseMicroprocessors and interfacing   d.a.godse a.p.godse
Microprocessors and interfacing d.a.godse a.p.godse
 
20141030 html5j-firefox os-deviceapi
20141030 html5j-firefox os-deviceapi20141030 html5j-firefox os-deviceapi
20141030 html5j-firefox os-deviceapi
 
Oliver Pirate Project
Oliver Pirate ProjectOliver Pirate Project
Oliver Pirate Project
 
root-ksk-2010
root-ksk-2010root-ksk-2010
root-ksk-2010
 
Dicas de SSH
Dicas de SSHDicas de SSH
Dicas de SSH
 
আদর্শ রমণী – আব্দুল হামীদ ফাইযী
আদর্শ রমণী – আব্দুল হামীদ ফাইযীআদর্শ রমণী – আব্দুল হামীদ ফাইযী
আদর্শ রমণী – আব্দুল হামীদ ফাইযী
 

Similar to An Introduction to PHP Dependency Management With Composer

Profile Serialization IIPC GA 2015
Profile Serialization IIPC GA 2015Profile Serialization IIPC GA 2015
Profile Serialization IIPC GA 2015Sawood Alam
 
Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015Sawood Alam
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsHeroku
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friendajacksified
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutesOwen Winkler
 
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAwesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAjeet Singh Raina
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleMattias Gees
 
Using Phing for Fun and Profit
Using Phing for Fun and ProfitUsing Phing for Fun and Profit
Using Phing for Fun and ProfitNicholas Jansma
 
Pulsar Architectural Patterns for CI/CD Automation and Self-Service
Pulsar Architectural Patterns for CI/CD Automation and Self-ServicePulsar Architectural Patterns for CI/CD Automation and Self-Service
Pulsar Architectural Patterns for CI/CD Automation and Self-ServiceDevin Bost
 
Testing Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamTesting Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamHenryk Konsek
 
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo PlatformNuxeo
 
20121023 mongodb schema-design
20121023 mongodb schema-design20121023 mongodb schema-design
20121023 mongodb schema-designMongoDB
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaTony Fabeen
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
Making Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in MeteorMaking Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in Meteoryaliceme
 
Representing Material Culture Online: Historic Clothing in Omeka
Representing Material Culture Online: Historic Clothing in OmekaRepresenting Material Culture Online: Historic Clothing in Omeka
Representing Material Culture Online: Historic Clothing in OmekaArden Kirkland
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with GradleBob Paulin
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaAlexander Gyoshev
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and CustomizationAniket Pant
 
An Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsAn Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsMiloš Sutanovac
 

Similar to An Introduction to PHP Dependency Management With Composer (20)

Profile Serialization IIPC GA 2015
Profile Serialization IIPC GA 2015Profile Serialization IIPC GA 2015
Profile Serialization IIPC GA 2015
 
Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friend
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutes
 
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAwesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Using Phing for Fun and Profit
Using Phing for Fun and ProfitUsing Phing for Fun and Profit
Using Phing for Fun and Profit
 
Pulsar Architectural Patterns for CI/CD Automation and Self-Service
Pulsar Architectural Patterns for CI/CD Automation and Self-ServicePulsar Architectural Patterns for CI/CD Automation and Self-Service
Pulsar Architectural Patterns for CI/CD Automation and Self-Service
 
Testing Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamTesting Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax Exam
 
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
 
20121023 mongodb schema-design
20121023 mongodb schema-design20121023 mongodb schema-design
20121023 mongodb schema-design
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with Lua
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Making Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in MeteorMaking Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in Meteor
 
Representing Material Culture Online: Historic Clothing in Omeka
Representing Material Culture Online: Historic Clothing in OmekaRepresenting Material Culture Online: Historic Clothing in Omeka
Representing Material Culture Online: Historic Clothing in Omeka
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with Gradle
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and java
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and Customization
 
An Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsAn Introduction to CSS Preprocessors
An Introduction to CSS Preprocessors
 

More from Oomph, Inc.

Simple Strategies to Create a Killer IA
Simple Strategies to Create a Killer IA Simple Strategies to Create a Killer IA
Simple Strategies to Create a Killer IA Oomph, Inc.
 
NEDCamp Translation 5 Tips
NEDCamp Translation 5 TipsNEDCamp Translation 5 Tips
NEDCamp Translation 5 TipsOomph, Inc.
 
The Big Picture (Element) - Responsive Images in Drupal 8
The Big Picture (Element) - Responsive Images in Drupal 8The Big Picture (Element) - Responsive Images in Drupal 8
The Big Picture (Element) - Responsive Images in Drupal 8Oomph, Inc.
 
What's in a Name - Building Custom Layouts with Paragraphs
What's in a Name - Building Custom Layouts with Paragraphs What's in a Name - Building Custom Layouts with Paragraphs
What's in a Name - Building Custom Layouts with Paragraphs Oomph, Inc.
 
How to Create a Comprehensive Training Manual for your Clients
How to Create a Comprehensive Training Manual for your ClientsHow to Create a Comprehensive Training Manual for your Clients
How to Create a Comprehensive Training Manual for your ClientsOomph, Inc.
 
NEDCamp Base Theme Presentation
NEDCamp Base Theme PresentationNEDCamp Base Theme Presentation
NEDCamp Base Theme PresentationOomph, Inc.
 
5 Secrets of Tech Marketing
5 Secrets of Tech Marketing5 Secrets of Tech Marketing
5 Secrets of Tech MarketingOomph, Inc.
 
Oomph & Interactive One | Defining Urban Media With WordPress
Oomph & Interactive One | Defining Urban Media With WordPressOomph & Interactive One | Defining Urban Media With WordPress
Oomph & Interactive One | Defining Urban Media With WordPressOomph, Inc.
 
The Unix Command Line | Jim Reevior
The Unix Command Line | Jim ReeviorThe Unix Command Line | Jim Reevior
The Unix Command Line | Jim ReeviorOomph, Inc.
 

More from Oomph, Inc. (9)

Simple Strategies to Create a Killer IA
Simple Strategies to Create a Killer IA Simple Strategies to Create a Killer IA
Simple Strategies to Create a Killer IA
 
NEDCamp Translation 5 Tips
NEDCamp Translation 5 TipsNEDCamp Translation 5 Tips
NEDCamp Translation 5 Tips
 
The Big Picture (Element) - Responsive Images in Drupal 8
The Big Picture (Element) - Responsive Images in Drupal 8The Big Picture (Element) - Responsive Images in Drupal 8
The Big Picture (Element) - Responsive Images in Drupal 8
 
What's in a Name - Building Custom Layouts with Paragraphs
What's in a Name - Building Custom Layouts with Paragraphs What's in a Name - Building Custom Layouts with Paragraphs
What's in a Name - Building Custom Layouts with Paragraphs
 
How to Create a Comprehensive Training Manual for your Clients
How to Create a Comprehensive Training Manual for your ClientsHow to Create a Comprehensive Training Manual for your Clients
How to Create a Comprehensive Training Manual for your Clients
 
NEDCamp Base Theme Presentation
NEDCamp Base Theme PresentationNEDCamp Base Theme Presentation
NEDCamp Base Theme Presentation
 
5 Secrets of Tech Marketing
5 Secrets of Tech Marketing5 Secrets of Tech Marketing
5 Secrets of Tech Marketing
 
Oomph & Interactive One | Defining Urban Media With WordPress
Oomph & Interactive One | Defining Urban Media With WordPressOomph & Interactive One | Defining Urban Media With WordPress
Oomph & Interactive One | Defining Urban Media With WordPress
 
The Unix Command Line | Jim Reevior
The Unix Command Line | Jim ReeviorThe Unix Command Line | Jim Reevior
The Unix Command Line | Jim Reevior
 

Recently uploaded

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

An Introduction to PHP Dependency Management With Composer

  • 1. Composer Dependency Management in PHP Presentation by: Bradley Jacobs / @crazyjaco @crazyjaco
  • 2. Some assumptions WordPress directory structure JSON Working with multiple WordPress sites
  • 3. Talking Points Goals What is Dependency Management Introduction to Composer The composer.json file The composer.lock file Auto-loading Package Repositories Using Composer with WordPress Wrap up Demo
  • 4. TLDR; Getting to a better workflow through Composer Goal: Rapidly create a WordPress server setup that can be replicated quickly and consistently
  • 6. Dependency/Package Management What is a package? A package is just a bunch of files in a folder Dependencies are a type of package.
  • 7. Why Package/Dependency Management? Modern day web pages are rarely self-contained. Frameworks Libraries Scripts
  • 10. Demo 1 - PHPUnit { } " ae: " rz j c/ hu i- e t, nm" cayaoppntts" " ecito" " ts o uigcmoe wt ppnt, dsrpin: A et f sn opsr ih hui" " ies" "rpitr" lcne: poreay, " eur" { rqie: "hui/hui"".." ppntppnt: 37* }
  • 11. Installation Mac/Linux $cr -Shts/gtopsrogisalr |pp ul s tp:/ecmoe.r/ntle h $m cmoe.hr/s/oa/i/opsr v opsrpa urlclbncmoe Windows: Download and run the Composer-Setup.exe
  • 12. composer.json Schema Documentation File acts as both a consumer and provider
  • 13. { " ae: " rd e /y ol rj c " n m" ba ly mc o po et, " ec it o" " hs p oe td e co s uf, d s rp in : Ti r jc os ol t f" " ew rs: [w rc m" " ot n,"o l ] k y od" "o da p , b s o" c o" , " oe ae: " t p/ gt u. o /r zj c/ yo l rj c" h m pg" ht :/ i hb cm ca ya o mc op oe t, " ye: " ir r " t p" lb ay, " ie s" " I" l c ne : M T, " uh r" [ a t os : { " ae : "r de J cb " nm " Ba l y a o s, " mi " "j c b@ op ic cm , ea l: b ao so m hn .o " " oe a e: "t p/ o mh n. o" hm pg " h t: /o pi cc m } ] , " eo io is: r p st re"{ " ye : "o ps r , tp " cm o e" " r " " tp / cs o- eo og ul : ht :/ ut m rp .r " } , " eu r" { r q ie : "op /r m wr " ". " om hf ae ok : 32 , "ic ma y ai lb ay : "4 0 bg op n/ p- i rr " >. " } , " eu r- e" { r q ie dv : "ut mr p /n tt se " ". ." cs o- eo ui - et r: 2 3* , "og rl g e " " .. " lg e/ og r : 1 7* , "eu /o l " " 2 0 db gt os : ~. " } , " ug s" { s g et : "ol op n /x es o " " lo e tn in t te c r p or m co cm ay et n in : Al w x e so o h o e rg a" } }
  • 14. { " ae:"rde/yolrjc" nm" balymcopoet, " ecito" "hspoetde co suf, dsrpin: Ti rjc os ol tf" " ewrs:[wrcm" "otn,"ol] kyod" "odap, bso" co", " oeae:"tp/gtu.o/rzjc/yolrjc" hmpg" ht:/ihbcmcayaomcopoet, " ye:"irr" tp" lbay, " ies" "I" lcne: MT, " uhr" [ atos: { "ae:"rde Jcb" nm" Baly aos, "mi " "jcb@opiccm, eal: baosomhn.o" "oeae:"tp/omhn.o" hmpg " ht:/opiccm } ] , " eoiois: rpstre"{ "ye:"opsr, tp" cmoe" "r" "tp/cso-eoog ul : ht:/utmrp.r" } , " eur" { rqie:
  • 16. Autoloading *** All dependencies are loaded into the '/vendor' folder *** rqie'edratla.h' eur vno/uoodpp; This one line gives you access to all of the classes in your dependencies.
  • 17. Package Repositories Where do we find and get the packages for composer to install?
  • 19. Using Composer w/ WordPress custom installers, WPackagist.org
  • 21. Custom Installers It will be necessary for additional actions on occasion, like installing something outside the /vendor folder. http://composer.github.io/installers/ - An installer for packages that need special installation based on package type
  • 22. Hosted Plugin { " ae: " op i cc op ui " n m" om hn /o l lg n, " ye: " od r s- lg n, t p" wr pe sp u i" " eu r" { r q ie : "op sr i sa lr " "" cm oe /n tl e s: * } } Your Project { " ae: " rz j c/ od rs - op sr ts " n m" ca ya ow r pe sc mo e- e t, " ec it o" " t s o u i gc mo e wt W rP es, d s rp in : A e t f sn o ps r ih o dr s " " ie s" " rp it r " l c ne : p o re ay , " eo io is: [ r p st re" { " ye : "o ps r , tp " cm o e" " r " " tp / wa kg s. r" ul : ht :/ pc a it og } ] , " eu r" { r q ie : "pc ai t yt ao hr r lt dp ss pu i "" " wa kg s/ e- n te -e ae -o t -l gn :* , "pc ai t w- ue -a h "" " wa kg s/ ps p rc ce :* , "pc ai t jt ak :* wa kg s/ ep c "" " } , " eu r- e" { r q ie dv : "pc ai t dv lp r :* wa kg s/ ee o e """ } }
  • 23. Demo 2 Using the Custom Installer for WordPress Plugins { " ae: " rz j c/ od rs - op sr ts " n m" ca ya ow r pe sc mo e- e t, " ec it o" " t s o u i gc mo e wt W rP es, d s rp in : A e t f sn o ps r ih o dr s " " ie s" " rp it r " l c ne : p o re ay , " eo io is: [ r p st re" { " ye : "o ps r , tp " cm o e" " r " " tp / wa kg s. r" ul : ht :/ pc a it og } ] , " eu r" { r q ie : "pc ai t yt ao hr r lt dp ss pu i "" " wa kg s/ e- n te -e ae -o t -l gn :* , "pc ai t w- ue -a h "" " wa kg s/ ps p rc ce :* , "pc ai t jt ak :* wa kg s/ ep c "" " } , " eu r- e" { r q ie dv : "pc ai t dv lp r :* wa kg s/ ee o e """ } }
  • 24. Final Demo - WordPress Endgame Goal: Generate the WordPress Skeleton . w/ /p .w/pamn /pw-di/ .w/pcnet /pw-otn/ .w/picue/ /pw-nlds . w-otn/ /pcnet .idxhm /ne.tl .w-ofgpp /pcni.h
  • 25. { " ae: " rz j c/ pf l- e o, nm" cayaow-uldm" " ecito" "ulWrPesIsalDm" dsrpin: Fl odrs ntl eo, " ewrs:[WrPes,"hm" "lgn,"op" , kyod" "odrs" tee, pui" Omh] " oeae:"tp/omhn.o/, hmpg" ht:/opiccm" " ye:"rjc" tp" poet, " ies" "rpitr" lcne: poreay, " uhr" [ atos: { "ae:"rde Jcb -Omh, nm" Baly aos op" "mi " "jcb@opiccm, eal: baosomhn.o" "oeae:"tp/omhn.o" hmpg " ht:/opiccm } ] , " eoiois:[ rpstre" { "ye:"opsr, tp" cmoe" "r" "tp/wakgs.r" ul : ht:/pcaitog } , {
  • 26. Where do we go from here Integration of Source Control (SVN, Git, Hg) Pre/Post install hooks WP-CLI commands
  • 27. Wrapping Up Goals What is Dependency Management Introduction to Composer The composer.json file The composer.lock file Auto-loading Package Repositories Using Composer with WordPress Wrap up Demo
  • 29. Thank You! @crazyjaco | github.com/crazyjaco