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
750
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
860
Jimdo Tech Talk: The evolution of deployment
till
0
97
Managing remote teams
till
4
220
EasyBib & Cloudant
till
1
580
Collecting Metrics
till
3
540
SUHOSIN - PHP's safety net
till
2
310
nano
till
1
330
Other Decks in Technology
See All in Technology
ネット広告に未来はあるか?「3rd Party Cookie廃止とPrivacy Sandboxの効果検証の裏側」 / third-party-cookie-privacy
cyberagentdevelopers
PRO
1
130
Amazon_CloudWatch_ログ異常検出_導入ガイド
tsujiba
4
1.6k
omakaseしないための.rubocop.yml のつくりかた / How to Build Your .rubocop.yml to Avoid Omakase #kaigionrails
linkers_tech
3
730
Gradle: The Build System That Loves To Hate You
aurimas
2
150
[AWS JAPAN 生成AIハッカソン] Dialog の紹介
yoshimi0227
0
150
Autify Company Deck
autifyhq
1
39k
日経電子版におけるリアルタイムレコメンドシステム開発の事例紹介/nikkei-realtime-recommender-system
yng87
1
500
フルカイテン株式会社 採用資料
fullkaiten
0
36k
Automated Promptingを目指すその前に / Before we can aim for Automated Prompting
rkaga
0
110
VPC間の接続方法を整理してみた #自治体クラウド勉強会
non97
1
840
急成長中のWINTICKETにおける品質と開発スピードと向き合ったQA戦略と今後の展望 / winticket-autify
cyberagentdevelopers
PRO
1
160
新卒1年目が挑む!生成AI × マルチエージェントで実現する次世代オンボーディング / operation-ai-onboarding
cyberagentdevelopers
PRO
1
160
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
Adopting Sorbet at Scale
ufuk
73
9k
Unsuck your backbone
ammeep
668
57k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Writing Fast Ruby
sferik
626
61k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Six Lessons from altMBA
skipperchong
26
3.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
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?