Slide 1

Slide 1 text

meets http://www.flickr.com/photos/nimport_nawak/3404931191

Slide 2

Slide 2 text

Drupal 8 meets Symfony Fabien Potencier @fabpot [email protected] Founder of Lead developer of Open-Source libraries Twig, Swiftmailer, Silex, Pirum, Sismo, Pimple, Goutte, ... Symfony founder and lead developer

Slide 3

Slide 3 text

Drupal 8 meets Symfony Lukas Kahwe Smith @lsmith [email protected] Works for in Switzerland PHP 5.3 Release Manager Co-lead of PHPCR Symfony2 core contributor

Slide 4

Slide 4 text

http://www.flickr.com/photos/dunechaser/160405823 Drupal 8 meets Symfony How many of you are PHP developers?

Slide 5

Slide 5 text

Drupal 8 meets Symfony http://www.flickr.com/photos/dunechaser/142079357 How many of you are Symfony “aware”?

Slide 6

Slide 6 text

Drupal 8 meets Symfony We are both “outsiders” We are both quite experienced PHP developers We have a rough understanding of the hook paradigm aka the Drupal way http://www.flickr.com/photos/pictureperfectpose/76138988

Slide 7

Slide 7 text

Drupal 8 meets Symfony A sad realization It would take a long time for us to be productive in Drupal let alone work on the core And everything we learn along the way would only help us with Drupal

Slide 8

Slide 8 text

Drupal 8 meets Symfony What others do Building on top of long established OO design patterns Leverage new PHP language features and performance improvements Share code!

Slide 9

Slide 9 text

Drupal 8 meets Symfony So Drupal is wrong? No, the question is just if the benefits of doing things differently outweigh the disadvantages

Slide 10

Slide 10 text

Drupal 8 meets Symfony Core brain drain “The complexity of the custom code that’s used and the non-standard architecture combines to create a barrier to entry for developers new to Drupal (both experienced and novice developers alike).” buytaert.net

Slide 11

Slide 11 text

Drupal 8 meets Symfony What could be gained Facilitate the refactoring towards a “framework” core Focus Drupal dev resources on the CMS Easier integration with other applications Ensure that the Drupal developer pool continues to grow

Slide 12

Slide 12 text

Drupal 8 meets Symfony A decision was made “While these changes may seem large, and some of them are, we believe that they will achieve the right balance between empowering Drupal's design and architecture, and moving toward more modern, standard, well-tested code and techniques to empower a new generation of developers.” buytaert.net

Slide 13

Slide 13 text

Drupal 8 meets Symfony How to collaborate? Symfony2 is MIT licensed which is GPL compatible Symfony2 development is very transparently managed on github.com We want to ensure Symfony2 works for Drupal, phpBB, etc.

Slide 14

Slide 14 text

Drupal 8 meets Symfony For example ... Symfony2.0 provides a concept called “flash messages” to pass messages to the very next request drupal_set_message() could be replaced by this if we make it a bit more flexible Drak, lead of the Zikula CMS, created a PR to address exactly these concerns

Slide 15

Slide 15 text

Drupal 8 meets Symfony What is Symfony? http://www.flickr.com/photos/apranihita/141159146/

Slide 16

Slide 16 text

Drupal 8 meets Symfony http://www.flickr.com/photos/bigpinkcookie/22716359

Slide 17

Slide 17 text

Drupal 8 meets Symfony is... ... a reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems http://www.flickr.com/photos/krislitman/493626935

Slide 18

Slide 18 text

Drupal 8 meets Symfony is... ... an Object-Oriented set of classes ... compatible with PHP 5.3 and later http://www.flickr.com/photos/krislitman/493626935

Slide 19

Slide 19 text

Drupal 8 meets Symfony DependencyInjection EventDispatcher HttpFoundation DomCrawler ClassLoader CssSelector HttpKernel BrowserKit Templating Translation Filesystem Serializer Validator Security Routing Console Process Config Finder Locale Yaml Form

Slide 20

Slide 20 text

Drupal 8 meets Symfony is... ... a full-stack web framework http://www.flickr.com/photos/krislitman/493626935

Slide 21

Slide 21 text

Drupal 8 meets Symfony Official website http://symfony.com/ Official repository https://github.com/symfony/symfony http://www.flickr.com/photos/28634332@N05/5654415647

Slide 22

Slide 22 text

Drupal 8 meets Symfony Official website http://symfony.com/components Official repositories https://github.com/symfony/XXXX Components http://www.flickr.com/photos/28634332@N05/5654415647

Slide 23

Slide 23 text

Drupal 8 meets Symfony Mailing-list https://groups.google.com/group/symfony2 IRC channel irc://irc.freenode.net/symfony http://www.flickr.com/photos/28634332@N05/5654415647

Slide 24

Slide 24 text

Drupal 8 meets Symfony Which Open-Source projects are already using the Symfony Components? http://www.flickr.com/photos/maistora/3014414972

Slide 25

Slide 25 text

Drupal 8 meets Symfony Behat - a BDD framework Console, DependencyInjection, EventDispatcher, Finder, Yaml, Config, Translation Doctrine - an object relational mapper Console, Yaml Propel - an object relational mapper Console, ClassLoader, Yaml PHPUnit - a PHP unit testing framework Yaml, (Finder soon?) Jackalope - a content repository (JCR 170/283) ClassLoader, Console Developer Tools http://www.flickr.com/photos/c_r_i_s/77763712

Slide 26

Slide 26 text

Drupal 8 meets Symfony Silex - a micro-framework BrowerKit, CssSelector, DomCrawler, EventDispatcher, HttpFoundation, HttpKernel, Routing, Form, Translation, Validator PPI 2 - a framework ClassLoader, HttpFoundation, Routing, Templating Frameworks http://www.flickr.com/photos/c_r_i_s/77763712

Slide 27

Slide 27 text

Drupal 8 meets Symfony easybook - a book publishing platform ClassLoader, Console, EventDispatcher, Filesystem, Finder, Yaml Midgard CMS - a content management framework uses the full-stack framework Zikula - ex PostNuke - an application framework HttpFoundation, HttpKernel, EventDispatcher, ClassLoader, DependencyInjection phpBB - a bulletin board software EventDispatcher, and most of them for version 4? Products http://www.flickr.com/photos/c_r_i_s/77763712

Slide 28

Slide 28 text

Drupal 8 meets Symfony What about Drupal 8? http://www.flickr.com/photos/aloshbennett/619307160

Slide 29

Slide 29 text

Drupal 8 meets Symfony DependencyInjection EventDispatcher HttpFoundation DomCrawler ClassLoader CssSelector HttpKernel BrowserKit Templating Translation Filesystem Serializer Validator Security Routing Console Process Config Finder Locale Yaml Form

Slide 30

Slide 30 text

Drupal 8 meets Symfony DependencyInjection EventDispatcher HttpFoundation DomCrawler ClassLoader CssSelector HttpKernel BrowserKit Templating Translation Filesystem Serializer Validator Security Routing Console Process Config Finder Locale Yaml Form

Slide 31

Slide 31 text

Drupal 8 meets Symfony Using the Symfony Components http://www.flickr.com/photos/35168673@N03/6086229920

Slide 32

Slide 32 text

Drupal 8 meets Symfony $ git clone https://github.com/symfony/Console.git $ git co v2.0.9 $ git co 2.0 $ git co master Git

Slide 33

Slide 33 text

Drupal 8 meets Symfony $ curl -O https://github.com/symfony/Console/zipball/v2.0.9 $ curl -O https://github.com/symfony/Console/zipball/2.0 $ curl -O https://github.com/symfony/Console/zipball/master Archives

Slide 34

Slide 34 text

Drupal 8 meets Symfony $ pear channel-discover pear.symfony.com $ pear install symfony2/Console-2.0.9 PEAR

Slide 35

Slide 35 text

Drupal 8 meets Symfony composer.json { "require": { "symfony/console": "2.1.*", "symfony/http-foundation": "v2.0.9" } } curl -s http://getcomposer.org/installer | php php composer.phar install Composer

Slide 36

Slide 36 text

Drupal 8 meets Symfony Symfony Components comes with Drupal 8

Slide 37

Slide 37 text

Drupal 8 meets Symfony ClassLoader

Slide 38

Slide 38 text

Drupal 8 meets Symfony http://symfony.com/PSR0

Slide 39

Slide 39 text

Drupal 8 meets Symfony require_once __DIR__.'/src/Symfony/Component/ ClassLoader/UniversalClassLoader.php'; use Symfony\Component\ClassLoader\UniversalClassLoader; $loader = new UniversalClassLoader(); $loader->registerNamespaces(array( 'Symfony' => __DIR__.'/vendor/symfony/src', )); $loader->register();

