Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Composer: Modern PHP Package Management
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Justin Yost
April 08, 2016
Programming
77
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Composer: Modern PHP Package Management
Justin Yost
April 08, 2016
More Decks by Justin Yost
See All by Justin Yost
Laravel 6, 7 and Other Goodies
justinyost
2
130
PHP and Databases
justinyost
2
73
Ansible: What Is It and What Is It Good For?
justinyost
0
93
Generators: All About the Yield
justinyost
0
11
Laravel 6: What's New and What's Changed
justinyost
0
240
Middleware: Between the Framework and the Browser
justinyost
2
130
Caching and You and You and You and You...
justinyost
0
98
Git: The Pain and the Gain
justinyost
0
220
Generators: All About the Yield
justinyost
0
320
Other Decks in Programming
See All in Programming
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Domain-Driven Transformation
hschwentner
2
2.3k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
contenteditable と日本語入力に向き合う
colorful12
0
200
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
ChromeでローカルLLM
ryu1013
0
140
カツオ、ご期待ください
suneo3476
0
190
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
golang-bob.pdf
iwatsukayura
0
130
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
880
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
290
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
A Tale of Four Properties
chriscoyier
163
24k
It's Worth the Effort
3n
188
29k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
520
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
Tell your own story through comics
letsgokoyo
1
1.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Transcript
Composer: Modern PHP Package Management Justin Yost Web Developer at
Loadsys
What is Composer? —Composer is a modern PHP Dependency Management
Tool
What is Dependency Management? —Install Stuff —Everyone else installs same
version of stuff
Why Do I Care? —Multiple teammates —Install multiple versions on
your machine —Easily stay up to date —Build new projects with Awesome Framework
Requirements —PHP 5.3.2+
Install Mac: php composer-setup.php --install-dir=bin --filename=composer mv composer.phar /usr/local/bin/composer Windows:
look in the docs
What Now? —Now, we can install packages pretty easily
Example
composer require rych/random
require __DIR__ . '/vendor/autoload.php'; $random = new Rych\Random\Random(); $randomInt =
$random->getRandomInteger(1, 100); echo $randomInt . "\r\n";
Where should you use Composer —Everywhere you have a dependency
as part of your PHP projects —Everywhere you have a shared PHP project
What all can Composer do? —It doesn't have to be
PHP —Loadsys has a suite of shell scripts managed via Composer —github.com/loadsys/CakePHP-Shell-Scripts
What all can Composer do? —It doesn't have to be
public facing —Composer will hook into private repositories
What all can Composer do? —The project doesn't even have
to use Composer itself —Composer will install Git/SVN/Mercurial/PEAR backed projects by itself
What all can Composer do? —Install Dependencies for Dev Only
—composer require --dev {vendor/package} —composer install --dev/--no-dev
What all can Composer do? —PHP Version/Extension Requirements "require": {
"php": ">=5.6.0", "ext-openssl": "*" }
What all can Composer do? —SubDependencies —Example chain: symfony/symfony ->
doctrine/common -> doctrine/inflector -> php >=5.3.2
What all can Composer do? —SubDependencies in DevMode —Only installs
top level dev dependencies —Example chain: symfony/symfony -> cache/integration- tests -> psr/cache -> php: >=5.3.0
What all can Composer do? —Lock to Major/Minor/Patch Releases vendor/package:
3.* vendor/package: 3.0.* vendor/package: ~1.2 vendor/package: ~1.2.3 vendor/package: ^1.2.3 vendor/package: ^0.3
What all can Composer do? —Suggest other packages "suggest": {
"vendor/package": "Allow you to do other awesome thing.", },
What all can Composer do? —List Meta Information for Package
"homepage", "license", "authors", "support", "keywords", "description",
What all can Composer do? —Replace other packages "replace": {
"vendor/package": "self.version" }
What all can Composer do? —Conflicts "conflict": { "vendor/package": "1.2.3"
}
What all can Composer do? —Install SubTypes "type": "library", "type":
"project", "type": "metapackage",
What all can Composer do? —Install Custom Types —https://github.com/composer/installers "type":
"wordpress-plugin", "require": { "composer/installers": "~1.0" }
What all can Composer do? —Install Specific Branches "require": {
"vendor/package": "dev-bugfixes" }
Example
Composer Create Project composer create-project —create-project is pretty unique to
Composer —Clones a package, installs dependencies and run scripts for setup, etc
Example
Packagist —Packagist is a repository of Composer Packages for the
PHP Community —Packagist is open source and you can add your own packages
Publish your own stuff on Packagist —Code
ToranProxy —Internal version of Packagist —Provides dupes of public packages
—Provides hosting for internal only packages
Upgrade Your Development Process —Composer will make your projects easier
to manage —Composer will make dependencies less of a hassle —Composer will make deployments simpler and easier
Composer Workflow —composer require —composer install —composer update —composer remove
Final Thoughts —Composer is PHP's way of handling dependency management
—Composer is pretty easy to get started with —Publish your stuff with Composer/Packagist
Thanks/Questions? —twitter.com/justinyost —github.com/justinyost —justinyost.com —lynda.com/justinyost