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
Stack (sfugzh)
Search
Igor Wiedler
October 02, 2013
Programming
2
8.1k
Stack (sfugzh)
Short stack introduction at the symfony usergroup zürich.
Igor Wiedler
October 02, 2013
Tweet
Share
More Decks by Igor Wiedler
See All by Igor Wiedler
Redis Bedtime Stories
igorw
1
170
Wide Event Analytics (LISA19)
igorw
3
890
a day in the life of a request
igorw
0
98
production: an owner's manual
igorw
0
120
The Power of 2
igorw
0
190
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
330
The Moral Character of Software
igorw
1
230
interdisciplinary computing (domcode)
igorw
0
230
miniKanren (clojure berlin)
igorw
1
220
Other Decks in Programming
See All in Programming
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
Milestoner
bkuhlmann
1
410
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
280
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
4
380
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
240
『Railsオワコン』と言われる時代に、なぜブルーモ証券はRailsを選ぶのか
free_world21
1
360
VS Code をプロダクトにどう取り込むか
onomax
1
710
AppRouter Panel Talk
yosuke_furukawa
PRO
1
460
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
1
1.3k
Site Reliability Engineering for GMO
pyama86
8
1.1k
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
130
GitLab CI/CD で C#/WPFアプリケーションのテストとインストーラーのビルド・デプロイを自動化する
hacarus
0
290
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
43
12k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
It's Worth the Effort
3n
180
27k
Raft: Consensus for Rubyists
vanstee
133
6.3k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
21
1.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Visualization
eitanlees
137
14k
Agile that works and the tools we love
rasmusluckow
325
20k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Building Effective Engineering Teams - LeadDev
addyosmani
31
1.9k
Why Our Code Smells
bkeepers
PRO
331
56k
Transcript
None
Bundles ServiceProviders Modules ServiceProviders Modules ???
Framework Container HTTP
Framework Container HTTP
HttpKernelInterface
not about caching or functional tests
None
Routing Events Controllers Bundles Services Http
None
do something before or after every request
different take on event listeners
class Foo implements HttpKernelInterface { private $app; public function __construct(HttpKernelInterface
$app) { $this->app = $app; } public function handle(Request $request, ...) { $response = $this->app->handle($request, $type, $catch); return $response; } } 1 2 3
class Logger implements HttpKernelInterface { private $app; private $logger; public
function __construct(HttpKernelInterface $app, LoggerInterface $logger) { $this->app = $app; $this->logger = $logger; } public function handle(Request $request, ...) { $response = $this->app->handle($request, $type, $catch); $this->log($request, $response); return $response; } private function log(Request $request, Response $response) { ... } }
$app = new CallableHttpKernel(function ($request) { return new Response('Hello World!');
});
$app = new Logger( $app, new Monolog\Logger() );
UrlMap $blog = new Silex\Application(); $blog->get('/', function () { return
'This is the blog!'; }); $app = new Stack\UrlMap($app, [ '/blog' => $blog, ]);
Session $app = new CallableHttpKernel(function ($request) { $session = $request->getSession();
... }); $app = new Stack\Session($app);
OAuth $app = new Igorw\Stack\OAuth($app, [ 'key' => 'foo', 'secret'
=> 'bar', 'callback_url' => 'http://localhost:8080/auth/verify', 'success_url' => '/', 'failure_url' => '/auth', ]); $app = new Stack\Session($app);
OAuth $request->attributes->get('oauth.token');
Composition!
$stack = (new Stack\Builder()) ->push('Stack\Session') ->push('Igorw\Stack\OAuth', [...]) ->push('Foo'); $app =
$stack->resolve($app);
• GeoIp • IpRestrict • Backstage • Basic Authentication •
Hawk • CORS Community
It doesn’t stop there
• Authentication • Debug toolbar • Injected routes • Signed
cookies • Asset management • Force SSL • Error handling
( )
Questions? • stackphp.com • #stackphp • @stackphp • @igorwesome