SlideShare a Scribd company logo
Using Composer
with WordPress
Micah Wood
@wpscholar
wpscholar.com/loopconf2015
What is ?
Manages Project
Dependencies and Versions
Why Use Composer?
Eliminates
Duplication
Consistent
Versioning
Reusable

Code
Documentation of
Dependencies
Composer Features
Automatic
Package Installation
Bulk Package
Updates
Class and File
Autoloading
Recursive
Dependencies
Package
Discovery
Installing Composer
Go to https://getcomposer.org/
Click ‘Getting Started’
Find your install method
$ composer diagnose
Check system for common errors
Using Composer
$ composer init
Create a new composer.json file
$ composer validate
Validate your composer.json file
$ composer require package
Adds package to composer.json and installs
$ composer require package --dev
Adds package to composer.json as a dev requirement and installs
$ composer install
Downloads and installs all dependencies
$ composer install --no-dev
Install composer dependencies for production environment
$ composer update
Checks for and installs package updates
$ composer update package
Checks for and installs a single package update
$ composer remove package
Removes package from composer.json and uninstalls
$ composer search package
Discover packages on packagist.org
$ composer config repositories.package
git git@github.com:username/package.git
Add a custom repository
Custom Repositories Require 

a composer.json File
Run composer init to generate
Specifying Versions
Exact Version
1.0.2
Range of Versions
>=1.0,<2.0
Wildcard Version
1.0.*
Next Significant Release Version
~1.2
Version Stability Flags

@stable 

@rc

@beta

@alpha

@dev
Semantic Versioning
semver.org
2.3.1
Increment when you make breaking changes
Major Version
2.3.1
Increment when you add backwards compatible features
Minor Version
2.3.1
Increment when you make backwards compatible bug fixes
Patch Version
How Composer Works
composer.json
How you declare your dependencies
composer.lock
How Composer stores
your dependencies
vendor directory
Where composer installs your packages
autoload files
require __DIR__ . '/vendor/autoload.php';
Using Composer
with WordPress
Use Case #1
Custom Plugin or Theme
Use Case #2
Custom Site or App
$ composer require johnpbloch/wordpress
Add WordPress as a dependency
$ composer config repositories.wpackagist
composer http://wpackagist.org/
Add wpackagist.org as a repository
$ composer require composer/installers
Enables WordPress themes and plugins to be put in their respective directories
Setup WordPress Paths
Places WordPress and its themes and plugins in their respective directories
File Structure
Project Bootstrapping
$ composer create-project package
Downloads project and runs `composer install`
$ composer create-project wpscholar/wp-skeleton
Setup a new WordPress project
$ composer create-project wpscholar/vvv-skeleton
Setup a new WordPress project using VVV
Thank You!
Micah Wood
@wpscholar
wpscholar.com/loopconf2015

More Related Content

What's hot (20)

PPTX
Setup a Dev environment that feels like $HOME on Windows 10
Stefan Scherer
 
PDF
Easy Setup for Parallel Test Execution with Selenium Docker
Sargis Sargsyan
 
ODP
Brief introduction to Symfony Flex
Fedir Kryvytskyi
 
PPT
Webenabled
Jason Arnold
 
PDF
What's new in Meteor 1.3?
Rick Wehrle
 
PDF
Chris Omland - AWS Code Deploy - BSDC 2016
roblund
 
PDF
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
Sargis Sargsyan
 
PPTX
Hooking Docker With Selenium
Sujith Vakathanam
 
PDF
Composer Power User Tips
Tom Corrigan
 
PDF
fmcsadmin 1.0.0
Atsushi Matsuo
 
PDF
Deploy Angular to the Cloud (ngBucharest)
Simona Cotin
 
PDF
Welcome to Jenkins
Somkiat Puisungnoen
 
PPTX
How to deploy flask app to azure in 5 mins
Navule Rao
 
PDF
Kloud
Pankaj Kaushal
 
PDF
Jenkins & Selenium
adamcarmi
 
PPTX
London Community Summit - Habitat 2016
Sarah Richards
 
PDF
Intro to Eclipse Che, by Tyler Jewell
jwi11iams
 
PPTX
Run Selenium Tests With Jenkins and BrowseEmAll
Daniel Herken
 
PDF
Selenium&amp;behave introduction
Chyi-Shian Jiang
 
PDF
Eclipse 2.5 Subversion Plugin Installation
SandeepSeshan
 
Setup a Dev environment that feels like $HOME on Windows 10
Stefan Scherer
 
Easy Setup for Parallel Test Execution with Selenium Docker
Sargis Sargsyan
 
Brief introduction to Symfony Flex
Fedir Kryvytskyi
 
Webenabled
Jason Arnold
 
What's new in Meteor 1.3?
Rick Wehrle
 
Chris Omland - AWS Code Deploy - BSDC 2016
roblund
 
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
Sargis Sargsyan
 
Hooking Docker With Selenium
Sujith Vakathanam
 
Composer Power User Tips
Tom Corrigan
 
fmcsadmin 1.0.0
Atsushi Matsuo
 
Deploy Angular to the Cloud (ngBucharest)
Simona Cotin
 
Welcome to Jenkins
Somkiat Puisungnoen
 
How to deploy flask app to azure in 5 mins
Navule Rao
 
Jenkins & Selenium
adamcarmi
 
London Community Summit - Habitat 2016
Sarah Richards
 
Intro to Eclipse Che, by Tyler Jewell
jwi11iams
 