Slide 40

Slide 40 text

$loader->registerPrefixes(array( 'Twig_' => __DIR__.'/vendor/twig/lib', )); Drupal 8 meets Symfony

Slide 41

Slide 41 text

Drupal 8 meets Symfony The Symfony ClassLoader Component loads your project classes automatically if they follow some standard conventions http://www.flickr.com/photos/ynaffitx/4667769355

Slide 42

Slide 42 text

Drupal 8 meets Symfony HttpFoundation

Slide 43

Slide 43 text

Drupal 8 meets Symfony http://www.flickr.com/photos/deniscollette/6741424757 HTTP HTTP/1.1 RFC 2616 http://www.ietf.org/rfc/rfc2616.txt http://tools.ietf.org/wg/httpbis/

Slide 44

Slide 44 text

Drupal 8 meets Symfony The Web in action The User asks for a Resource in a Browser http://example.com/foo.html

Slide 45

Slide 45 text

Drupal 8 meets Symfony The Web in action The User asks for a Resource in a Browser The Browser sends a Request to the Server GET /foo.html HTTP/1.1 Host: example.com

Slide 46

Slide 46 text

Drupal 8 meets Symfony The Web in action The User asks for a Resource in a Browser The Browser sends a Request to the Server The Server sends back a Response to the Browser HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 47

Slide 47 text

Drupal 8 meets Symfony The Web in action The User asks for a Resource in a Browser The Browser sends a Request to the Server The Server sends back a Response to the Browser The Browser displays the Resource to the User

Slide 48

Slide 48 text

Drupal 8 meets Symfony Internet Client Server The Client sends a Request to the Server The Server sends back a Response to the Client Request GET /foo.html HTTP/1.1 Host: example.com Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 49

Slide 49 text

Drupal 8 meets Symfony Request GET /foo.html HTTP/1.1 Host: example.com http://www.flickr.com/photos/splorp/64027565

Slide 50

Slide 50 text

session_start(); $name = $_GET['name']; // $_POST, $_FILE, $_COOKIE, ... echo $_SESSION['name']; $method = $_SERVER['REQUEST_METHOD']; Drupal 8 meets Symfony Request GET /foo.html HTTP/1.1 Host: example.com

Slide 51

Slide 51 text

Drupal 8 meets Symfony $clientIp = $_SERVER['REMOTE_ADDR']; Request GET /foo.html HTTP/1.1 Host: example.com

Slide 52

Slide 52 text

Drupal 8 meets Symfony if (isset($_SERVER['HTTP_CLIENT_IP'])) { return $_SERVER['HTTP_CLIENT_IP']; } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'], 2); return isset($ips[0]) ? trim($ips[0]) : ''; } return $_SERVER['REMOTE_ADDR']; Request GET /foo.html HTTP/1.1 Host: example.com

Slide 53

Slide 53 text

