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.3k
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
300
Wide Event Analytics (LISA19)
igorw
4
920
a day in the life of a request
igorw
0
130
production: an owner's manual
igorw
0
160
The Power of 2
igorw
0
290
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
420
The Moral Character of Software
igorw
1
270
interdisciplinary computing (domcode)
igorw
0
280
miniKanren (clojure berlin)
igorw
1
290
Other Decks in Programming
See All in Programming
Swift Updates - Learn Languages 2025
koher
2
510
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
110
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.9k
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
350
Reading Rails 1.0 Source Code
okuramasafumi
0
250
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
280
🔨 小さなビルドシステムを作る
momeemt
4
690
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
260
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
150
楽して成果を出すためのセルフリソース管理
clipnote
0
190
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.6k
The Language of Interfaces
destraynor
161
25k
Music & Morning Musume
bryan
46
6.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
Building Adaptive Systems
keathley
43
2.7k
BBQ
matthewcrist
89
9.8k
Code Reviewing Like a Champion
maltzj
525
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Fireside Chat
paigeccino
39
3.6k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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