Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHPでダイエット / Dietcube #phpblt
Search
Sotaro Karasawa
January 13, 2016
Technology
2
4.3k
PHPでダイエット / Dietcube #phpblt
PHP de Diet / Released Dietcube 1.0.0
https://packagist.org/packages/dietcube/dietcube
Sotaro Karasawa
January 13, 2016
Tweet
Share
More Decks by Sotaro Karasawa
See All by Sotaro Karasawa
P2B Haus法人サポータープランのご提案
sotarok
1
28
ソフトウェアxスタートアップから見た飲食と配送の世界 / The World of Food Deliverlies and Restaurant Businesses from a Software and Startup Perspective
sotarok
2
1.2k
CTO 3度目の正直 / My 3rd CTO Career
sotarok
21
10k
Introduction to the Corporate Solutions Engineering at MTC2018
sotarok
1
36k
Mercari meetup for Corporate Engineering #1 / What is "Corporate Engineering"?
sotarok
2
2.3k
Markdown and WYSIWYG
sotarok
1
5.9k
20 Jan 2017 / Moving Beyond Borders - Mercari DAY
sotarok
8
15k
PHPBLT の心得 / PHPBLT #5 @ペパボ
sotarok
5
3.5k
Wiki についての今昔物語 / Crowi
sotarok
5
14k
Other Decks in Technology
See All in Technology
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
170
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
12
11k
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
160
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
Storage Browser for Amazon S3
miu_crescent
1
150
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
36
14k
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.3k
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
How to train your dragon (web standard)
notwaldorf
88
5.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Adaptive Systems
keathley
38
2.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Thoughts on Productivity
jonyablonski
67
4.4k
Being A Developer After 40
akosma
87
590k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Speed Design
sergeychernyshev
25
670
Typedesign – Prime Four
hannesfritz
40
2.4k
KATA
mclloyd
29
14k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Transcript
PHP ͰμΠΤοτ @sotarok Marcari, Inc.
ࣗݾհ @sotarok "ͦ͏ͨΖ͏͚ʔ" ◀࠷ۙ͋·ΓΞϐʔϧͯ͠ͳ͍ ͦ͏ͨΖ͏Ͱ͍͍Α ࠷ۙϨʔαʔࢤͰ͢
ͤΜͰΜ ങ͍·͠ΐ͏ ग़൛ه೦Πϕϯτggrks
ͤΜͰΜ Ԡื͠·͠ΐ͏ http://bit.ly/mercariphp
Έͳ͞Μ
μΠΤοτͯ͠·͔͢ʔʁ
PHP ͰμΠΤοτͱ͍͑
dietcake!!!
Ͱ͢ΑͶ!?
CakePHP ͩͱ ͍Ζ͍ΖΑ͚͍ͳͷ͕͍ͭͯΔ͔Β μΠΤοτͤͨͭ͞
⭕ ͍ ⭕ ͏͍͢ ⭕ Θ͔Γ͍͢
K̋ab ͞Μͱ͔ M̋rcari ͱ͔
݁ߏ͍Ζ͍Ζ͋Γ·͢
"ࣗࣾϑϨʔϜϫʔΫ"
* ֶशίετ * Ξοϓσʔτίετ * ࣗࣾͷཁ݅ͷϚον
→ ͲΜͲΜΕ
͍͖͞ΜͷPHPք۾
PSR-7 ͩͱ͔ Symfony Components ͩͱ͔ Zend Framework ͩͱ͔ Aura ͩͱ͔
͍͍͔Μ͡ʹͳ͖ͬͯͯΔ (ࡶ
brtRiver͞Μͷͭ ݁ߏࢀߟʹͳΓ·͢Α ʮPHP7 Ͱ PSR-7 ͱ Middleware Λ͏ϚΠΫϩϑϨʔϜ ϫʔΫΛॻ͍ͯΈͨʯ http://d.hatena.ne.jp/brtRiver/20160103/microframework_psr7_php7
ͰͬͺSymfony͍͢͝ͳͬͯ
͋Εͷ͍͢͝ ͓ͦ͗ͱ͔ͨ͠Μ͡ͷ͕ͭ΄͍͠ ͬͯͷΛݩʹ
͓Εͷ͔Μ͕͑Δ͍͖͞ΐ͏ͷ ͓Ε͓Ε ϑϨʔϜϫʔΫʹ͍ͭͯߟ͑ͯΈΔ
⭕ ͏͍͢ ⭕ ͍ ⭕ Θ͔Γ͍͢
ͰϧʔςΟϯά ... .htaccess ͡Όͳ͍Αͳ ※ DietCake mod_rewrite Ͱ routing
ͰϧʔςΟϯά ... .htaccess ͡Όͳ͍Αͳ ※ DietCake mod_rewrite Ͱ routing
→ FastRoute ͕͋Δ͡Όͳ͍͔
View ͕͢͞ʹ PHP View ɻɻ ※ ϝϧΧϦࣾͰTwigซ༻
View ͕͢͞ʹ PHP View ɻɻ ※ ϝϧΧϦࣾͰTwigซ༻ → ͏Μ Twig
͕͋Δ͡Όͳ͍͔
Logger Ͳ͏ͤ Monolog ͔ͭ͏Ͱ ͠ΐ? ※ ϝϧΧϦࣾͰ Monolog ͭͯ͜Δ
Logger Ͳ͏ͤ Monolog ͔ͭ͏Ͱ ͠ΐ? ※ ϝϧΧϦࣾͰ Monolog ͭͯ͜Δ →
Monolog ͕͋Δ͡Όͳ͍͔ɺ͋ͱ PSR
͏͍ͬ͢ DI ΄͍͠ ※ ͏Μɺ΄͍͠
͏͍ͬ͢ DI ΄͍͠ ※ ͏Μɺ΄͍͠ → Pimple ͘Β͍ͷ͏͍ͭ͢
EventDispatcher ͋Δͱ͚ͬ͜͏͏Ε͍͠ ※ ·࣮͋ࡍʹ͋Δͱ͏Ε͍͠ →·͋ͦΕͰ͍͏ͱͬͺSymfony ?
EventDispatcher ͋Δͱ͚ͬ͜͏͏Ε͍͠ ※ ·࣮͋ࡍʹ͋Δͱ͏Ε͍͠
DB ϨΠϠʔͳΜ͔ܾΊखͳ͍͠ ͱΓ͋͑ͣ PDO ͕͑Ε ... ͍·͋ ... (ͱ͍͕͑͢͞ʹੜPDO ...
·ͱΊΔͱ * Very Simple MVC Architecture, * DI Container (Pimple),
* Router (FastRoute), * EventDispatcher (Symfony EventDispatcher), * Renderer (Twig), * Logger (Monolog), * and some core components.
ͦ͏͍͏ͷ͕͋Δͱ͍͍ΑͶʔʂ
(͍͍ΑͶʔʂ)
͋Γ·ͨ͠
!?
https://github.com/mercari/dietcube