Phpmatsuri2013
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,277
On Slideshare
1,061
From Embeds
216
Number of Embeds
3

Actions

Shares
Downloads
2
Comments
0
Likes
3

Embeds 216

http://www.bucyou.net 207
http://l-log.com 7
https://twitter.com 2

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Composer Proxy JP kawahara@bucyou.net c09 @ooharabucyou PHPMATSURI 2013 in Sapporo, 2013-07-15
  • 2. Dependency Manager for PHP npm
  • 3. Central Repository Awsome
  • 4. Problem ● meh... Slow... Slow... Slow... ● There are 300 - 500ms latencies to packagist.org from Japan.
  • 5. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) 10:00 a.m.
  • 6. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) 10:02 a.m.
  • 7. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) 10:03 a.m.
  • 8. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) ...... Your requirements could not be resolved to an installable set of packages. 10:05 a.m.
  • 9. Mecanisum of Composer 1. Gets /packagis.json from repository ○ Ok. It's very fast. Only 1KB. 2. Gets providers information from repository ○ Gets 4 files. 3. Gets package information ○ In case of Symfony Standard ○ 72 files, 7.7MB ○ (If there is file cache in local, composer fetch data from here.) 4. Resolve Dependencies 5. Gets Package (Archive or Source)
  • 10. Some ways to resolve it ● Use private repository ○ satis (composer/satis を活用してComposer パッ ケージの配布を行う http://www.bucyou.net/blog/952) ○ Broker (https://github.com/researchgate/broker) ● Satis is good solution, but we need install required package in advance. ● Make mirror in Japan.
  • 11. My Answer ● Better Proxy in Japan
  • 12. Application ● Name: composer-proxy ● Very Very simple Silex application. ● Features ○ proxy and cache. ● composer-proxy.jp in Sakura-Cloud.
  • 13. How to use? ● Edit your composer global configuration. (default $HOME/.composer/config.json) { "repositories": [ { "packagist": false }, { "type": "composer", "url": "http://composer-proxy.jp/proxy/packagist" } ] }
  • 14. Speed ● resolve dependencies of symfony/console ● direct to packagist.org ○ 120.24 secouns ● composer-proxy.jp (cached) ○ 41.35 seconds ● 3x faster!!! ● Need more cache information in Japan!! Please use!!
  • 15. In furture ● Support notice (for download count) by asyncronous message queue. ● Support search ● Distribution archive cache ● Add own packages
  • 16. OMAKE ● vagrant-packagist (https://github. com/kawahara/vagrant-packagist) ○ You can setup own packagist! ○ 本当は packagist 改造しようと思ったけど、やめた残 骸。PHPer には不慣れな、solr の <del>設定もやってく れるぞ!! </del>インストールもやってくれるぞ。
  • 17. About Me ● c09 ● Access! http://composer-proxy.jp/ ● Ooharabucyou (Shogo Kawahara) ● Web API Developer, Rakuten, Inc. (http: //webservice.rakuten.co.jp ● #groovy #java #php #edogawa-ku #openpne