Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Composerを速くするために必要だったもの /composer-keynote

Composerを速くするために必要だったもの /composer-keynote

PHPカンファレンス関西2016の基調講演です。

Hiraku NAKANO

July 16, 2016
Tweet

More Decks by Hiraku NAKANO

Other Decks in Technology

Transcript

  1. $PNQPTFSΛ଎͘͢ΔͨΊʹ
    ඞཁͩͬͨ΋ͷ
    PHPカンファレンス関西2016 基調講演
    @Hiraku

    View full-size slide

  2. ࣗຫΛ͠·͢ʂ

    View full-size slide

  3. IUUQHJUIVCBXBSETDPNΛ
    DPVOUSZKBQBO
    MBOHVBHF1)1
    ͰߜΓࠐΈ

    View full-size slide

  4. ͪͳΈʹੈքϨϕϧͩͱ

    View full-size slide

  5. ্ʹ͸্͕͍·͢ʜ

    View full-size slide

  6. վΊͯࣗݾ঺հ
    w த໺୓
    w IUUQTUXJUUFSDPN)JSBLV
    w IUUQTHJUIVCDPNIJSBL
    w (JU)VCελʔ਺೔ຊҰͷ1)1FS ࠷ۙಘͨশ߸

    w גࣜձࣾϝϧΧϦͷαʔόʔαΠυΤϯδχΞ
    w 1)1ྺ͸೥͙Β͍
    w झຯ͸$PNQPTFSΛ଎͘͢Δ͜ͱ

    View full-size slide

  7. ࠓ೔࿩͍ͨ͜͠ͱ
    w $PNQPTFSͷ֓ཁ
    w $PNQPTFS͕஗͍ཧ༝
    w $PNQPTFSΛ଎͘͢Δ
    w ຊ౰ʹඞཁͩͬͨ΋ͷ

    View full-size slide

  8. $PNQPTFSͷ֓ཁ
    PHPカンファレンス関西2016 基調講演
    第一部

    View full-size slide

  9. $PNQPTFS
    w 1)1ϥΠϒϥϦͷґଘؔ܎ղܾπʔϧ
    w ࠒʹ։ൃελʔτ OQNͷӨڹ

    w 1)1Ҏ߱ʹରԠ Λ੾Γࣺͯ

    w BVUPMPBEFSͷࣗಈੜ੒
    w ଟ༷ͳϦϙδτϦܗࣜʹରԠ
    w ϓϥάΠϯػߏ
    w IUUQTHFUDPNQPTFSPSH

    View full-size slide

  10. ύοέʔδϚωʔδϟͰ͸ͳ͍ͷʜʁ
    w ʰґଘؔ܎ղܾπʔϧʱͱԿނ໊͔৐Γ͕ͨΔ
    w ʮϏϧυͯ͠ݻΊͯ഑෍͢Δʯͱ͍͏

    ύοέʔδϯάػೳ͕΄ͱΜͲͳ͍
    w ֦ுͯ͠࡞ΕΔΑ͏ʹ͸ͳͬͯΔ͚Ͳɺ͋·Γ࢖ΘΕͯͳ͍

    View full-size slide

  11. $ curl -sL https://getcomposer.org/installer | php
    (実態はこんな感じ)
    $ curl -O composer https://getcomposer.org/download/1.1.3/composer.phar
    ࢖͍͸͡ΊΔͷ͸؆୯
    IUUQTHFUDPNQPTFSPSHEPXOMPBE
    QIBSϑΝΠϧΛҰݸμ΢ϯϩʔυ͢Δ͚ͩɻ
    JOTUBMMFSܦ༝Λਪ঑ʢϋογϡ஋ͷݕূͳͲΛͯ͘͠ΕΔʣ

    View full-size slide

  12. $ composer
    ______
    / ____/___ ____ ___ ____ ____ ________ _____
    / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
    / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
    \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
    /_/
    Composer version 1.1.2 2016-05-31 19:48:11
    Usage:
    command [options] [arguments]
    Options:
    -h, --help Display this help message
    -q, --quiet Do not output any message
    -V, --version Display this application version
    --ansi Force ANSI output
    --no-ansi Disable ANSI output
    -n, --no-interaction Do not ask any interactive question
    --profile Display timing and memory usage information
    --no-plugins Whether to disable plugins.
    -d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
    -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
    DPNQPTFSίϚϯυ

    View full-size slide

  13. 対話形式でプロジェクトをセットアップ
    $ composer init
    ライブラリの追加
    $ composer require 'vendor/package'
    ライブラリのアップデート
    $ composer update
    composer.jsonに従ってまとめてインストール
    $ composer install
    Α͘࢖͏αϒίϚϯυ

    View full-size slide

  14. $PNQPTFS༻ޠ
    w ύοέʔδίʔυͷ·ͱ·ΓɺϥΠϒϥϦͷ࠶ར༻୯Ґ
    w ϦϙδτϦෳ਺ͷύοέʔδΛ·ͱΊͨ΋ͷ
    w Ҏ߱ɺ্هͭͷ୯ޠ͸$PNQPTFS༻ޠͱͯ͠࢖͍·͢

    View full-size slide

  15. $PNQPTFSͷத৺ࢥ૝

    View full-size slide

  16. l͢΂ͯ͸ύοέʔδͰ͋Δz

    View full-size slide

  17. ͦͷੲɺ1&"3ͱ͍͏΋ͷ͕͋ͬͨͦ͏ͳ
    w ͔͠͠QFBSQIQOFUʹͳ͍΋ͷ͕Ұഋ͋ͬͨ
    w ໺ྑQFBSϦϙδτϦ
    w [JQϑΝΠϧ഑෍
    w 8FCΞϓϦέʔγϣϯ͸1&"3ϥΠϒϥϦͰ͸ͳ͍

    View full-size slide


  18. PEARパッケージ
    PEARパッケージ
    PEARパッケージ
    Webアプリ
    Webアプリ
    Webアプリ
    ϥΠϒϥϦΛ࢖ͬͯ
    Կ͔Λ࡞Δଆ
    ϥΠϒϥϦఏڙଆ

    View full-size slide

  19. $PNQPTFS͸ʮ࢖͏͚ͩʯΛڐ͞ͳ͍

    View full-size slide

  20. $ composer init
    ...
    $ ls
    composer.json
    => このjsonファイルを持つ = composerパッケージ
    JOJU͸ʮύοέʔδ࡞੒ʯͷίϚϯυ

    View full-size slide

  21. $PNQPTFS͸શ෦ύοέʔδͱΈͳ͢
    w ϥΠϒϥϦ
    w ϑϨʔϜϫʔΫ
    w 1)1
    w ֦ுϞδϡʔϧ
    w $PNQPTFSࣗ਎
    w ͋ͳ͕ͨ࡞ͬͨ8FCΞϓϦέʔγϣϯ
    composer.jsonを持っていればパッケージだし、
    composer.jsonを持っていなくてもパッケージにできる

    View full-size slide


  22. Composer

    パッケージ
    Webアプリ
    ϥΠϒϥϦΛ࢖ͬͯ
    Կ͔Λ࡞Δଆ
    ϥΠϒϥϦఏڙଆ
    Composer

    パッケージ
    Composer

    パッケージ
    ライブラリ使いたい
    な。。

    View full-size slide

  23. Composer

    パッケージ
    Webアプリ
    (Composerパッケージ)
    ϥΠϒϥϦΛ࢖ͬͯ
    Կ͔Λ࡞Δଆ
    ϥΠϒϥϦఏڙଆ
    Composer

    パッケージ
    Composer

    パッケージ
    自分がComposerパッケージ
    にならないと他のComposer
    パッケージを使えない

    View full-size slide

  24. ࡞Δਓͱ࢖͏ਓɺ
    ͦ͜ʹҧ͍ͳͲͳ͍ʂ

    View full-size slide

  25. ʜͰ΋ɺͳͥͦΜͳઃܭΛબΜͩͷ͔ʁ

    View full-size slide

  26. ౷Ұ֓೦͸෺ࣄΛγϯϓϧʹ͢Δ
    w 6/*9͸ϑΝΠϧͰग़དྷ͍ͯΔ
    w 8FC͸ϦιʔεͰग़དྷ͍ͯΔ
    w 3%#͸ू߹͔Βग़དྷ͍ͯΔ
    w ΦϒδΣΫτࢦ޲ݴޠ͸ΦϒδΣΫτ͔Βग़དྷ͍ͯΔ

    View full-size slide

  27. ύοέʔδಉ࢜ͷؔ܎ੑͰશ෦ॻ͚Δ
    w SFRVJSF ඞཁ

    w SFRVJSFEFW ։ൃ͚࣌ͩඞཁ

    w TVHHFTU ͋ͬͨΒػೳ͕૿͑ΔΑ

    w DPOqJDU ಉ࣌ʹಈ͔ͤͳ͍Α

    w SFQMBDF ஔ͖׵͑ΒΕΔ

    w QSPWJEF ػೳΛఏڙ͢Δ

    composer.jsonに記述。
    すべてパッケージなので、

    この記述だけで全部やりくりする。

    View full-size slide

  28. ͦͯ͠ԿΑΓ΋ʜ

    View full-size slide

  29. ୭͔͕ύοέʔδΛ࢖͏ͱ
    ύοέʔδ͕৽ͨʹݸ࡞ΒΕΔ
    package
    package
    package
    package
    package
    package
    便利なpackage
    package
    package

    View full-size slide

  30. DPNQPTFSύοέʔδΛҰൠެ։͢Δͷ͸
    ඇৗʹ؆୯
    w ৹ࠪෆཁ
    w όʔδϣϯͷࣗಈߋ৽ (JU)VC࿈ܞ

    View full-size slide

  31. 1BDLBHFTSFHJTUFSFE

    7FSTJPOTBWBJMBCMF

    1BDLBHFTJOTUBMMFE
    TJODF

       
    ͪͳΈʹ

    1&"3ొ࿥ύοέʔδ

    ͸

    View full-size slide

  32. l͢΂ͯ͸ύοέʔδͰ͋Δz
    w ࠓͰͦ͜௝͘͠ͳ͍͕ɺ1)1ίϛϡχςΟʹ͜ͷ֓೦Λ༌ೖ͠
    ͨޭ੷͸େ͖͍
    w ͓ͦΒ͘OQNΠϯεύΠϠ
    w 1)1ίϛϡχςΟͷ੒௕ΛՃ଎ͤͨ͞

    View full-size slide

  33. $PNQPTFSͷத৺ࢥ૝
    もう一つ

    View full-size slide

  34. lதԝϦϙδτϦΛ͋ͯʹ͠ͳ͍z

    View full-size slide

  35. $PNQPTFS։ൃ౰࣌ͷࠞಱ
    w 1&"3͸͕͋ͬͨɺ໺ྑύοέʔδͩΒ͚
    w ಠࣗ1&"3ϦϙδτϦఏڙ೿
    w [JQஔ͍ͯΔ͚ͩ೿
    w HJUIVC೿

    View full-size slide

  36. ʮશϥΠϒϥϦ࢖͑ΔΑ͏ʹ͠ͳ͍ͱ໾
    ʹཱͨͳ͍ʂʯ

    View full-size slide

  37. ґଘؔ܎ղܾ͸ΫϥΠΞϯταΠυͰ
    શ෦ߦ͏
    packagist.org
    github.com
    bitbucket.org
    どこかのftp
    サーバー
    いい感じの
    ライブラリリスト

    View full-size slide

  38. 1BDLBHJTU͸ґଘؔ܎ղܾΛશ͘͠ͳ͍
    w KTPO͕ஔ͍ͯ͋Δ͚ͩ
    w શ෦μ΢ϯϩʔυͯ͠
    DPNQPTFS͕ղܾ͢Δ
    w ύοέʔδݕࡧ͢Βੲ͸
    ͳ͔ͬͨ

    View full-size slide

  39. ࠓࢥ͑͹͜ͷબ୒͕ɺύϑΥʔϚϯε

    ໰୊ΛҾ͖ى͖͔͚ͬͩͬͨ͜͢ͷͰ͢

    View full-size slide

  40. ୈҰ෦ͷ·ͱΊ
    w $PNQPTFS͸ύοέʔδͱ͍͏౷Ұ֓೦Λ1)1քʹ࣋ͪࠐΜͩ
    w Ғۀʂʂ
    w ࡞Δਓͱ࢖͏ਓͷนΛͿͬյͨ͠
    w ౰࣌ͷঢ়گ͔Βɺ෼ࢄϦϙδτϦΛલఏͱͨ͠࡞Γʹͳͬͨ

    View full-size slide

  41. $PNQPTFS͕஗͍ཧ༝
    PHPカンファレンス関西2016 基調講演
    第二部

    View full-size slide

  42. $ composer create-project laravel/laravel test --profile
    ...
    $PNQPTFSͰ-BSBWFMΛ৽نΠϯετʔϧ

    View full-size slide

  43. $ composer create-project laravel/laravel test --profile
    ...
    [269.36s]
    $PNQPTFSͰ-BSBWFMΛ৽نΠϯετʔϧ

    View full-size slide

  44. (*'Ξχϝࡱͬͨ ഒ଎࠶ੜ

    View full-size slide

  45. ஍ཧతͳภΓ
    w JTTVFͰʮ஗͍ʯͱจ۟Λݴ͍ͬͯΔਓ͕ͨͪݶΒΕΔ
    w தࠃɺϕτφϜɺؖࠃɺ೔ຊɺ͋ͨΓ
    w Ϥʔϩούͱ๺ถ͸จ۟Λݴ͏ਓ͕গͳ͍
    w ஗͍ͬͯॻ͘ͱʮԶ͸஗͘ײ͡ͳ͍ʯͱ͍͏ΫιϦϓ͕

    ඈΜͰ͘Δʢ஌ΒΜ͕ͳʣ

    View full-size slide

  46. ͳͥɺΞδΞͰ஗͍ͷ͔

    View full-size slide

  47. DPNQPTFS͕΍ͬͯΔ͜ͱུ֓
    QBDLBHJTUPSH͔Βύοέʔδ৘ใΛऔͬͯ͘Δ
    ґଘؔ܎Λղܾ͠ɺඞཁͳύοέʔδΛ֬ఆͤ͞Δ
    ओʹ
    HJUIVCDPN͔ΒύοέʔδຊମΛऔͬͯ͘Δ
    ద੾ʹ഑ஔΛߦ͍ɺBVUPMPBEQIQΛ࡞੒͢Δ

    View full-size slide

  48. HJUIVCDPN
    QBDLBHJTUPSH

    View full-size slide

  49. ωοτϫʔΫ଎౓ͷͭͷࢦඪ
    w εϧʔϓοτʢଠ͞ʣ
    w ୯Ґ࣌ؒ͋ͨΓૹ৴Ͱ͖Δσʔλྔ
    w ճઢΛଋͶΕ͹্ݶͳ͘ଠ͘Ͱ͖Δ
    w ϨΠςϯγʢ஗Ԇʣ
    w ߦͬͯؼͬͯ͘Δ·Ͱͷ࣌ؒ
    w ޫͷ଎౓ʹ੍໿͞ΕΔʢޫϑΝΠόʔͷதΛ఻ΘΔ଎౓ʣ
    復習しましょう

    View full-size slide

  50. ڑ཭ʹൺྫͯ͠஗͍
    ϨΠςϯγʹහײͳ࡞ΓΛ͍ͯ͠Δ͔Β

    View full-size slide

  51. ޫͷ଎౓ͷݶք
    w ਅۭதͷޫͷ଎౓͕໿ສLNT
    w ޫϑΝΠόʔதͷޫͷ଎౓͕ສLNT
    w ૹ৴͢ΔσʔλྔʹؔΘΒͣɺඞͣ͜ͷ఻೻࣌ؒ͸͔͔Δ

    View full-size slide

  52. HJUIVCDPN͔Βͷ

    [JQμ΢ϯϩʔυͷ৔߹

    View full-size slide

  53. ύέοτͷҠಈڑ཭
    w θϩ͔Β)5514௨৴͢Δͱɺύέοτͷԟ෮͕ճൃੜ͢Δ
    w 5$1ͷϋϯυγΣΠΫͰԟ෮
    w 5-4ͷϋϯυγΣΠΫͰԟ෮
    w )551ຊମͰԟ෮
    w ̍ճϦμΠϨΫτ͢Δͱߋʹഒ શ෦Ͱԟ෮

    w BQJHJUIVCDPN͔ΒDPEFMPBEHJUIVCDPNʹϦμΠϨΫτͯ͠Δ

    View full-size slide

  54. ໿8000km
    Λ8ԟ෮

    View full-size slide

  55. ஍ٿ3.2प෼ 128,000km

    =஍ٿ3.2प෼
    https://flic.kr/p/7icRw2

    View full-size slide

  56. composer͸͜ΕΛ

    શzipʹରͯ͠ߦ͍ͬͯΔ

    View full-size slide

  57. ͦΕͧΕ͕
    ஍ٿ3.2प෼

    View full-size slide

  58. update࣌͸͜Εʹ
    packagist.orgͱͷ௨৴΋௥Ճ

    View full-size slide

  59. ύοέʔδݸθϩ͔ΒΠϯετʔϧ࣌
    ͷڑ཭֓ࢉ
    w QBDLBHJTUPSHͷKTPOϑΝΠϧμ΢ϯϩʔυ
    w )5514 ԟ෮

    w )551 ԟ෮


    w ยಓສLN ϑϥϯεͩͱͯ͠

    w HJUIVCDPNͷ[JQμ΢ϯϩʔυ
    w )5514ϦμΠϨΫτ ԟ෮

    w ยಓઍLN αϯϑϥϯγείͩͱͯ͠

    View full-size slide

  60. ύοέʔδݸθϩ͔ΒΠϯετʔϧ࣌
    ͷڑ཭֓ࢉ
    LN✕


    LN✕ ✕

    ສLN
    ஍ٿप
    Ψϥεதͷޫ଎׵ࢉͰඵ
    w தܧػثͳͲଞʹ΋஗ԆཁҼ͸͋ΔͷͰɺࡶʹഒ͙Β͍͔͔Δͱ͢ΔͱͦΕ
    ͚ͩͰ෼ඵͱ͔ʹͳΔ
    w ͔͠΋଴͍ͬͯΔؒɺDPNQPTFS͸Կ΋͠ͳ͍ʢγϯάϧεϨουʣ

    View full-size slide

  61. ஍ٿ3.2प෼ ύοέʔδ50ݸͰ
    ஍ٿ220प෼
    https://flic.kr/p/7icRw2

    View full-size slide

  62. ͦΕͰ΋ɺޫ͕΋ͬͱ଎͔ͬͨΒɺ
    Composer͸஗͘ͳΒͳ͔ͬͨ

    View full-size slide

  63. ޫ͕஗͍͔ΒComposer͕஗͍ͷͩ

    View full-size slide

  64. ʜͱ͍͏ͷ͸൒෼ωλͳΜ͚ͩͲɺ
    ϨΠςϯγͷӨڹ͸࣮ࡍେ͖͍

    View full-size slide

  65. $PNQPTFSͷ࣮૷ͷ໰୊
    w pMF@HFU@DPOUFOUTIUUQTετϦʔϜϥούʔͷར༻
    w )551࣌୅ͷ࣮૷
    w ίωΫγϣϯΛຖճ࡞Γͳ͓͢ΊͬͪΌඇޮ཰
    w )551ͷޮ཰Խख๏Λશ͘࢖͍ͬͯͳ͍

    View full-size slide

  66. தԝϦϙδτϦΛ͋ͯʹ͠ͳ͍
    w QBDLBHJTUPSH͸ґଘؔ܎ղܾΛ͠ͳ͍
    w ֤஍͔ΒϦϙδτϦ৘ใΛ͔͖ूΊͯ͘Δ
    w QBDLBHJTUଆͰ͋Δఔ౓ґଘؔ܎Λղܾ͠ɺ·ͱΊͯૹͬͯ͘
    ΕΕ͹΋͏গ͠ϚγʹͳΔͷ͕ͩɻɻ

    View full-size slide

  67. ୈೋ෦ͷ·ͱΊ
    w $PNQPTFSͷ஗͞͸௨৴ͷϨΠςϯγʹහײͳ࡞Γ͔ͩΒ
    w ΞδΞ͸஍ཧతʹෆརͰ͋Γɺಛʹ஗͍
    w ஍ٿप΋ͯͯ͠෼ఔ౓͔͔͔͠Βͳ͍ͬͯɺ

    ٯʹ͍͢͝ΑͶ

    View full-size slide

  68. ʰͳͥ୭΋௚͞ͳ͍ͷʁʱ
    • ϝΠϯ։ൃऀ͸ϕϧΪʔͷਓ
    • ஗͞Λ࣮ײͰ͖ͳ͍͠ɺ஫ྗ͞Εͯͳ͍
    • ௚ͦ͏ͱͨ͠ਓ͸΋ͪΖΜࠓ·Ͱ΋͍͚ͨͲɺͳ࣮ͥݱ͠ͳ͔ͬ
    ͨͷ͔ɺ͜Ε͔Βઆ໌͠·͢

    View full-size slide

  69. $PNQPTFSΛ଎͘͢Δ
    PHPカンファレンス関西2016 基調講演
    第三部

    View full-size slide

  70. ωοτϫʔΫ଎౓ͷͭͷࢦඪ
    w εϧʔϓοτʢଠ͞ʣ
    w ୯Ґ࣌ؒ͋ͨΓૹ৴Ͱ͖Δσʔλྔ
    w ճઢΛଋͶΕ͹্ݶͳ͘ଠ͘Ͱ͖Δ
    w ϨΠςϯγʢ஗Ԇʣ
    w ߦͬͯؼͬͯ͘Δ·Ͱͷ࣌ؒ
    w ޫͷ଎౓ʹ੍໿͞ΕΔʢޫϑΝΠόʔͷதΛ఻ΘΔ଎౓ʣ
    復習しましょう

    View full-size slide

  71. ϨΠςϯγ͸Լ͛ΒΕͳ͍ ΋͏े෼଎͍

    w ύέοτͷҠಈڑ཭Λ୹͘͠ɺӨڹΛආ͚Δ͔͠ͳ͍
    w ͨͱ͑͹ɺແବͳԟ෮ΛݮΒ͢
    w εϧʔϓοτʹ͸༨༟͕͋Δ͜ͱ͕ଟ͍
    w Ұؾʹ·ͱΊͯૹΔ΂͖

    View full-size slide

  72. DPNQPTFSΛ଎͘͢ΔͨΊʹ
    w QBDLBHJTUPSH΍HJUIVCDPNΛۙ͘ʹ࣋ͬͯ͘Δ
    w ແବͳύέοτԟ෮ΛݮΒ͢
    w ଴ͪ࣌ؒΛ༗ޮ׆༻͢Δ ฒྻμ΢ϯϩʔυ

    w ޫΛ଎͘͢ΔˡແཧΆ

    View full-size slide

  73. DPNQPTFSΛ଎͘͢ΔͨΊʹ
    w QBDLBHJTUPSH΍HJUIVCDPNΛۙ͘ʹ࣋ͬͯ͘Δ
    w ແବͳύέοτԟ෮ΛݮΒ͢
    w ଴ͪ࣌ؒΛ༗ޮ׆༻͢Δ ฒྻμ΢ϯϩʔυ

    w ޫΛ଎͘͢ΔˡແཧΆ

    View full-size slide

  74. QBDLBHJTUPSHͷϛϥʔΛ࡞ͬͨ
    ೥຤͝Ζd

    w QBDLBHJTUͷશσʔλΛ෼͝ͱʹίϐʔ
    w ϥΠηϯε໰୊Λආ͚ΔͨΊʹ5SBO1SPYZ͸࢖͍ͬͯͳ͍
    w DPOUBDU!QBDLBHJTUPSHʹϝʔϧͯ͠ڐ୚औͬͨ
    w ͘͞Β714$MPVE'MBSFͰ഑৴
    w ͨͿΜࠓͷ਺ेഒΞΫηε͕དྷͯ΋ฏؾ

    View full-size slide

  75. $ composer config -g repos.packagist
    composer https://packagist.jp
    ϛϥʔͷ༗ޮԽઃఆ͸ίϚϯυҰߦ

    View full-size slide

  76. QBDLBHJTUKQͰ଎͘ͳΔ෦෼
    QBDLBHJTUPSH͔Βύοέʔδ৘ใΛऔͬͯ͘Δ
    ґଘؔ܎Λղܾ͠ɺඞཁͳύοέʔδΛ֬ఆͤ͞Δ
    ओʹ
    HJUIVCDPN͔ΒύοέʔδຊମΛऔͬͯ͘Δ
    ద੾ʹ഑ஔΛߦ͍ɺBVUPMPBEQIQΛ࡞੒͢Δ
    w QBDLBHJTUPSHͱͷ௨৴͕ڑ཭ʹͳͬͨͱ͢Δͱ

    ύοέʔδݸͰ஍ٿप෼஍ٿप·ͰݮΔ

    View full-size slide

  77. ஍ٿ3.2प෼
    ஍ٿ220प

    ˣ

    ஍ٿ160प
    https://flic.kr/p/7icRw2

    View full-size slide

  78. ͪͳΈʹpackagist͸ߋ৽ස౓͕ߴ͗ͯ͢ɺ
    ϓϩΩγํࣜͷΩϟογϡ͸ඍົ
    ϛϥʔํ͕ࣜϕλʔ

    View full-size slide

  79. HJUIVCͷϛϥʔ͸೉͍͠
    w ·ͣαΠζ͕େ͖͍
    w QBDLBHJTUPSHͷ+40/ͷதʹ63-͕ϋʔυίʔυ
    w ϛϥʔ͢Δ͚ͩ͡Όͳͯ͘ॻ͖׵͑ͳ͚Ε͹ͳΒͳ͍
    w ෼Ͱಉظ͕ऴΘΒͳ͘ͳΔ
    w ϒϥϯνQVTI͞ΕΔ౓ʹ[JQϑΝΠϧ͕࡞ΒΕΔ
    w ׂʹ͋Θͳ͍

    View full-size slide

  80. DPNQPTFSΛ଎͘͢ΔͨΊʹ
    w QBDLBHJTUPSH΍HJUIVCDPNΛۙ͘ʹ࣋ͬͯ͘Δ
    w ແବͳύέοτԟ෮ΛݮΒ͢
    w ଴ͪ࣌ؒΛ༗ޮ׆༻͢Δ ฒྻμ΢ϯϩʔυ

    w ޫΛ଎͘͢ΔˡແཧΆ
    packagist.jpで一部対応

    View full-size slide

  81. DPNQPTFSΛ଎͘͢ΔͨΊʹ
    w QBDLBHJTUPSH΍HJUIVCDPNΛۙ͘ʹ࣋ͬͯ͘Δ
    w ແବͳύέοτԟ෮ΛݮΒ͢
    w ଴ͪ࣌ؒΛ༗ޮ׆༻͢Δ ฒྻμ΢ϯϩʔυ

    w ޫΛ଎͘͢ΔˡແཧΆ
    packagist.jpで一部対応

    View full-size slide

  82. ࢖͓͏ʂ,FFQ"MJWF
    w )551ͷίωΫγϣϯΛ࢖͍·Θ͢
    w 5$1ͱ5-4ͷϋϯυγΣΠΫΛΧοτԟ෮෼અ໿Ͱ͖Δ
    w ϦμΠϨΫτΛফͤ͹ߋʹԟ෮અ໿Ͱ͖Δ
    w ϛϥʔΛ࢖͍ͬͯͨΒ஍ٿपप

    View full-size slide

  83. ஍ٿ3.2प෼
    ஍ٿ220प

    ஍ٿ160प
    ↓

    ஍ٿ21प
    https://flic.kr/p/7icRw2

    View full-size slide

  84. DPNQPTFSΛ଎͘͢ΔͨΊʹ
    w QBDLBHJTUPSH΍HJUIVCDPNΛۙ͘ʹ࣋ͬͯ͘Δ
    w ແବͳύέοτԟ෮ΛݮΒ͢
    w ଴ͪ࣌ؒΛ༗ޮ׆༻͢Δ ฒྻμ΢ϯϩʔυ

    w ޫΛ଎͘͢ΔˡແཧΆ
    packagist.jpで一部対応

    View full-size slide

  85. ฒྻԽͷޮՌ
    w ҰؾʹૹͬͯҰؾʹฦͯ͠΋Β͑͹ɺҠಈ࣌ؒΛ࡟ݮͰ͖Δ
    w ฒྻͳΒ෼ͷʹͳΔͷͰ
    w ஍ٿप஍ٿप ࣮࣭

    View full-size slide

  86. ஍ٿ3.2प෼
    ஍ٿ220प

    ஍ٿ160प
    ↓

    ஍ٿ21प

    ࣮࣭஍ٿ2प
    https://flic.kr/p/7icRw2

    View full-size slide

  87. ͜͜·Ͱ΍Ε͹଎͘ͳΔ͸ͣ

    View full-size slide

  88. Keep-Alive, ฒྻԽ…
    ͦ͏ɺਖ਼ղ͸ݟ͑ͯΔΜͰ͢Α

    View full-size slide

  89. ʰComposerຊମΛ௚ͤ͹͍͍͡ΌΜʱ

    View full-size slide

  90. ಴࠳ͨ͠1VMM3FRVFTU*TTVFͷࢁ

    View full-size slide

  91. DPNQPTFSຊମվળͷน
    w ௨৴पΓͷṖػೳ͕ଟ্͍ɺ෼ׂ͞Ε͍ͯͳͯ͘࠶࣮૷͢Δ͠
    ͔ͳ͍
    w QSPYZ HJUIVC HJUMBCͷೝূରԠ
    w μ΢ϯϩʔυਐḿͷදࣔ
    w Ϣʔβʔ໊ύεϫʔυΛೖྗͤͯ͞ϦτϥΠ
    w EFHSBEFE.PEF *1Wڧ੍ʁ

    w ͜ΕͰޓ׵ੑอͭͷ͸͔֬ʹ໘౗͍͘͞

    View full-size slide

  92. ͱࢥͬͯͨΒ͜Μͳ࿩͕

    View full-size slide

  93. composerϓϥάΠϯͰ

    curlԽͰ͖ΔΒ͍͠…

    View full-size slide

  94. ϓϥάΠϯͳΒຊମʹ

    Ϛʔδ͞Εͳͯ͘΋

    ࢼͯ͠΋Β͑Δ

    ࣮੷΋ੵΊΔ

    View full-size slide

  95. (ͱ͍͏Θ͚Ͱ࡞ͬͨ)

    View full-size slide

  96. IJSBLQSFTUJTTJNP

    View full-size slide

  97. QSFTUJTTJNP ೥݄

    w DPNQPTFSϓϥάΠϯ
    w D63-Ͱμ΢ϯϩʔυ͢ΔΑ͏ʹஔ͖׵͑Δ
    w ,FFQ"MJWFΛ༗ޮԽ͢Δ
    w DPEFMPBEHJUIVCDPNΛ͍͖ͳΓऔΓʹߦ͘

    ϦμΠϨΫτ࡟ݮ

    w Ұ෦DVSM@NVMUJͰฒྻμ΢ϯϩʔυ͢Δ

    View full-size slide

  98. $ composer global require 'hirak/prestissimo'
    あとは勝手にinstall/update時に発動して速くなる
    Πϯετʔϧ͸ίϚϯυҰߦ

    View full-size slide

  99. ͪͳΈʹฒྻԽΑΓ΋,FFQ"MJWFͷํ͕
    ޮՌେ͖͍
    l1BSBMMFM*OTUBMMzͱ͔ॻ͍ͨͷ͸

    όζΒͤΔͨΊͷ௼Γ

    View full-size slide

  100. (*'Ξχϝࡱͬͨ ഒ଎࠶ੜ

    View full-size slide

  101. ޙ೔ஊ
    (2016೥1݄26೔)

    View full-size slide

  102. ͳΜ͔GitHubελʔ਺͕500
    ௒͑ͦ͏ͳΜ͚ͩͲ…

    View full-size slide

  103. ϓϥάΠϯͳΒຊମʹ

    Ϛʔδ͞Εͳͯ͘΋

    ࢼͯ͠΋Β͑Δ

    ࣮੷͸ੵΊͨ

    View full-size slide

  104. $PNQPTFSຊମ΁΋ɺ1VMM3FRVFTUத
    w ͳ͔ͳ͔Ϛʔδ͞Εͳ͍ͷͰɺ͍͍ͶԼ͍͞ʂʂ
    w IUUQTHJUIVCDPNDPNQPTFSDPNQPTFSQVMM

    View full-size slide

  105. DPNQPTFSΛ଎͘͢ΔͨΊʹ
    w QBDLBHJTUPSH΍HJUIVCDPNΛۙ͘ʹ࣋ͬͯ͘Δ
    w ແବͳύέοτԟ෮ΛݮΒ͢
    w ଴ͪ࣌ؒΛ༗ޮ׆༻͢Δ ฒྻμ΢ϯϩʔυ

    w ޫΛ଎͘͢ΔˡແཧΆ
    packagist.jpで一部対応
    prestissimoで解決

    View full-size slide

  106. ୈࡾ෦ͷ·ͱΊ
    w ޫ͸଎͘Ͱ͖ͳ͍͚Ͳɺ
    w ϛϥʔΛ࡞ͬͨΓ
    w ,FFQ"MJWFͰແବͳԟ෮ΛݮΒͨ͠Γ
    w ฒྻԽͯ͠Ͳ͔ͬͱૹΔΑ͏ʹ͢Ε͹
    w ஍ٿपͯͨ͠ͷ͕प෼ͷ࣌ؒͰΑ͘ͳͬͯ଎͘ͳΔΑ

    View full-size slide

  107. ຊ౰ʹඞཁͩͬͨ΋ͷ
    PHPカンファレンス関西2016 基調講演
    最終部

    View full-size slide

  108. ೔ຊҰͷ1)1FSʂͱ͔
    ஍ٿपΛप·Ͱઅ໿ʂͱ͔
    ތେͳ͜ͱΛ࿩͖͚ͯͨ͠Ͳ

    View full-size slide

  109. ࣮͸ͦΜͳʹ೉͍͜͠ͱ͸
    ͍ͯ͠ͳ͍

    View full-size slide

  110. ٕज़తʹࠔ೉ͩͬͨʁ
    w DVSM@NVMUJ͸1)1ʹੲ͔Β͋Δ͠
    w Կ͔࠶࣮૷ͨ͠Θ͚Ͱ΋ͳ͍
    w ,FFQ"MJWFͳΜͯԿ೥લͩΑʂʂ࣌୅͸)551ͩΖʂʂ
    w લ͔Β͋ͬͨ࠷దԽػೳΛ$PNQPTFSʹద༻͚ͨͩ͠

    View full-size slide

  111. ਖ਼͍͠΍Γํ͔ͩͬͨʁ
    w ϨΠςϯγ͕໰୊ͩͱࢥͬͨͷ͸צʢଌఆͯ͠ͳ͍ʣ
    w ςετۦಈͯ͠ͳ͍͠ճ΋θϩ͔Βॻ͖௚ͯ͠Δ
    w ϓϥάΠϯܗࣜͰͷ࣮૷͸ɺॏʹμ΢ϯϩʔυॲཧΛ

    ىಈ͍ͯͯ͠ແବ͕ଟ͍

    View full-size slide

  112. ͔͔࣌ؒΓ͗͢Ͱ͋Δ
    w ஗͍ͳʔͬͯݴ͍࢝Ί͔ͯΒ

    ೥ܦͬͯΔ
    w ೥݄͝Ζˠ

    View full-size slide

  113. ͖ͬͱɺ࣮૷Ͱ͖ͨਓ͸ଞʹ΋͍ͨ͸ͣ

    View full-size slide

  114. Ͱ΋ɺ୭΋΍Βͳ͔ͬͨ

    View full-size slide

  115. QSFTUJTTJNPͷ೉͔ͬͨ͠ͱ͜Ζ
    w $PNQPTFSͷࣄ৘ʹ߹ΘͤΔ
    w ϢʔβʔͷͳΔ΂͘ଟ͘ΛٹΘͳ͚Ε͹ͳΒͳ͍
    w 1)1͸ରԠ
    w 8JOEPXTϢʔβʔ΋ݟࣺͯͳ͍
    w ೝূ΍5SBO1SPYZͷαϙʔτ
    w ઌਐత͗͢ΔϥΠϒϥϦ΋࢖͑ͳ͍

    View full-size slide

  116. D63-Λ࢖͏ͷ΋ָ͡Όͳ͍Α
    w D63-͸େ఍ͷ؀ڥͰ࢖͑Δ͕ʜ
    w MJCDVSMͷόʔδϣϯҧ͍
    w 1)1ࣗମͷόʔδϣϯҧ͍
    w ૊Έ߹Θ͍ͤͯΔ҉߸ԽϥΠϒϥϦͷछྨ
    w /44 4FDVSF5SBOTQPSU 0QFO44-FUD
    w ৽͠Ίͷػೳ͸࢖͑Δͱ͸ݶΒͳ͍

    View full-size slide

  117. QSFTUJTTJNPͷࢥ૝
    w શػೳΛ࠶࣮૷͢Δͷ͸ແཧ
    w ಈ͔ͳ͔ͬͨΒݩͷ࣮૷Λ࢖͑͹͍͍
    w ͙Β͍ͷਓ͕଎͘ͳΕ͹े෼
    w ͦͷ୅ΘΓ࣮֬ʹΠϯετʔϧՄೳʹ͢Δ໰୊Λى͜͞ͳ͍

    View full-size slide

  118. ͜ͷམͱ͠ॴΛ୳Δͷʹ೥͔͔ͬͨ

    View full-size slide

  119. ೉͍͜͠ͱΛ͍ͯ͠ͳ͍͚Ͳ
    • ΋ͬͱ΋ޮՌͷ͋Δํ๏Λߟ͑Δ
    • μϝͩͬͨΒଞͷํ๏Λࢼ͠ଓ͚Δ
    • ͖͋ΒΊͳ͍
    =>
    ٕज़ͱ͸ͪΐͬͱҧ͏

    View full-size slide

  120. ͪΐͬͱ୤ઢ͠·͢

    View full-size slide

  121. 1)1ͬͯͲ͏͍͏ݴޠͰ͚ͨͬ͠ʁ

    View full-size slide

  122. #include
    int main(void)
    {
    printf("Hello, world!");
    return 0;
    }
    $ͷ)FMMP8PSME

    View full-size slide

  123. package main
    import "fmt"
    func main() {
    fmt.Print("Hello, World!\n")
    }
    (Pͷ)FMMP8PSME

    View full-size slide

  124. print "Hello, world!";
    1FSMͷ)FMMP8PSME

    View full-size slide

  125. Hello, world!
    1)1ͷ)FMMP8PSME
    ?!

    View full-size slide

  126. $ echo Hello, world! > hello.php
    $ php hello.php
    Hello, world!
    1)1͸)FMMPXPSMEΛੈքҰ؆୯ʹॻ͚Δ

    View full-size slide

  127. $ echo Hello, world! > hello.php
    $ php -S 0.0.0.0:3000
    (ブラウザで
    http://localhost:3000/hello.php
    が読める)
    ͦͷ··8FCΞϓϦʹͳΔ

    View full-size slide

  128. ҟৗͳݴޠ
    w )FMMPXPSME͔Β൒ܘNҎ಺͚ͩҟৗʹ؆୯
    w ಛԽ͗͢͠͡ΌͶʁ
    w ;ͭ͏൚༻ੑΛߟ͑ͯͦΜͳͱ͜Ζʹ஫ྗ͠ͳ͍

    View full-size slide

  129. ؆୯ͳ8FCΞϓϦΛɺ
    ຊ౰ʹ
    ؆୯ʹ࡞ΕΔ

    View full-size slide

  130. ࢲ͸ͨͩ໰୊Λղܾ͍͚ͨͩ͠ͳΜͰ͢ɻ໰୊Λղܾͯ͠ɼ
    ͦͷ݁ՌͲ͏ͳ͔ͬͨɼࣗ෼͕࡞ͬͨ΋ͷͰਓʑͷੜ׆͕
    Ͳ͏มΘ͔ͬͨΛݟಧ͚Δ͜ͱɼͦΕ͕໨తͳΜͰ͢ɻ
    3BTNVT-FSEPSG

    IUUQHJIZPKQOFXTSFQPSU
    QBHF

    View full-size slide

  131. ҒେͳϓϩάϥϚ͸
    ͍͍ͩͨࣅͨΑ͏ͳ͜ͱΛ

    Ұ౓͸ൃݴ͍ͯ͠Δ

    View full-size slide

  132. ্͔࢘ΒΫϏʹ͞Εͳ͍͏ͪʹ࢓ࣄΛย෇͚
    ΒΕΕ͹ɺͦΕ͸ʮਖ਼͍͠ʯ1FSMεΫϦϓτ
    -BSSZ8BMM

    1SPHSBNNJOH1FSM

    View full-size slide

  133. ࢲ͸໰୊Λղͨ͘Ίʹ$Λઃܭͨ͠ͷͰ͋
    ΓɺԿ͔Λ࣮ূ͢ΔͨΊʹ࡞ͬͨͷͰ͸ͳ͍
    #KBSOF4USPVTUSVQ
    5IF%FTJHOBOE&WPMVUJPOPG$

    View full-size slide

  134. "໰୊Λղܾ͔ͨͬͨ͠"

    View full-size slide

  135. Ҋ֎ɺͦ͏͍͏΋ͷ΋ଟ͍ͷͰ͸
    w 1)1͸8FCΞϓϦΛ؆୯ʹ࡞ΔͨΊʹੜ·Εͨ
    w $PNQPTFS͸౰࣌ͷ1)1ͰϥΠϒϥϦ؅ཧΛ͢ΔͨΊʹ

    ੜ·Εͨ
    w มͳͱ͜Ζ͍ͬͺ͍͋Δ͠ɺ%*4ΒΕΔ͚Ͳɺ

    ౰ॳͷ໰୊͸ղܾ͍ͯ͠Δ

    View full-size slide

  136. צҧ͍͍ͯͨ͠
    w ͣͬͱɺ༏Εͨιϑτ΢ΣΞ͸εʔύʔΤϯδχΞ͕࡞͍ͬͯ
    Δͷͩͱࢥ͍ͬͯͨ
    w ͋ΒΏΔ໰୊͸ɺ͍͔ͭώʔϩʔ͕΍͖ͬͯͯ

    ղܾ͞ΕΔͷͩͱࢥ͍ͬͯͨ
    w ˠ೥ܦͬͯ΋ղܾ͠ͳ͔ͬͨ

    View full-size slide

  137. ͨͿΜຊ౰͸
    w Կ͔໰୊͕͋ͬͯɺͭΒͯ͘ٽ͍͍ͯΔਓ͕͍ͯɺͦͷதʹ
    w ໰୊ʹཱͪ޲͔͏ਓ
    w ໰୊ʹཱͪ޲͔Θͳ͍ਓ
    ͕͍Δ͚ͩ

    View full-size slide

  138. ໰୊ʹ௚໘͍ͯ͠Δਓ͔͠ղܾͰ͖ͳ͍
    私は遅く感じない
    僕はPHPを書いてない
    キャッシュしてるから平気
    ࿩͕௨͡ͳ͍ʂʂ

    View full-size slide

  139. ຊ౰ʹඞཁͩͬͨͷ͸
    ໰୊ͱ޲͖߹͏͜ͱ

    View full-size slide

  140. ໰୊Λղ͘ਓʹେ͖ͳҧ͍͸ͳ͍
    w ͍·ࣗ෼͕Ͱ͖Δ͜ͱΛ΍Δ
    w ݁Ռੜ·Εͨ΋ͷ͕ෆ֨޷Ͱ΋ɺ

    ໰୊Λղ͔ͳ͍ΑΓ͸ΑͬΆͲྑ͍
    w Ή͠Ζɺ໰୊Λղ͍͍ͯΔ͔ΒҒେͳΤϯδχΞʹͳΕΔΜͩ
    ͱࢥ͏

    View full-size slide

  141. ໰୊ʹ޲͖߹͍ͬͯΕ͹
    w ͙͢ʹ͸ղܾͰ͖ͳ͍͔΋͠Εͳ͍͚Ͳ
    w ೥ܦͬͯղܾͷࢳޱ͕Έ͔ͭΔ͜ͱ΋͋Δ͠
    w தʹ͸ධՁͯ͘͠ΕΔਓ΋͍Δ͠
    w ೔ຊҰʹͳͬͨΓͱ͔
    w جௐߨԋΛཔ·ΕͨΓͱ͔
    w ͨ·ʹ͸͍͍͜ͱ͋ΔΑʂʂ

    View full-size slide

  142. ࡞Δਓͱ࢖͏ਓ
    ͦ͜ʹҧ͍ͳͲͳ͍ʂʂ

    View full-size slide

  143. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide