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
Slim3とPSR-7(PHPカンファレンス福岡 2016)
Search
marusan
May 21, 2016
Programming
2
3.6k
Slim3とPSR-7(PHPカンファレンス福岡 2016)
marusan
May 21, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
640
Haze - Real time background blurring
chrisbanes
1
500
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
180
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
640
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Criando Commits Incríveis no Git
marcelgsantos
2
170
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Featured
See All Featured
Site-Speed That Sticks
csswizardry
2
190
Code Reviewing Like a Champion
maltzj
520
39k
Done Done
chrislema
181
16k
We Have a Design System, Now What?
morganepeng
51
7.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Transcript
Slim3& PSR)7 PHP¼âÒ´ßâÆ_- 2016 ÚÒãH2 ^ _-»Ò¶Æ / D Copyright
(C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. (¨¯
P:
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 4h
W:µÒà
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ÁãÞ
PHP4h WebµÔݲ 5zX¯ Copyright (C) 2016 Yahoo Japan Corporation. All
Rights Reserved. W:µÒà
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ª
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. PHP'The'Right'Way'
B¯¬ ¡ª¬ • PHPªComposer ·âÆÎãÞ • Composer ? • »ÓŹ¾Î= "]
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. [M
! Slim'Framework ! PSR<7
Slim'Framework Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Slim¡æ
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Shinatra§
ryÒßã×áã¾ (Micro'Framework) £
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. p
?
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Josh'Lockhart(@codeguy)
• PHP'The'Right'Way lh • Modern'PHP lh • PHP<FIG© W:github.com(@codeguy)
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
æ
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. SymfonyÕãÆ
Silex¦ä ¼Ë 37¡
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. New!!
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTPØËÇãÅ
KRJ PSR<7' ,6¬(3.0)
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Slim
Li
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. •
HTTP'Router • PSR<7(Request,'Response) • Middleware • DI'Container
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Li¡°
¦°
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ©
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. •
HTTP'Router • PSR<7 • Middleware • DI'Container °"E x¡
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 4h
!Z)gÀÆÎ ä
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ·âÆÎãÞ
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. °¡|¦
Slim<Skelton ·âÆÎãÞ¦« $ composer create-project slim/slim-skeleton my-app
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ÑÞηâWebÂãÐãa
$ cd my-app $ php -S 0.0.0.0:8080 -t public public/index.php
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ä
E@ Xmd±®!!!! W:µÒà
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. |±¡
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTP'Router
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ¦|src/routes.php
~/fukuoka o*²u¦ <?php $app->get('/fukuoka', function ($request, $response) { $response->getBody()->write(' '); return $response; });
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ÑÞηâ(ry
$ php -S 0.0.0.0:8080 -t public public/index.php
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ä
1d±®!!!! W:µÒà
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ªªª
PSR<7³ æ
PSR<7 Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
©©PSR¡æ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. PHP<FIG'¿ÞãÔ
*f¯KRJ –PSR<0:'»ãÎàãÊã (N) –PSR<1/2:'ÀãͶâ¿ÆÉ·Þ –PSR<3:'à¿ –PSR<4:'»ãÎàãÊã –PSR<6:'½ÙËÄÛ –PSR<7:'HTTPØËÇãÅ
PSR ;GT Copyright (C) 2016 Yahoo Japan Corporation. All Rights
Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. UO1,2,4²{
;GT¡·âÉãÒ¹·Æ –PSR<3:'PSR'Log • https://github.com/php<fig/log –PSR<6:'PSR'Cache • https://github.com/php<fig/cache –PSR<7:'PSR'Http'Message • https://github.com/php<fig/http<message
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ·âÉãÒ¹·Æ
| °²VÜ·ÓÜÝ Y$¯± –PSR<3' monolog –PSR<6' stash –PSR<7' slim,'guzzle
PSR<7¡ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTPØËÇãÅ
·âÉãÒ¹·Æe
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ±
HTTPØËÇãŲ ¦«
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Http
Client (WebÓܸÃ) Request Message - Header - Body Response Message - Header - Body Http Server ݾºÆÎØËÇ ãŲv¯ß ÆÖâÆØËÇã Ų©¯ ݾºÆÎØËÇãÅ ²| °,6¯ßÆÖ âÆØËÇãŲt
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ݾºÆÎØËÇãÅ
²| °,6¯ßÆÖ âÆØËÇãŲt Http Server
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. HTTPØËÇãÅ
'å
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
¬Ý¾ºÆÎ
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
¬ßÆÖâƲ t
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ßÆÖâÆBody(q)¡
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. PSR<7
KRJ
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
¬Ý¾ºÆÎ ServerRequestInterface ݾºÆÎ9#¯»ÓŹ¾Î ( ®ªn$_SERVER¥³¬)
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
¬ßÆÖâƲt ResponseInterface ßÆÖâÆ9#²°¯»ÓŹ¾Î ( ®ªnÆÌãÉÆÀãÏ body )
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ßÆÖâÆBody¡
StreamInterface w®Stream® writeØÈËÏuBs§¯
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
å¡ÌÆί ServerRequestInterface ResponseInterface StreamInterface
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. °¡&¯(8&)
ServerRequestInterface ResponseInterface¡ %»ÓŹ¾Î
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. Slim¢
æ
+¡³ ³¦ <?php $app->get('/fukuoka', function ($request, $response) { $response->getBody()->write(' ');
return $response; }); +¡ServerRequestInterface +¡ResponseInterface +¡StreamInterface C3ResponseInterface²t ¡5° Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. ResponseInterface
%»ÓŹ¾Î P:äää
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. //
$app->get('/', function($request, $response) { // StatusCode $response->withStatus(404); // JSON $response->withHeader( 'Content-Type', 'application/json;charset=utf-8' ); return $response; });
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. //
$app->get('/', function($request, $response) { // StatusCode $response = $response->withStatus(404); // JSON $response = $response->withHeader( 'Content-Type', 'application/json;charset=utf-8' ); return $response; });
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. %»ÓŹ¾Î
withcØÈËϤ >»ÓŹ¾Î °¦} °²³®¦«}
¦¨ Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved.
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. 1.
Slim'+'ÑÞηâWebÂãÐã zX¯ 2. ÌÆί ¡ ServerRequestInterface ResponseInterface StreamInterface 3. &¯ ¡ ResponseInterface %»ÓŹ¾Î
Copyright (C) 2016 Yahoo Japan Corporation. All Rights Reserved. \
~¦¦S ¬ä¬n±°¦ ÚÒã _- I<(Q.b) zXxA3@(5/23)F¦ä ¦k01(` §) j} / D