Drupal users group_symfony2
Upcoming SlideShare
Loading in...5
×
 

Drupal users group_symfony2

on

  • 1,343 views

 

Statistics

Views

Total Views
1,343
Views on SlideShare
433
Embed Views
910

Actions

Likes
2
Downloads
1
Comments
0

6 Embeds 910

http://www.carsonblack.com 457
http://carsonblack.com 439
http://dev.carsonblack.com 9
http://prlog.ru 2
http://dev.new.com 2
http://cblack.prod2.webenabled.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Drupal users group_symfony2 Drupal users group_symfony2 Presentation Transcript

  • Symfony2 Components in Drupal8
  • Symfony2 Components in Drupal8● PHP Programmer● LAMP● Symfony2 (is my favorite)● Javascript● PHP Meetup OrganizerTwitter:@bzitzowEmail:bzitzow@gmail.com
  • Symfony2 Components in Drupal8How & Why?!
  • Drupal & W.S.C.C.I.Web Services and Context Core Initiative
  • Drupal & W.S.C.C.I.Web Services and Context Core InitiativeThe Web Services and Context Core Initiative (WSCCI)aims to transform Drupal from a first-class CMS to a first-classREST server with a first-class CMS on top of it.
  • Drupal & W.S.C.C.I.Web Services and Context Core InitiativeThe Web Services and Context Core Initiative (WSCCI)aims to transform Drupal from a first-class CMS to afirst-class REST server with a first-class CMS on top of it.
  • First Class
  • First ClassThe term generally implies a high levelof service, importance or quality.Source: Wikipedia
  • QualityCode Testing Anyone?
  • DrupalA First Class CMS?
  • DrupalA First Class CMS?
  • DrupalA First Class REST Server?
  • DrupalA First Class REST Server?
  • Drupal W.S.C.C.I.Web Services and Context Core InitiativeThe Web Services and Context Core Initiative (WSCCI) aimsto transform Drupal from a first-class CMS to a first-classREST server with a first-class CMS on top of it.
  • Drupal W.S.C.C.I.Web Services and Context Core InitiativeThe Web Services and Context Core Initiative (WSCCI) aimsto transform Drupal from a first-class CMS to a first-classREST server with a first-class CMS on top of it.To do that, we must give Drupal a unified, powerful contextsystem that will support smarter, context- sensitive, easilycacheable block-centric layouts and non-page responsesusing a robust unified plugin mechanism.Source: http://groups.drupal.org/wscci
  • Enter Cliche` Wisdom
  • Symfony2
  • Symfony2A reusable set of standalone, decoupled, andcohesive PHP components that solve commonweb development problems.
  • Symfony2A reusable set of standalone, decoupled, andcohesive PHP components that solve commonweb development problems.“An HTTP framework; it is a Request /Response framework. Thats the big deal. Thefundamental principles of Symfony2 arecentered around the HTTP specification.”~ Fabien Potencier
  • Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher● Routing● Dependency Injection● Class Loader
  • Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher● Routing● Dependency Injection● Class Loader
  • Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher
  • HTTP Kernel ComponentThe HttpKernel Component provides astructured process for converting a Requestinto a Response by making use of the eventdispatcher.
  • HTTP Kernel Component
  • HTTP Kernel ComponentThe HttpKernel Component provides astructured process for converting a Requestinto a Response by making use of the eventdispatcher.Flexible enough to create:● a full-stack framework (Symfony)● a micro-framework (Silex)● an advanced CMS system (Drupal)
  • HTTP Kernel ComponentThe HttpKernel Component provides astructured process for converting a Requestinto a Response by making use of the eventdispatcher.Flexible enough to create:● a full-stack framework (Symfony)● a micro-framework (Silex)● an advanced CMS system (Drupal)
  • Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher
  • HTTP Foundation ComponentThe HttpFoundation Component defines anobject-oriented layer for the HTTPspecification.
  • HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:
  • HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Request class abstracts the main PHPglobal variables like:● $_GET● $_POST● $_COOKIE● $_FILES● $_SERVER
  • HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Response class abstracts some PHPfunctions like● Header()● Setcookie()● echo
  • HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Session class and SessionStorageInterfaceinterface abstract session managementsession_*() functions.
  • Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher
  • Event Dispatcher Component
  • Event Dispatcher Component● A listener (PHP object) tells a central dispatcherobject that it wants to listen to an event;
  • Event Dispatcher Component● A listener (PHP object) tells a central dispatcherobject that it wants to listen to an event;● At some point, the dispatcher object is told todispatch the event, passing with it an Eventobject;
  • Event Dispatcher Component● A listener (PHP object) tells a central dispatcherobject that it wants to listen to an event;● At some point, the dispatcher object is told todispatch the event, passing with it an Eventobject;● The dispatcher notifies (i.e. calls a method on) alllisteners of the dispatched event, allowing each ofthem to make modifications to the Event object.
  • Event Dispatcher Component
  • Event Dispatcher Component● Enable a system-wide plugin system● Drupal 8 will run hook system and EventDispatcher in parallel and power a lot of thecore-level Drupal components.● Drupal 9 – its up for discussion! “The D8 cyclewill allow us to gain some experience with eventsubscribers, and compare them with hooks.”● EventDispatcher more flexible (inheritance) &dependencies can be injected via the DIC.http://drupal.org/node/1509164
  • Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.
  • Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes
  • Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes● Gather information about the incoming request
  • Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes● Gather information about the incoming request● Match the incoming request route to the route definitions
  • Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes– YAML– XML– PHP
  • HTTP Kernel Component
  • HTTP Kernel Componentkernel.request event● Add more information to the Request,● Initialize parts of the system● Router listener● Return a Response (denied!!!)
  • HTTP Kernel Component
  • HTTP Kernel Component
  • HTTP Kernel ComponentResolve the controller based on routing info.● ControllerResolver● getController()● getArguments()
  • HTTP Kernel Component
  • HTTP Kernel Componentkernel.controller event● Initialize things for your app● Change the controller
  • HTTP Kernel Component
  • HTTP Kernel ComponentHttpKernel::handle()● Executes the controller● Passes it arguments● Controller builds response (resource)
  • HTTP Kernel Component
  • HTTP Kernel Component
  • HTTP Kernel Component
  • HTTP Kernel Componentkernel.view eventTransform a non-Response return value from acontroller into a Response.● Array to JSON● Array to HTML● Whatever you want to Whatever you want
  • HTTP Kernel Component
  • HTTP Kernel Componentkernel.response event● Modify Response before its sent● HTTP Headers● Add cookies● Change the response itself
  • HTTP Kernel Component
  • Symfony2 Components
  • Symfony2 ComponentsTWIG Template Engine
  • Symfony2 ComponentsDoctrine Annotations
  • Symfony2 ComponentsComposer