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
870
Jimdo Tech Talk: The evolution of deployment
till
0
97
Managing remote teams
till
4
230
EasyBib & Cloudant
till
1
580
Collecting Metrics
till
3
550
SUHOSIN - PHP's safety net
till
2
320
nano
till
1
330
Other Decks in Technology
See All in Technology
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
180
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
320
podman_update_2024-12
orimanabu
1
260
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.2k
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
110
なぜCodeceptJSを選んだか
goataka
0
160
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
Featured
See All Featured
Being A Developer After 40
akosma
87
590k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Bash Introduction
62gerente
608
210k
Building Your Own Lightsaber
phodgson
103
6.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Designing Experiences People Love
moore
138
23k
Mobile First: as difficult as doing things right
swwweet
222
9k
For a Future-Friendly Web
brad_frost
175
9.4k
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?