Pro Yearly is on sale from $80 to $50! »

Slim3とPSR-7(PHPカンファレンス福岡 2016)

Slim3とPSR-7(PHPカンファレンス福岡 2016)

Bba92f151c3cb9d1b5d07fe1b363e0fe?s=128

marusan

May 21, 2016
Tweet

Transcript

  1. Slim3&œ PSR)7 PHP¼âÒ´ßâÆ_- 2016 ÚÒãH2 ^ _-»Ò¶Æ / D Copyright

    (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
  2. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. (¨¯

    P:
  3. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 4hŠ›

    W:µÒà
  4. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ÁãÞ

  5. PHP4h† WebµÔݲ 5›zX›‡¯ Copyright (C) 2016 Yahoo Japan Corporation. All

    Rights Reserved. W:µÒà
  6. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ª­žŒœ

  7. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. PHP'The'Right'Way'Ÿ

    Bš€¯¬‚ž Œœ¡ª­ž¬ • PHPªComposer ·âÆÎãÞ • Composer ? • »ÓŹ¾Î= "]
  8. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. [M

    ! Slim'Framework ! PSR<7
  9. Slim'Framework Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  10. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Slimœ¡žŸæ

  11. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Shinatra§•ž

    ryÒßã×áã¾ (Micro'Framework) £œ™
  12. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. p†

    ˜•?
  13. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Josh'Lockhart(@codeguy)

    • PHP'The'Right'Way lh • Modern'PHP lh • PHP<FIG© W:github.com(@codeguy)
  14. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ž“

    ˜•æ
  15. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. SymfonyÕãÆ

    Silex¦„’ƒä ¼ËœŽš ˜• 37¡Žšž
  16. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. New!!

  17. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTPØËÇãÅ

    KRJ PSR<7'Ÿ ,6Ž•¬(3.0)
  18. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Slim

    Li
  19. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. •

    HTTP'Router • PSR<7(Request,'Response) • Middleware • DI'Container
  20. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Li¡Œ°–Š

    ¦›Œ°–Š
  21. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Ž…©

  22. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. •

    HTTP'Router • PSR<7 • Middleware • DI'Container Œ°›"E x¡ˆ
  23. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 4hŸœ˜š

    !Zž)gÀÆÎ ä
  24. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ·âÆÎãÞ

  25. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ”°›¡|¦‘

    Slim<Skelton…­·âÆÎãގ¦Ž«‚ $ composer create-project slim/slim-skeleton my-app
  26. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ÑÞηâWebÂãÐã›a—‹

    $ cd my-app $ php -S 0.0.0.0:8080 -t public public/index.php
  27. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  28. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. •ä

    E@ Xmd±®!!!! W:µÒà
  29. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. œ|‚±ŠŸ¡

    …ž ›
  30. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTP'Router

  31. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ¦‘|src/routes.phpŸ

    ~/fukuoka o*²uŽ¦ <?php $app->get('/fukuoka', function ($request, $response) { $response->getBody()->write('  '); return $response; });
  32. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ÑÞηâ(ry

    $ php -S 0.0.0.0:8080 -t public public/index.php
  33. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  34. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. •ä

    1Œ”d±®!!!! W:µÒà
  35. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ªªª

    PSR<7Œ˜•³…æ
  36. PSR<7 Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  37. ”©”©PSRœ¡æ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  38. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. PHP<FIG'œ‚¿ÞãԆ

    *fŽš¯KRJ –PSR<0:'»ãÎàãÊã (N) –PSR<1/2:'ÀãͶâ¿ÆÉ·Þ –PSR<3:'à¿ –PSR<4:'»ãÎàãÊã –PSR<6:'½ÙËÄÛ –PSR<7:'HTTPØËÇãÅ
  39. PSR ;GT Copyright (C) 2016 Yahoo Japan Corporation. All Rights

    Reserved.
  40. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. UOž1,2,4²{ˆœ

    ;GT¡·âÉãÒ¹·Æ –PSR<3:'PSR'Log • https://github.com/php<fig/log –PSR<6:'PSR'Cache • https://github.com/php<fig/cache –PSR<7:'PSR'Http'Message • https://github.com/php<fig/http<message
  41. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ·âÉãÒ¹·Æž

    ›| Œ°²VŽ•Ü·ÓÜ݆ Y$¯±Š› –PSR<3' monolog –PSR<6' stash –PSR<7' slim,'guzzle
  42. PSR<7œ¡ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  43. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTPØËÇãÅ

    ·âÉãÒ¹·Æe
  44. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. œ‚±Š›

    HTTPØËÇãŲ „­Ž¦Ž«‚
  45. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Http

    Client (WebÓܸÃ) Request Message - Header - Body Response Message - Header - Body Http Server ݾºÆÎØËÇ ãŲv¯œß ÆÖâÆØËÇã Ų©­ƒ¯ ݾºÆÎØËÇãÅ ²Š˜•­|” °Ÿ,6¯ßÆÖ âÆØËÇãŲt 
  46. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ݾºÆÎØËÇãÅ

    ²Š˜•­|” °Ÿ,6¯ßÆÖ âÆØËÇãŲt  Http Server
  47. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTPØËÇãś

    'žŒœå™
  48. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 

    ¬‚žÝ¾ºÆΆ‡š
  49. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 

    ¬‚žßÆÖâƲ t …
  50. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ßÆÖâÆBody(q)¡

    …
  51. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. PSR<7

    KRJ
  52. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 

    ¬‚žÝ¾ºÆΆ‡š  ServerRequestInterface ݾºÆÎ9#†˜š¯»ÓŹ¾Î (…®ªˆn‚œ$_SERVER­¥³¬)
  53. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 

    ¬‚žßÆÖâƲt …  ResponseInterface ßÆÖâÆ9#²°¯»ÓŹ¾Î (…®ªˆn‚œÆÌãÉÆÀãϜ…bodyœ…)
  54. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ßÆÖâÆBody¡

    …  StreamInterface  w®StreamŸž˜š„® writeØÈËϛuB‡s§Ÿž¯
  55. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Œ

    噡ÌÆΟ¯ ServerRequestInterface ResponseInterface StreamInterface
  56. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ”ŽšŒ°¡&Ÿ¯(8&)

    ServerRequestInterfaceœ ResponseInterface¡ %»ÓŹ¾Î
  57. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Slim›‚ƒ¢

    æ
  58. +¡Œ³ž…³Ÿž˜š¦Ž• <?php $app->get('/fukuoka', function ($request, $response) { $response->getBody()->write('  ');

    return $response; }); +¡ServerRequestInterface +¡ResponseInterface +¡StreamInterface C3ŸResponseInterface²t Œœ–Š¡5°‘Ÿ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
  59. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ResponseInterface

    %»ÓŹ¾ÎŸ P:äää
  60. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. //

      $app->get('/', function($request, $response) { // StatusCode $response->withStatus(404); //  JSON $response->withHeader( 'Content-Type', 'application/json;charset=utf-8' ); return $response; });
  61. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. //

     $app->get('/', function($request, $response) { // StatusCode $response = $response->withStatus(404); //  JSON $response = $response->withHeader( 'Content-Type', 'application/json;charset=utf-8' ); return $response; });
  62. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. %»ÓŹ¾Îž

    › withcØÈËϤœ >Žˆ»ÓŹ¾Î† ­°¦} Œ°²‡—³œŠ®¦Ž«‚}
  63. ¦œ¨ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.

  64. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 1.

    Slim'+'ÑÞηâWebÂãÐ㛐 ‰ŸzX›‡¯ 2. ÌÆΟ¯ ¡ ServerRequestInterface ResponseInterface StreamInterface 3. &Ÿ¯ ¡ ResponseInterface %»ÓŹ¾Î
  65. Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. „\­’

    ~¦¦›S…˜• …¬äœ¬ˆn±°¦† ÚÒã _- I<(Q.b)Ÿ zXx†A3@(5/23)F¦ä ¦–k01(` §)ž › jˆŽš} / D