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
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
CSC509 Lecture 11
javiergs
PRO
0
180
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
310
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
イベント駆動で成長して委員会
happymana
1
320
Click-free releases & the making of a CLI app
oheyadam
2
110
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
520
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Facilitating Awesome Meetings
lara
50
6.1k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Done Done
chrislema
181
16k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Building Applications with DynamoDB
mza
90
6.1k
Docker and Python
trallard
40
3.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
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