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.1k
CTO 3度目の正直 / My 3rd CTO Career
sotarok
20
9.6k
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.8k
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
エンジニア向け会社紹介資料
caddi_eng
15
250k
手軽に始める? おうちサーバーのすゝめ
nyagasan
0
180
EitherT_with_Future
aoiroaoino
0
380
Evolving DevOps Teams and Flexible Organizational Culture
kakehashi
1
130
脆弱星に導かれて
nishimunea
1
1.5k
Namespace, Now and Then
tagomoris
0
170
Staff Engineer / 20240827 Yuichiro Masui
shift_evolve
0
150
20240906_JAWS_Yamanashi_#1_leap_beyond_the_AWS_all_certifications
tsumita
1
100
歴史と背景から改めて振り返るVPC
shotashiratori
2
220
Binary Authorizationと友達になろう / Let's be friends with Binary Authorization
iselegant
2
130
なぜクラウドサービスで Web コンソールを提供するのか
shuta13
4
1.3k
[RSJ24] Task Success Prediction for Open-Vocabulary Manipulation Based on Multi-Level Aligned Representations
keio_smilab
PRO
0
220
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
StorybookのUI Testing Handbookを読んだ
zakiyama
25
5k
Facilitating Awesome Meetings
lara
49
5.9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
How To Stay Up To Date on Web Technology
chriscoyier
785
250k
The Pragmatic Product Professional
lauravandoore
30
6.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
28
2.2k
Done Done
chrislema
180
16k
Code Reviewing Like a Champion
maltzj
518
39k
Ruby is Unlike a Banana
tanoku
96
10k
How to name files
jennybc
75
97k
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