Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Managing PHP Dependencies with Composer
Search
Chris Taggart
April 01, 2015
Programming
48
0
Share
Managing PHP Dependencies with Composer
Intro to Composer for PHP, Ottawa PHP Meetup - April 1, 2015
Chris Taggart
April 01, 2015
Other Decks in Programming
See All in Programming
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
120
Inspired By RubyKaigi (EN)
atzzcokek
0
500
初めてのRubyKaigiはこう見えた
jellyfish700
0
410
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
150
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
460
Claspは野良GASの夢をみるか
takter00
0
160
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
230
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
240
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1.1k
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.5k
CSC307 Lecture 17
javiergs
PRO
0
310
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
A better future with KSS
kneath
240
18k
We Are The Robots
honzajavorek
0
240
Building the Perfect Custom Keyboard
takai
2
780
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
Mobile First: as difficult as doing things right
swwweet
225
10k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
330
Fireside Chat
paigeccino
42
3.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
Managing Dependencies with Composer Chris Taggart / @christaggart Ottawa PHP
Meetup / April 2015
None
Who has heard of composer?
Who is using it?
Managing Dependencies Sucks.
A lot.
But it doesn’t have to.
“Old way”
Go to the project’s site
Download a zip file or tarball
Unzip the file
Move it into some shared libraries folder
Scramble when a security fix is released
Repeat.
So much pain.
Enter Composer
None
Composer • Command-line utility with which you install packages. •
Very similar to “npm” or Bundler • Works on *nix, OS X, Windows, PHP 5.3.2+
Packagist
composer.json { "require": { "monolog/monolog": "~1.13" }, "authors": [ {
"name": "Chris Taggart", "email": "
[email protected]
" } ] }
$ composer install
None
composer.lock
Additional Goodies
Autoloading ./vendor/autoload.php require ‘vendor/autoload.php';
Easy to use third-party code <?php $log = new Monolog\Logger('AppLog');
$log->pushHandler(new Monolog\Handler \StreamHandler('app.log', Monolog \Logger::WARNING)); $log->addWarning('Foo');
Or your own code { "autoload": { "psr-4": {"Acme\\": “src/library/"}
} }
Get Composer `curl -sS https://getcomposer.org/installer | php` OR brew install
composer or Windows Installer
CAUTION LIVE DEMO
thephpleague.com
Questions?
Links • getcomposer.org • packagist.org • thephpleague.com