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
7
ソフトウェア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
CustomCopを使ってMongoidのコーディングルールを整えてみた
jinoketani
0
220
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
380
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
670
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
250
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1k
podman_update_2024-12
orimanabu
1
260
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
420
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Unsuck your backbone
ammeep
669
57k
A Philosophy of Restraint
colly
203
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Agile that works and the tools we love
rasmusluckow
328
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
A better future with KSS
kneath
238
17k
Raft: Consensus for Rubyists
vanstee
137
6.7k
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