Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Phpmatsuri2013

2,118 views

Published on

Published in: Technology
  • Be the first to comment

Phpmatsuri2013

  1. 1. Composer Proxy JP kawahara@bucyou.net c09 @ooharabucyou PHPMATSURI 2013 in Sapporo, 2013-07-15
  2. 2. Dependency Manager for PHP npm
  3. 3. Central Repository Awsome
  4. 4. Problem ● meh... Slow... Slow... Slow... ● There are 300 - 500ms latencies to packagist.org from Japan.
  5. 5. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) 10:00 a.m.
  6. 6. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) 10:02 a.m.
  7. 7. [kawahara@udon ~ master] $ composer update -- dev Updating dependencies (including require-dev) 10:03 a.m.
  8. 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. 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. 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. 11. My Answer ● Better Proxy in Japan
  12. 12. Application ● Name: composer-proxy ● Very Very simple Silex application. ● Features ○ proxy and cache. ● composer-proxy.jp in Sakura-Cloud.
  13. 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. 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. 15. In furture ● Support notice (for download count) by asyncronous message queue. ● Support search ● Distribution archive cache ● Add own packages
  16. 16. OMAKE ● vagrant-packagist (https://github. com/kawahara/vagrant-packagist) ○ You can setup own packagist! ○ 本当は packagist 改造しようと思ったけど、やめた残 骸。PHPer には不慣れな、solr の <del>設定もやってく れるぞ!! </del>インストールもやってくれるぞ。
  17. 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

×