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
GraphQL あるいは React における自律的なデータ取得について
quramy
11
3k
Prolog入門
qnighy
4
1k
Architecture Decision Record (ADR)
nearme_tech
PRO
1
690
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
420
KSPの導入・移行を前向きに検討しよう!
shxun6934
PRO
0
280
unique パッケージから学ぶ interning と weak reference @ Asakusa.go#3
karamaru
2
810
Scala アプリケーションのビルドを改善してデプロイ時間を 1/4 にした話 | How I improved the build of my Scala application and reduced deployment time by 4x
nomadblacky
1
180
GoのIteratorに詳しくなってしまう
inatonix
1
200
Rubyのobject_id
qnighy
6
1.3k
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
380
僕が思い描くTypeScriptの未来を勝手に先取りする
yukukotani
9
2.4k
開発を加速する共有Swift Package実践
elmetal
PRO
0
420
Featured
See All Featured
How to name files
jennybc
75
98k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Designing with Data
zakiwarfel
98
5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
0
110
VelocityConf: Rendering Performance Case Studies
addyosmani
322
23k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
Building a Scalable Design System with Sketch
lauravandoore
459
32k
Side Projects
sachag
451
42k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
The Cult of Friendly URLs
andyhume
76
6k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
How GitHub Uses GitHub to Build GitHub
holman
472
290k
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