Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stack (sfugzh)

Igor Wiedler
October 02, 2013

Stack (sfugzh)

Short stack introduction at the symfony usergroup zürich.

Igor Wiedler

October 02, 2013
Tweet

More Decks by Igor Wiedler

Other Decks in Programming

Transcript

  1. 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
  2. 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) { ... } }
  3. UrlMap $blog = new Silex\Application(); $blog->get('/', function () { return

    'This is the blog!'; }); $app = new Stack\UrlMap($app, [ '/blog' => $blog, ]);
  4. 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);
  5. • Authentication • Debug toolbar • Injected routes • Signed

    cookies • Asset management • Force SSL • Error handling
  6. ( )