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
780
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
900
Jimdo Tech Talk: The evolution of deployment
till
0
100
Managing remote teams
till
4
230
EasyBib & Cloudant
till
1
600
Collecting Metrics
till
3
570
SUHOSIN - PHP's safety net
till
2
340
nano
till
1
350
Other Decks in Technology
See All in Technology
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
20k
開発現場とセキュリティ担当をつなぐ脅威モデリング
cloudace
0
140
20250325_Logic Apps / Power Automate の SharePoint コネクタの裏側を知る 〜Graph APIで直接操作してみよう〜
yutakaosada
0
110
ルートユーザーの活用と管理を徹底的に深掘る
yuobayashi
8
740
50人の組織でAIエージェントを使う文化を作るためには / How to Create a Culture of Using AI Agents in a 50-Person Organization
yuitosato
3
1.5k
GitHub MCP Serverを使って Pull Requestを作る、レビューする
hiyokose
2
580
PostgreSQL Unconference #52 pg_tde
nori_shinoda
1
250
Cloud Native PG 使ってみて気づいたことと最新機能の紹介 - 第52回PostgreSQLアンカンファレンス
seinoyu
2
250
Zabbixチョットデキルとは!?
kujiraitakahiro
0
130
Proxmox VE超入門 〜 無料で作れるご自宅仮想化プラットフォームブックマークする
devops_vtj
0
250
コドモンのQAの今までとこれから -XPによる成長と見えてきた課題-
masasuna
0
150
MCP Documentation Server @AI Coding Meetup #1
yyoshiki41
1
2k
Featured
See All Featured
Bash Introduction
62gerente
611
210k
The Invisible Side of Design
smashingmag
299
50k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
We Have a Design System, Now What?
morganepeng
51
7.5k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Designing Experiences People Love
moore
141
23k
Into the Great Unknown - MozCon
thekraken
36
1.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
Transcript
www.easybib.com jobs@imagineeasy.com Using & Extending Composer Your daily life with
Composer
www.easybib.com jobs@imagineeasy.com Till I’m Till Klampäckel
www.easybib.com jobs@imagineeasy.com Till Good to meet you.
www.easybib.com jobs@imagineeasy.com Find me online @klimpong http://github.com/till http://till.klampaeckel.de/
www.easybib.com jobs@imagineeasy.com Till 15 years of experience
www.easybib.com jobs@imagineeasy.com ImagineEasy Solutions LLC An information literacy company.
www.easybib.com jobs@imagineeasy.com Information Literacy •avoid plagiarism •evaluate sources
www.easybib.com jobs@imagineeasy.com 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 jobs@imagineeasy.com 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 jobs@imagineeasy.com 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 jobs@imagineeasy.com Commercial break Some rights reserved by claire.whitehouse http://www.flickr.com/photos/citysnidget/
SOUNDS GOOD? WE’RE HIRING! till+symfonylive@imagineeasy.com
www.easybib.com jobs@imagineeasy.com Composer We embrace it.
www.easybib.com jobs@imagineeasy.com Composer Dependency management
www.easybib.com jobs@imagineeasy.com Composer Dependency resolution
www.easybib.com jobs@imagineeasy.com Composer Semantic Versioning
www.easybib.com jobs@imagineeasy.com Composer Major.Minor.Bugfix 1.0.1
www.easybib.com jobs@imagineeasy.com Composer http://semver.org/
www.easybib.com jobs@imagineeasy.com Composer Your first package
www.easybib.com jobs@imagineeasy.com Composoring your code { “name”: “till/secret-sauce”, “license”: “MIT”
}
www.easybib.com jobs@imagineeasy.com Next step Publish code. —
www.easybib.com jobs@imagineeasy.com Packagist •register on packagist.org •submit your package •setup
the service-hook (Github)
www.easybib.com jobs@imagineeasy.com Ship it!
www.easybib.com jobs@imagineeasy.com 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 jobs@imagineeasy.com Consuming { “name”: “fabpot/awesome”, “require”: { “till/secret-sauce”: “~1.0”
} }
www.easybib.com jobs@imagineeasy.com 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 jobs@imagineeasy.com Repositories • Repositories are not inherited. • Put
open source code on packagist, or get satis.
www.easybib.com jobs@imagineeasy.com Consuming • There are a lot, lot more
options. • Check http://getcomposer.org/
www.easybib.com jobs@imagineeasy.com Installing cd awesome-application curl -sS http://getcomposer.org/installer |php ./composer.phar
install
www.easybib.com jobs@imagineeasy.com What else? • Update your dependencies. • Search
for dependencies. • Development dependencies. • Classmap and PSR-0 autoloaders. • “help”
Breath.
www.easybib.com jobs@imagineeasy.com One more thing Do you know composer’s global
command?
www.easybib.com jobs@imagineeasy.com Go PEAR! Go global! •$COMPOSER_HOME/composer.json •./composer.phar global install
www.easybib.com jobs@imagineeasy.com Satis Your own private packagist.org.
Because what could go wrong?
www.easybib.com jobs@imagineeasy.com 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 jobs@imagineeasy.com Captain Obvious Your proprietary code is private.
www.easybib.com jobs@imagineeasy.com Setup ./composer.phar \ create-project \ composer/satis \ --stability=dev
\ --prefer-dist
www.easybib.com jobs@imagineeasy.com 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 jobs@imagineeasy.com Build ./bin/satis build ./satis.json public php -S 0.0.0.0:80
-t public
www.easybib.com jobs@imagineeasy.com Build
www.easybib.com jobs@imagineeasy.com 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 jobs@imagineeasy.com Next steps • fork code — e.g. to
a local backup server • generate your own downloads • configure Amazon S3 as a backend
www.easybib.com jobs@imagineeasy.com Next steps http://www.flickr.com/photos/mightymightymatze/
Want even more?
www.easybib.com jobs@imagineeasy.com Extending Composer Or, bending Composer to your will.
www.easybib.com jobs@imagineeasy.com Plugins
www.easybib.com jobs@imagineeasy.com Composer installer
www.easybib.com jobs@imagineeasy.com Composer installer Install jQuery, bootstrap, etc.! https://github.com/RobLoach/component-installer
www.easybib.com jobs@imagineeasy.com Composer installer • aura • ezPublish • flow/typo3
• fuel • magento • wordpress • yii
www.easybib.com jobs@imagineeasy.com Event-Plugins
www.easybib.com jobs@imagineeasy.com Plugin Events COMMAND https://github.com/easybiblabs/composer-newrelic
www.easybib.com jobs@imagineeasy.com Plugin Events PRE_FILE_DOWNLOAD https://github.com/naderman/composer-aws
We’re almost done!
Lessons learned.
www.easybib.com jobs@imagineeasy.com Deploying with Composer is hard
www.easybib.com jobs@imagineeasy.com Github is down more often than you think
www.easybib.com jobs@imagineeasy.com Github is not down as often as you
think :)
www.easybib.com jobs@imagineeasy.com API limits suck
www.easybib.com jobs@imagineeasy.com Composer wants your RAM
www.easybib.com jobs@imagineeasy.com ~/.composer/config.json
www.easybib.com jobs@imagineeasy.com Always “composer validate”
www.easybib.com jobs@imagineeasy.com Always check in the “composer.phar”
www.easybib.com jobs@imagineeasy.com Versioning is hard
www.easybib.com jobs@imagineeasy.com Dependency resolution
www.easybib.com jobs@imagineeasy.com “composer update” broke my app
www.easybib.com jobs@imagineeasy.com #1 contender for merge conflicts: The composer.lock
www.easybib.com jobs@imagineeasy.com Thanks! Questions?