Drupal 8 meets Symfony if ($trustProxy) { if (isset($_SERVER['HTTP_CLIENT_IP'])) { return $_SERVER['HTTP_CLIENT_IP']; } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'], 2); return isset($ips[0]) ? trim($ips[0]) : ''; } } return $_SERVER['REMOTE_ADDR']; Request GET /foo.html HTTP/1.1 Host: example.com

Slide 54

Slide 54 text

Drupal 8 meets Symfony http://www.flickr.com/photos/viamoi/3338093351 Not Object-Oriented Low-level abstraction only “Singleton” like Not Object-Oriented Request GET /foo.html HTTP/1.1 Host: example.com

Slide 55

Slide 55 text

Drupal 8 meets Symfony use Symfony\Component\HttpFoundation\Request; $request = Request::createFromGlobals(); $request = Request::create('/hello.html', 'GET'); $request->overrideGlobals(); Request GET /foo.html HTTP/1.1 Host: example.com

Slide 56

Slide 56 text

Drupal 8 meets Symfony $request->query->get('name', 'Default'); $request->getSession()->get('name'); $request->getPathInfo(); $request->getClientIp(); Request::trustProxyData(); Request GET /foo.html HTTP/1.1 Host: example.com

Slide 57

Slide 57 text

Drupal 8 meets Symfony Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World! http://www.flickr.com/photos/splorp/64027565

Slide 58

Slide 58 text

Drupal 8 meets Symfony Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World! header('HTTP/1.0 404 Not Found'); header('Content-Type: text/html; charset=UTF-8'); setcookie('name', $name); $_SESSION['name'] = 'Fabien'; echo 'Hello '.$name;

Slide 59

Slide 59 text

Drupal 8 meets Symfony http://www.flickr.com/photos/viamoi/3338093351 Low-level abstraction only “Singleton” like Does not play well with the CLI Not Object-Oriented Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 60

Slide 60 text

Drupal 8 meets Symfony use Symfony\Component\HttpFoundation\Response; $response = new Response('Not Found', 404, array('Content-Type' => 'text/plain')); $response = new Response(); $response->setContent('Hello World'); $response->send(); Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 61

Slide 61 text

Drupal 8 meets Symfony use Symfony\Component\HttpFoundation\StreamedResponse; $response = new StreamedResponse(function () { echo 'foo'; flush(); echo 'bar'; }); $response->send(); Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 62

Slide 62 text

Drupal 8 meets Symfony $headers = $response->headers; $headers->set( 'Content-Disposition', $headers->makeDisposition( ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'foo.pdf') ); Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 63

Slide 63 text

Drupal 8 meets Symfony $response->prepare($request); Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World!

Slide 64

Slide 64 text

Drupal 8 meets Symfony Session Management http://www.flickr.com/photos/tomvu/5371659662

Slide 65

Slide 65 text

Drupal 8 meets Symfony The Symfony HttpFoundation Component defines a feature-full object-oriented layer for the HTTP messages http://www.flickr.com/photos/ynaffitx/4667769355

Slide 66

Slide 66 text

Drupal 8 meets Symfony It replaces PHP native global variables and functions to allow writing better, more secure, and more testable code http://www.flickr.com/photos/ynaffitx/4667769355

Slide 67

Slide 67 text

Drupal 8 meets Symfony Routing

Slide 68

Slide 68 text

Drupal 8 meets Symfony use Symfony\Component\Routing\Route; $route = new Route('/node/{id}', array( '_controller' => 'SomeClass::someMethod' )); use Symfony\Component\Routing\RouteCollection; $routes = new RouteCollection(); $routes->add('node', $route);

Slide 69

Slide 69 text

Drupal 8 meets Symfony use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\Matcher\UrlMatcher; $matcher = new UrlMatcher($routes, new RequestContext()); $attributes = $matcher->match('/node/12'); $attributes = $matcher->match($request->getPathInfo()); print_r($attributes); array( '_route' => 'node', 'id' => 12, '_controller' => 'SomeClass::someMethod', );

Slide 70

Slide 70 text

Drupal 8 meets Symfony use Symfony\Component\Routing\Generator\UrlGenerator; $generator = new UrlGenerator($routes, $context); echo $generator->generate('node', array('id' => 12));

Slide 71

Slide 71 text

Drupal 8 meets Symfony The Symfony Routing Component decouples the look of URLs from the code that handle them http://www.flickr.com/photos/ynaffitx/4667769355

Slide 72

Slide 72 text

Drupal 8 meets Symfony EventDispatcher

Slide 73

Slide 73 text

Drupal 8 meets Symfony use Symfony\Component\EventDispatcher\EventDispatcher; $dispatcher = new EventDispatcher(); $callable = function (Event $event) { // do something }; $dispatcher->addListener('event_name', $callable); $dispatcher->dispatch('event_name', new Event());

Slide 74

Slide 74 text

Drupal 8 meets Symfony The Symfony EventDispatcher Component implements a lightweight version of the Observer design pattern http://www.flickr.com/photos/ynaffitx/4667769355

Slide 75

Slide 75 text

Drupal 8 meets Symfony HttpKernel

Slide 76

Slide 76 text

Drupal 8 meets Symfony Request Response HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 Content-Type: text/html Hello World! GET /foo.html HTTP/1.1 Host: example.com http://www.flickr.com/photos/-bast-/349497988

Slide 77

Slide 77 text

Drupal 8 meets Symfony The web in action The User asks for a Resource in a Browser The Browser sends a Request to the Server Symfony gives the Developer a Request Object The Developer “converts” the Request Object to a Response Object The Server sends back a Response to the Browser The Browser displays the Resource to the User

Slide 78

Slide 78 text

Drupal 8 meets Symfony namespace Symfony\Component\HttpKernel; interface HttpKernelInterface { /** * @return Response A Response instance */ function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true); }

Slide 79

Slide 79 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content Workflow

Slide 80

Slide 80 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 81

Slide 81 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 82

Slide 82 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 83

Slide 83 text

Drupal 8 meets Symfony namespace Symfony\Component\HttpKernel\Controller; interface ControllerResolverInterface { function getController(Request $request); function getArguments(Request $request, $controller); }

Slide 84

Slide 84 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 85

Slide 85 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 86

Slide 86 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 87

Slide 87 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 88

Slide 88 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 89

Slide 89 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 90

Slide 90 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 91

Slide 91 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 92

Slide 92 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 93

Slide 93 text

Drupal 8 meets Symfony $routes = new RouteCollection(); $routes->add('hello', new Route('/hello', array('_controller' => function (Request $request) { return new Response(sprintf("Hello %s", $request->get('name'))); } ))); $request = Request::createFromGlobals(); $matcher = new UrlMatcher($routes, new RequestContext()); $dispatcher = new EventDispatcher(); $dispatcher->addSubscriber(new RouterListener($matcher)); $resolver = new ControllerResolver(); $kernel = new HttpKernel($dispatcher, $resolver); $kernel->handle($request)->send();

Slide 94

Slide 94 text

Drupal 8 meets Symfony Symfony built-in listeners http://www.flickr.com/photos/c_r_i_s/67306260

Slide 95

Slide 95 text

Drupal 8 meets Symfony $handler = function ($exception) { return new Response($exception->getMessage(), 500); }); $dispatcher->addSubscriber(new ExceptionListener($handler));

