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
0
47
Managing PHP Dependencies with Composer
Intro to Composer for PHP, Ottawa PHP Meetup - April 1, 2015
Chris Taggart
April 01, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
190
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.2k
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
CSC307 Lecture 04
javiergs
PRO
0
660
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
290
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
170
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
CSC307 Lecture 06
javiergs
PRO
0
690
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
50
Abbi's Birthday
coloredviolet
1
4.7k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
260
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
The SEO Collaboration Effect
kristinabergwall1
0
350
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
190
30 Presentation Tips
portentint
PRO
1
220
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
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