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
来年もre:Invent2024 に行きたいあなたへ - “集中”と“つながり”で楽しむ -
ny7760
0
110
What's in a Postgres major release? An analysis of contributions in the v17 timeframe | Claire Giordano | PGConf EU 2024
clairegiordano
1
680
クラシルの現在とこれから
am1157154
1
340
Apple/Google/Amazonの決済システムの違いを踏まえた定期購読課金システムの構築 / abema-billing-system
cyberagentdevelopers
PRO
1
190
失敗しないOpenJDKの非互換調査
tabatad
0
230
APIテスト自動化の勘所
yokawasa
4
1.1k
小規模に始めるデータメッシュとデータガバナンスの実践
kimujun
2
260
Hotwire光の道とStimulus
nay3
5
2.2k
Data Migration on Rails
ohbarye
7
4.5k
AI Builder について
miyakemito
1
130
入門『状態』#kaigionrails / "state" for beginners with Rails
shinkufencer
2
810
SwiftSyntaxでUIKitとSwiftUIの使用率を完璧に計測できちゃう件について
ldf_tech
0
160
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Code Review Best Practice
trishagee
64
17k
Ruby is Unlike a Banana
tanoku
96
11k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Producing Creativity
orderedlist
PRO
341
39k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
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