Slide 96

Slide 96 text

Drupal 8 meets Symfony $handler = function ($exception) { $handler = new ExceptionHandler(); return $handler->createResponse($exception); }); $dispatcher->addSubscriber(new ExceptionListener($handler));

Slide 97

Slide 97 text

Drupal 8 meets Symfony

Slide 98

Slide 98 text

Drupal 8 meets Symfony The default HttpKernel implementation makes Drupal interoperable with any other software using the same http://www.flickr.com/photos/ynaffitx/4667769355

Slide 99

Slide 99 text

Drupal 8 meets Symfony http://www.flickr.com/photos/cmogle/2947179118 HTTP Testing

Slide 100

Slide 100 text

Drupal 8 meets Symfony use Symfony\Component\HttpKernel\Client; $client = new Client($kernel); $client->request('GET', '/hello/Fabien'); $response = $client->getResponse(); $this->assertEquals(200, $response->getStatusCode());

Slide 101

Slide 101 text

Drupal 8 meets Symfony use Symfony\Component\HttpKernel\Client; $client = new Client($kernel); $crawler = $client->request('GET', '/hello/Fabien'); $nodes = $crawler->filter('h1:contains("Fabien")'); $this->assertCount(1, $nodes);

Slide 102

Slide 102 text

http://www.flickr.com/photos/laserstars/908946494 Drupal 8 meets Symfony HTTP Caching

Slide 103

Slide 103 text

Expiration Cache-Control Expires

Slide 104

Slide 104 text

Validation Last-Modified If-Modified-Since ETag If-None-Match

Slide 105

Slide 105 text

Drupal 8 meets Symfony $response->setTtl(10); $response->setClientTtl(10);

Slide 106

Slide 106 text

Drupal 8 meets Symfony // get the last modified date as fast as you can $lastModified = ...; $response = new Response(); $response->setLastModified($lastModified); if ($response->isNotModified($request)) { return $response; } // do the expensive work $response->setContent(...); return $response;

Slide 107

Slide 107 text

Drupal 8 meets Symfony Expiration wins over Validation http://www.flickr.com/photos/hoyvinmayvin/4672922637

Slide 108

Slide 108 text

Drupal 8 meets Symfony $kernel = new HttpKernel($dispatcher, $resolver); $kernel = new HttpCache($kernel, new Store($cacheDir));

Slide 109

Slide 109 text

Drupal 8 meets Symfony Varnish The HTTP accelerator Varnish The HTTP accelerator http://www.flickr.com/photos/stuckincustoms/3232133635

Slide 110

Slide 110 text

Drupal 8 meets Symfony Using the default HttpKernel allows Drupal to benefit from the many built-in features http://www.flickr.com/photos/ynaffitx/4667769355

Slide 111

Slide 111 text

Drupal 8 meets Symfony Edge Side Includes ESI http://www.w3.org/TR/esi-lang h"p://www.flickr.com/photos/bored-­‐now/2264811719

