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
ソフトウェア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
20
9.7k
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.4k
Wiki についての今昔物語 / Crowi
sotarok
5
14k
PHP Conference 2015 / How to Build Efficient and Integrated Development Environment for The Team
sotarok
5
14k
Other Decks in Technology
See All in Technology
B2B SaaS × AI機能開発 〜テナント分離のパターン解説〜 / B2B SaaS x AI function development - Explanation of tenant separation pattern
oztick139
2
220
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
Taming you application's environments
salaboy
0
180
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
【若手エンジニア応援LT会】ソフトウェアを学んできた私がインフラエンジニアを目指した理由
kazushi_ohata
0
150
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
120
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
160
Featured
See All Featured
A designer walks into a library…
pauljervisheath
203
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
GraphQLとの向き合い方2022年版
quramy
43
13k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Writing Fast Ruby
sferik
627
61k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Producing Creativity
orderedlist
PRO
341
39k
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