Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

Έͳ͞Μ

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

PHP ͰμΠΤοτͱ͍͑͹

Slide 8

Slide 8 text

dietcake!!!

Slide 9

Slide 9 text

Ͱ͢ΑͶ!?

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

݁ߏ͍Ζ͍Ζ͋Γ·͢

Slide 14

Slide 14 text

"ࣗࣾϑϨʔϜϫʔΫ"

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

→ ͲΜͲΜ΍Ε

Slide 17

Slide 17 text

͍͖͞ΜͷPHPք۾

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

Ͱ΋ϧʔςΟϯά͸ ... .htaccess ͡Όͳ͍Αͳ ※ DietCake ͸ mod_rewrite Ͱ routing → FastRoute ͕͋Δ͡Όͳ͍͔

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

͏͍ͬ͢ DI ΋΄͍͠ ※ ͏Μɺ΄͍͠

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

·ͱΊΔͱ * Very Simple MVC Architecture, * DI Container (Pimple), * Router (FastRoute), * EventDispatcher (Symfony EventDispatcher), * Renderer (Twig), * Logger (Monolog), * and some core components.

Slide 37

Slide 37 text

ͦ͏͍͏ͷ͕͋Δͱ͍͍ΑͶʔʂ

Slide 38

Slide 38 text

(͍͍ΑͶʔʂ)

Slide 39

Slide 39 text

͋Γ·ͨ͠

Slide 40

Slide 40 text

!?

Slide 41

Slide 41 text

https://github.com/mercari/dietcube