Slide 112

Slide 112 text

Drupal 8 meets Symfony

Slide 113

Slide 113 text

Drupal 8 meets Symfony

Slide 114

Slide 114 text

Drupal 8 meets Symfony HTTP Validation

Slide 115

Slide 115 text

Drupal 8 meets Symfony HTTP Expiration HTTP Validation

Slide 116

Slide 116 text

Drupal 8 meets Symfony

Slide 117

Slide 117 text

Drupal 8 meets Symfony Request Response response Call Controller response? expection Sub-Request terminate controller view resolve controller resolve arguments request exception “sub-response” content

Slide 118

Slide 118 text

Drupal 8 meets Symfony HTTP Expiration

Slide 119

Slide 119 text

Reverse Proxy Cache Browser Your PHP application GET /foo HTTP/1.1 Host: foo.org GET /foo HTTP/1.1 Host: foo.org GET /bar HTTP/1.1 Host: foo.org Lorem   ipsum   dolor   HTTP/1.1 200 OK C-C: s-maxage=600 Lorem  ipsum   dolor HTTP/1.1 200 OK C-C: s-maxage=5 Lorem  ipsum   dolor  sit  amet,   Lorem   ipsum   dolor HTTP/1.1 200 OK GET /foo C-C: s-maxage=600 Lor GET /bar C-C: s-maxage=5 Lorem

Slide 120

Slide 120 text

Reverse Proxy Cache Your PHP application GET /foo HTTP/1.1 Host: foo.org Lorem  ipsum   dolor  sit  amet,   Lorem   ipsum   dolor HTTP/1.1 200 OK GET /foo C-C: s-maxage=600 Lor GET /bar C-C: s-maxage=5 Lorem before exp. Browser

Slide 121

Slide 121 text

Reverse Proxy Cache Your PHP application GET /foo HTTP/1.1 Host: foo.org GET /bar HTTP/1.1 Host: foo.org Lorem  ipsum   dolor HTTP/1.1 200 OK C-C: s-maxage=5 Lorem  ipsum   dolor  sit  amet,   Lorem   ipsum   dolor HTTP/1.1 200 OK GET /foo C-C: s-maxage=600 Lor GET /bar C-C: s-maxage=5 Lorem after exp. Browser

Slide 122

Slide 122 text

Drupal 8 meets Symfony $kernel = new HttpCache( $kernel, new Store($cacheDir), new Esi() );

Slide 123

Slide 123 text

Drupal 8 meets Symfony http://www.flickr.com/photos/stuckincustoms/3232133635 Varnish The HTTP accelerator Varnish The HTTP accelerator

Slide 124

Slide 124 text

Drupal 8 meets Symfony The Symfony HttpKernel Component provides the building blocks to create flexible, extensible, and scalable HTTP-based frameworks http://www.flickr.com/photos/ynaffitx/4667769355

Slide 125

Slide 125 text

Drupal 8 meets Symfony The Symfony HttpKernel Component leverages the HTTP specification to make integration between projects easy http://www.flickr.com/photos/ynaffitx/4667769355

Slide 126

Slide 126 text

Drupal 8 meets Symfony DependencyInjection EventDispatcher HttpFoundation DomCrawler ClassLoader CssSelector HttpKernel BrowserKit Templating Translation Filesystem Serializer Validator Security Routing Console Process Config Finder Locale Yaml Form http://www.flickr.com/photos/ecstaticist/3860865429 http://symfony.com/components

Slide 127

Slide 127 text

Drupal 8 meets Symfony Silex https://github.com/fabpot/Silex http://silex.sensiolabs.org/ http://www.flickr.com/photos/linhngan/2715287035

Slide 128

Slide 128 text

Drupal 8 meets Symfony http://fabien.potencier.org/build-a-framework Build your own framework http://www.flickr.com/photos/linhngan/2715287035

Slide 129

Slide 129 text

Drupal 8 meets Symfony http://live.symfony.com/

Slide 130

Slide 130 text

Drupal 8 meets Symfony The Symfony Components provides the low-level building blocks that you need to build a web product so that YOU can focus on what matters most for Drupal http://www.flickr.com/photos/ynaffitx/4667769355

Slide 131

Slide 131 text

Drupal 8 meets Symfony http://www.flickr.com/photos/stevendepolo/4582437563 @fabpot @lsmith