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
340
Other Decks in Technology
See All in Technology
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
120
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
190
kargoの魅力について伝える
magisystem0408
0
210
.NET 9 のパフォーマンス改善
nenonaninu
0
1k
生成AIのガバナンスの全体像と現実解
fnifni
1
190
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
5
210
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
570
第3回Snowflake女子会_LT登壇資料(合成データ)_Taro_CCCMK
tarotaro0129
0
200
2024年にチャレンジしたことを振り返るぞ
mitchan
0
140
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
We Have a Design System, Now What?
morganepeng
51
7.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
The Language of Interfaces
destraynor
154
24k
Building Your Own Lightsaber
phodgson
103
6.1k
Side Projects
sachag
452
42k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Gamification - CAS2011
davidbonilla
80
5.1k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Raft: Consensus for Rubyists
vanstee
137
6.7k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.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?