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
230
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
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
強いチームと開発生産性
onk
PRO
33
11k
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
580
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
240
[FOSS4G 2019 Niigata] AIによる効率的危険斜面抽出システムの開発について
nssv
0
310
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
4 Signs Your Business is Dying
shpigford
180
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
A better future with KSS
kneath
238
17k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
A designer walks into a library…
pauljervisheath
203
24k
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?