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
Using & Extending Composer
Search
Till Klampaeckel
November 07, 2013
Technology
6
760
Using & Extending Composer
My talk from Symfony Live 2013 in Berlin.
Till Klampaeckel
November 07, 2013
Tweet
Share
More Decks by Till Klampaeckel
See All by Till Klampaeckel
Extending Composer
till
2
880
Jimdo Tech Talk: The evolution of deployment
till
0
99
Managing remote teams
till
4
230
EasyBib & Cloudant
till
1
590
Collecting Metrics
till
3
550
SUHOSIN - PHP's safety net
till
2
320
nano
till
1
340
Other Decks in Technology
See All in Technology
Copilotの力を実感!3ヶ月間の生成AI研修の試行錯誤&成功事例をご紹介。果たして得たものとは・・?
ktc_shiori
0
340
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.4k
Bring Your Own Container: When Containers Turn the Key to EDR Bypass/byoc-avtokyo2024
tkmru
0
850
GeometryReaderやスクロールを用いた表現と紐解き方
fumiyasac0921
0
100
FODにおけるホーム画面編成のレコメンド
watarukudo
PRO
2
270
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
180
Building Scalable Backend Services with Firebase
wisdommatt
0
110
新卒1年目、はじめてのアプリケーションサーバー【IBM WebSphere Liberty】
ktgrryt
0
100
今から、 今だからこそ始める Terraform で Azure 管理 / Managing Azure with Terraform: The Perfect Time to Start
nnstt1
0
220
DMMブックスへのTipKit導入
ttyi2
1
110
商品レコメンドでのexplicit negative feedbackの活用
alpicola
1
340
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Unsuck your backbone
ammeep
669
57k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
How STYLIGHT went responsive
nonsquared
96
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Agile that works and the tools we love
rasmusluckow
328
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
240
Docker and Python
trallard
43
3.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Raft: Consensus for Rubyists
vanstee
137
6.7k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Transcript
www.easybib.com
[email protected]
Using & Extending Composer Your daily life with
Composer
www.easybib.com
[email protected]
Till I’m Till Klampäckel
www.easybib.com
[email protected]
Till Good to meet you.
www.easybib.com
[email protected]
Find me online @klimpong http://github.com/till http://till.klampaeckel.de/
www.easybib.com
[email protected]
Till 15 years of experience
www.easybib.com
[email protected]
ImagineEasy Solutions LLC An information literacy company.
www.easybib.com
[email protected]
Information Literacy •avoid plagiarism •evaluate sources
www.easybib.com
[email protected]
EasyBib.com EasyBib is an citation management platform. 40
million students use EasyBib every year. Over 1000 institutions subscribe, including 100 large US universities and 900 high schools and districts.
www.easybib.com
[email protected]
ResearchReady.com ResearchReady teaches information literacy skills in a
core curriculum. Universities and districts subscribe to give their students a research skill boost. Launched in January 2013.
www.easybib.com
[email protected]
Stack •PHP (5.3 & 5.4, on the way
to 5.5) •Nginx + Linux •AWS (OpsWorks, RDS, ElasticCache) •Solr, ElasticSearch •CouchDB / BigCouch •Travis-CI, PHPUnit, Behat •Vagrant, Chef, Virtualbox, Packer
www.easybib.com
[email protected]
Commercial break Some rights reserved by claire.whitehouse http://www.flickr.com/photos/citysnidget/
SOUNDS GOOD? WE’RE HIRING!
[email protected]
www.easybib.com
[email protected]
Composer We embrace it.
www.easybib.com
[email protected]
Composer Dependency management
www.easybib.com
[email protected]
Composer Dependency resolution
www.easybib.com
[email protected]
Composer Semantic Versioning
www.easybib.com
[email protected]
Composer Major.Minor.Bugfix 1.0.1
www.easybib.com
[email protected]
Composer http://semver.org/
www.easybib.com
[email protected]
Composer Your first package
www.easybib.com
[email protected]
Composoring your code { “name”: “till/secret-sauce”, “license”: “MIT”
}
www.easybib.com
[email protected]
Next step Publish code. —
www.easybib.com
[email protected]
Packagist •register on packagist.org •submit your package •setup
the service-hook (Github)
www.easybib.com
[email protected]
Ship it!
www.easybib.com
[email protected]
Shipping it • `git tag -a 1.0.0 -m
“this is my rock-solid 1.0.0”` `git push --tags` • `svn cp trunk tags/1.0.0`
www.easybib.com
[email protected]
Consuming { “name”: “fabpot/awesome”, “require”: { “till/secret-sauce”: “~1.0”
} }
www.easybib.com
[email protected]
Consuming { “name”: “fabpot/awesome”, “repositories”: [ { “type”:”package”,
“package”: { “name”: “sensio/legacy-code”, “version”: “3.2.4”, “dist”: { “url”: “http://dev.local/secret.zip”, “type”: “zip” } } } ], “require”: { “sensio/legacy-code”: “3.2.4”, “till/secret-sauce”: “~1.0” } }
ACHTUNG, ACHTUNG.
www.easybib.com
[email protected]
Repositories • Repositories are not inherited. • Put
open source code on packagist, or get satis.
www.easybib.com
[email protected]
Consuming • There are a lot, lot more
options. • Check http://getcomposer.org/
www.easybib.com
[email protected]
Installing cd awesome-application curl -sS http://getcomposer.org/installer |php ./composer.phar
install
www.easybib.com
[email protected]
What else? • Update your dependencies. • Search
for dependencies. • Development dependencies. • Classmap and PSR-0 autoloaders. • “help”
Breath.
www.easybib.com
[email protected]
One more thing Do you know composer’s global
command?
www.easybib.com
[email protected]
Go PEAR! Go global! •$COMPOSER_HOME/composer.json •./composer.phar global install
www.easybib.com
[email protected]
Satis Your own private packagist.org.
Because what could go wrong?
www.easybib.com
[email protected]
Things that will go wrong • Github is
down. • Packagist is down. • Internet is slow. • Internet doesn’t work. • Tags get deleted. (cc fabpot :)
Own your availability!
www.easybib.com
[email protected]
Captain Obvious Your proprietary code is private.
www.easybib.com
[email protected]
Setup ./composer.phar \ create-project \ composer/satis \ --stability=dev
\ --prefer-dist
www.easybib.com
[email protected]
satis.json { "name": "Till's satis", "homepage": "http://satis.local", "require-all":
true, "repositories": [ {"packagist": false}, { "type":"vcs", "url":"http://github.com/fabpot/symfony" } ] }
www.easybib.com
[email protected]
Build ./bin/satis build ./satis.json public php -S 0.0.0.0:80
-t public
www.easybib.com
[email protected]
Build
www.easybib.com
[email protected]
Go back { “name”: “fabpot/awesome”, “repositories”: [ {
“type”:”composer”, “url”: “http://satis.local” } ], “require”: { “sensio/legacy-code”: “3.2.4”, “till/secret-sauce”: “~1.0” } }
www.easybib.com
[email protected]
Next steps • fork code — e.g. to
a local backup server • generate your own downloads • configure Amazon S3 as a backend
www.easybib.com
[email protected]
Next steps http://www.flickr.com/photos/mightymightymatze/
Want even more?
www.easybib.com
[email protected]
Extending Composer Or, bending Composer to your will.
www.easybib.com
[email protected]
Plugins
www.easybib.com
[email protected]
Composer installer
www.easybib.com
[email protected]
Composer installer Install jQuery, bootstrap, etc.! https://github.com/RobLoach/component-installer
www.easybib.com
[email protected]
Composer installer • aura • ezPublish • flow/typo3
• fuel • magento • wordpress • yii
www.easybib.com
[email protected]
Event-Plugins
www.easybib.com
[email protected]
Plugin Events COMMAND https://github.com/easybiblabs/composer-newrelic
www.easybib.com
[email protected]
Plugin Events PRE_FILE_DOWNLOAD https://github.com/naderman/composer-aws
We’re almost done!
Lessons learned.
www.easybib.com
[email protected]
Deploying with Composer is hard
www.easybib.com
[email protected]
Github is down more often than you think
www.easybib.com
[email protected]
Github is not down as often as you
think :)
www.easybib.com
[email protected]
API limits suck
www.easybib.com
[email protected]
Composer wants your RAM
www.easybib.com
[email protected]
~/.composer/config.json
www.easybib.com
[email protected]
Always “composer validate”
www.easybib.com
[email protected]
Always check in the “composer.phar”
www.easybib.com
[email protected]
Versioning is hard
www.easybib.com
[email protected]
Dependency resolution
www.easybib.com
[email protected]
“composer update” broke my app
www.easybib.com
[email protected]
#1 contender for merge conflicts: The composer.lock
www.easybib.com
[email protected]
Thanks! Questions?