Run Selenium Tests With Jenkins and BrowseEmAll
Daniel Herken
 
Selenium&amp;behave introduction
Chyi-Shian Jiang
 
Eclipse 2.5 Subversion Plugin Installation
SandeepSeshan
 

Viewers also liked (13)

DOCX
Chronic inflammtion
Tehseen Anwar
 
PDF
Backbone + React
Micah Wood
 
PDF
Shortcodes In-Depth
Micah Wood
 
PPT
First home buyers - Seminar - Mortgage Choice East Perth - Western Australia
mortgagechoiceeastperth
 
PPTX
JIIT;Project 2013-14,Project Presentation
Neha Singh
 
PDF
Becoming a WordPress Coding Master
Micah Wood
 
PDF
The Modern JavaScript Developers Toolbox
Micah Wood
 
PPTX
An efficient approach for illustrating web data of user search result
Neha Singh
 
PDF
Debugging in PHP
Micah Wood
 
PDF
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
Micah Wood
 
PDF
An Introduction to PHP Classes
Micah Wood
 
PDF
Testing Made Easy
Micah Wood
 
PPTX
Histology of stomach
Tehseen Anwar
 
Chronic inflammtion
Tehseen Anwar
 
Backbone + React
Micah Wood
 
Shortcodes In-Depth
Micah Wood
 
First home buyers - Seminar - Mortgage Choice East Perth - Western Australia
mortgagechoiceeastperth
 
JIIT;Project 2013-14,Project Presentation
Neha Singh
 
Becoming a WordPress Coding Master
Micah Wood
 
The Modern JavaScript Developers Toolbox
Micah Wood
 
An efficient approach for illustrating web data of user search result
Neha Singh
 
Debugging in PHP
Micah Wood
 
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
Micah Wood
 
An Introduction to PHP Classes
Micah Wood
 
Testing Made Easy
Micah Wood
 
Histology of stomach
Tehseen Anwar
 
Ad

Similar to Using Composer with WordPress - 2.0 (20)

PDF
Using composer with WordPress
Micah Wood
 
PDF
WordCamp Sacramento 2019: Modernizing Your Development Workflow Using Composer
Jeremy Ward
 
PDF
Leveraging Composer in Existing Projects
Mark Niebergall
 
PDF
12 Composer #burningkeyboards
Denis Ristic
 
PDF
Composer - The missing package manager for PHP
Tareq Hasan
 
PDF
Using Composer to create manageable WordPress websites
Anna Ladoshkina
 
PPTX
Nh php may 2014 - composer
David Weingart
 
PDF
composer_talk_20160209
Bradley Wogsland
 
PDF
Php Dependency Management with Composer ZendCon 2016
Clark Everetts
 
PDF
Dependency management with Composer
Jason Grimes
 
PPTX
Introducing composer - a php dependency manager
Digvijay Tiwari
 
DOCX
"The Power of Composer"
CodeShoppy
 
PDF
Composer Best Practices
Abid Malik
 
PDF
Composer Best Practices.pdf
Abid Malik
 
PDF
Composer Best Practices
Abid Malik
 
PDF
Php Dependency Management with Composer ZendCon 2017
Clark Everetts
 
PDF
Composer yourself: a reintroduction to composer
Eric Poe
 
PPTX
Composer namespacing
Deepak Chandani
 
PDF
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
rtCamp
 
Using composer with WordPress
Micah Wood
 
WordCamp Sacramento 2019: Modernizing Your Development Workflow Using Composer
Jeremy Ward
 
Leveraging Composer in Existing Projects
Mark Niebergall
 
12 Composer #burningkeyboards
Denis Ristic
 
Composer - The missing package manager for PHP
Tareq Hasan
 
Using Composer to create manageable WordPress websites
Anna Ladoshkina
 
Nh php may 2014 - composer
David Weingart
 
composer_talk_20160209
Bradley Wogsland
 
Php Dependency Management with Composer ZendCon 2016
Clark Everetts
 
Dependency management with Composer
Jason Grimes
 
Introducing composer - a php dependency manager
Digvijay Tiwari
 
"The Power of Composer"
CodeShoppy
 
Composer Best Practices
Abid Malik
 
Composer Best Practices.pdf
Abid Malik
 
Composer Best Practices
Abid Malik
 
Php Dependency Management with Composer ZendCon 2017
Clark Everetts
 
Composer yourself: a reintroduction to composer
Eric Poe
 
Composer namespacing
Deepak Chandani
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
rtCamp
 
Ad

More from Micah Wood (8)

PPTX
Introduction to JSX
Micah Wood
 
PDF
WP-CLI For The Win
Micah Wood
 
PDF
Using Chrome Dev Tools
Micah Wood
 
PDF
Debugging in PHP
Micah Wood
 
PDF
WordPress Hooks
Micah Wood
 
PDF
Advanced Development Workflows
Micah Wood
 
PDF
Troubleshooting WordPress Issues
Micah Wood
 
PPTX
Getting Started with Vagrant
Micah Wood
 
Introduction to JSX
Micah Wood
 
WP-CLI For The Win
Micah Wood
 
Using Chrome Dev Tools
Micah Wood
 
Debugging in PHP
Micah Wood
 
WordPress Hooks
Micah Wood
 
Advanced Development Workflows
Micah Wood
 
Troubleshooting WordPress Issues
Micah Wood
 
Getting Started with Vagrant
Micah Wood
 

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 

Using Composer with WordPress - 2.0