Save 37% off PRO during our Black Friday Sale! »

PHPでダイエット / Dietcube #phpblt

PHPでダイエット / Dietcube #phpblt

PHP de Diet / Released Dietcube 1.0.0
https://packagist.org/packages/dietcube/dietcube

4564d3601f6230782300dff8499b2d5a?s=128

Sotaro Karasawa

January 13, 2016
Tweet

Transcript

  1. PHP ͰμΠΤοτ @sotarok Marcari, Inc.

  2. ࣗݾ঺հ @sotarok "ͦ͏ͨΖ͏͚ʔ" ◀࠷ۙ͋·ΓΞϐʔϧͯ͠ͳ͍ ͦ͏ͨΖ͏Ͱ͍͍Α ࠷ۙ͸Ϩʔαʔࢤ๬Ͱ͢

  3. ͤΜͰΜ ങ͍·͠ΐ͏ ग़൛ه೦Πϕϯτggrks

  4. ͤΜͰΜ Ԡื͠·͠ΐ͏ http://bit.ly/mercariphp

  5. Έͳ͞Μ

  6. μΠΤοτͯ͠·͔͢ʔʁ

  7. PHP ͰμΠΤοτͱ͍͑͹

  8. dietcake!!!

  9. Ͱ͢ΑͶ!?

  10. CakePHP ͩͱ ͍Ζ͍ΖΑ͚͍ͳ΋ͷ͕͍ͭͯΔ͔Β μΠΤοτͤͨ͞΍ͭ

  11. ⭕ ͸΍͍ ⭕ ͏͍͢ ⭕ Θ͔Γ΍͍͢

  12. K̋ab ͞Μͱ͔ M̋rcari ͱ͔

  13. ݁ߏ͍Ζ͍Ζ͋Γ·͢

  14. "ࣗࣾϑϨʔϜϫʔΫ"

  15. * ֶशίετ * Ξοϓσʔτίετ * ࣗࣾͷཁ݅΁ͷϚον

  16. → ͲΜͲΜ΍Ε

  17. ͍͖͞ΜͷPHPք۾

  18. PSR-7 ͩͱ͔ Symfony Components ͩͱ͔ Zend Framework ͩͱ͔ Aura ͩͱ͔

  19. ͍͍͔Μ͡ʹͳ͖ͬͯͯΔ (ࡶ

  20. brtRiver͞Μͷ΍ͭ ݁ߏࢀߟʹͳΓ·͢Α ʮPHP7 Ͱ PSR-7 ͱ Middleware Λ࢖͏ϚΠΫϩϑϨʔϜ ϫʔΫΛॻ͍ͯΈͨʯ http://d.hatena.ne.jp/brtRiver/20160103/microframework_psr7_php7

  21. Ͱ΍ͬͺSymfony͸͍͢͝ͳͬͯ

  22. ͋Εͷ͍͢͝ ͓ͦ͗ͱ͔ͨ͠Μ͡ͷ΍͕ͭ΄͍͠ ͬͯͷΛݩʹ

  23. ͓Εͷ͔Μ͕͑Δ͍͖͞ΐ͏ͷ ͓Ε͓Ε ϑϨʔϜϫʔΫʹ͍ͭͯߟ͑ͯΈΔ

  24. ⭕ ͏͍͢ ⭕ ͸΍͍ ⭕ Θ͔Γ΍͍͢

  25. Ͱ΋ϧʔςΟϯά͸ ... .htaccess ͡Όͳ͍Αͳ ※ DietCake ͸ mod_rewrite Ͱ routing

  26. Ͱ΋ϧʔςΟϯά͸ ... .htaccess ͡Όͳ͍Αͳ ※ DietCake ͸ mod_rewrite Ͱ routing

    → FastRoute ͕͋Δ͡Όͳ͍͔
  27. View ΋͕͢͞ʹ PHP View ͸ɻɻ ※ ϝϧΧϦࣾ಺Ͱ͸Twig΋ซ༻

  28. View ΋͕͢͞ʹ PHP View ͸ɻɻ ※ ϝϧΧϦࣾ಺Ͱ͸Twig΋ซ༻ → ͏Μ Twig

    ͕͋Δ͡Όͳ͍͔
  29. Logger ΋Ͳ͏ͤ Monolog ͔ͭ͏Ͱ ͠ΐ? ※ ϝϧΧϦࣾ಺Ͱ΋ Monolog ͭͯ͜Δ

  30. Logger ΋Ͳ͏ͤ Monolog ͔ͭ͏Ͱ ͠ΐ? ※ ϝϧΧϦࣾ಺Ͱ΋ Monolog ͭͯ͜Δ →

    Monolog ͕͋Δ͡Όͳ͍͔ɺ͋ͱ PSR ΋
  31. ͏͍ͬ͢ DI ΋΄͍͠ ※ ͏Μɺ΄͍͠

  32. ͏͍ͬ͢ DI ΋΄͍͠ ※ ͏Μɺ΄͍͠ → Pimple ͘Β͍ͷ͏͍͢΍ͭ

  33. EventDispatcher ΋ ͋Δͱ͚ͬ͜͏͏Ε͍͠ ※ ·࣮͋ࡍʹ͸͋Δͱ͏Ε͍͠ →·͋ͦΕͰ͍͏ͱ΍ͬͺSymfony ?

  34. EventDispatcher ΋ ͋Δͱ͚ͬ͜͏͏Ε͍͠ ※ ·࣮͋ࡍʹ͸͋Δͱ͏Ε͍͠

  35. DB ϨΠϠʔ͸ͳΜ͔ܾΊखͳ͍͠ ͱΓ͋͑ͣ PDO ͕࢖͑Ε͹ ... ͍΍·͋ ... (ͱ͸͍͕͑͢͞ʹੜPDO͸ ...

  36. ·ͱΊΔͱ * Very Simple MVC Architecture, * DI Container (Pimple),

    * Router (FastRoute), * EventDispatcher (Symfony EventDispatcher), * Renderer (Twig), * Logger (Monolog), * and some core components.
  37. ͦ͏͍͏ͷ͕͋Δͱ͍͍ΑͶʔʂ

  38. (͍͍ΑͶʔʂ)

  39. ͋Γ·ͨ͠

  40. !?

  41. https://github.com/mercari/dietcube