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
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
240
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
4
970
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
2.4k
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
3
2.3k
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
400
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
450
僕がつくった48個のWebサービス達
yusukebe
20
17k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
420
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.7k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
120
Outline View in SwiftUI
1024jp
1
280
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
GraphQLとの向き合い方2022年版
quramy
43
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Gamification - CAS2011
davidbonilla
80
5k
Designing Experiences People Love
moore
138
23k
Code Review Best Practice
trishagee
64
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Agile that works and the tools we love
rasmusluckow
327
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
BBQ
matthewcrist
85
9.3k
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