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.2k
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
260
Wide Event Analytics (LISA19)
igorw
4
900
a day in the life of a request
igorw
0
110
production: an owner's manual
igorw
0
140
The Power of 2
igorw
0
250
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
370
The Moral Character of Software
igorw
1
250
interdisciplinary computing (domcode)
igorw
0
260
miniKanren (clojure berlin)
igorw
1
250
Other Decks in Programming
See All in Programming
Spring gRPC について / About Spring gRPC
mackey0225
0
220
ARA Ansible for the teams
kksat
0
150
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
10
1.8k
Software Architecture
hschwentner
6
2.1k
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
110
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
160
Conform を推す - Advocating for Conform
mizoguchicoji
3
680
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
AHC041解説
terryu16
0
590
Introduction to kotlinx.rpc
arawn
0
630
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
It's Worth the Effort
3n
184
28k
Being A Developer After 40
akosma
89
590k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
RailsConf 2023
tenderlove
29
1k
A Philosophy of Restraint
colly
203
16k
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