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
Оптимизируем производительность блока Казначейство
lamodatech
0
970
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
18
2.9k
Immutable ActiveRecord
megane42
0
100
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
380
Amazon Nova Reelの可能性
hideg
0
240
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
Compose でデザインと実装の差異を減らすための取り組み
oidy
1
200
最近のVS Codeで気になるニュース 2025/01
74th
1
220
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
240
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
580
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
130
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
3.1k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9k
For a Future-Friendly Web
brad_frost
176
9.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
The Language of Interfaces
destraynor
156
24k
Adopting Sorbet at Scale
ufuk
74
9.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
The Cult of Friendly URLs
andyhume
78
6.2k
Music & Morning Musume
bryan
46
6.3k
A Tale of Four Properties
chriscoyier
157
23k
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