Symfony2 Components in Drupal8
Symfony2 Components in Drupal8● PHP Programmer● LAMP● Symfony2 (is my favorite)● Javascript● PHP Meetup OrganizerTwitter:@...
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 tra...
Drupal & W.S.C.C.I.Web Services and Context Core InitiativeThe Web Services and Context Core Initiative (WSCCI)aims to tra...
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 trans...
Drupal W.S.C.C.I.Web Services and Context Core InitiativeThe Web Services and Context Core Initiative (WSCCI) aimsto trans...
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 ...
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 maki...
HTTP Kernel Component
HTTP Kernel ComponentThe HttpKernel Component provides astructured process for converting a Requestinto a Response by maki...
HTTP Kernel ComponentThe HttpKernel Component provides astructured process for converting a Requestinto a Response by maki...
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 ...
HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Response class...
HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Session class ...
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;●...
Event Dispatcher Component● A listener (PHP object) tells a central dispatcherobject that it wants to listen to an event;●...
Event Dispatcher Component
Event Dispatcher Component● Enable a system-wide plugin system● Drupal 8 will run hook system and EventDispatcher in paral...
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 inf...
Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes● Gather inf...
Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes– YAML– XML–...
HTTP Kernel Component
HTTP Kernel Componentkernel.request event● Add more information to the Request,● Initialize parts of the system● Router li...
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 (resou...
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 JS...
HTTP Kernel Component
HTTP Kernel Componentkernel.response event● Modify Response before its sent● HTTP Headers● Add cookies● Change the respons...
HTTP Kernel Component
Symfony2 Components
Symfony2 ComponentsTWIG Template Engine
Symfony2 ComponentsDoctrine Annotations
Symfony2 ComponentsComposer
Drupal users group_symfony2
Upcoming SlideShare
Loading in...5
×

Drupal users group_symfony2

2,546

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,546
On Slideshare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
2
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Drupal users group_symfony2

  1. 1. Symfony2 Components in Drupal8
  2. 2. Symfony2 Components in Drupal8● PHP Programmer● LAMP● Symfony2 (is my favorite)● Javascript● PHP Meetup OrganizerTwitter:@bzitzowEmail:bzitzow@gmail.com
  3. 3. Symfony2 Components in Drupal8How & Why?!
  4. 4. Drupal & W.S.C.C.I.Web Services and Context Core Initiative
  5. 5. 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.
  6. 6. 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.
  7. 7. First Class
  8. 8. First ClassThe term generally implies a high levelof service, importance or quality.Source: Wikipedia
  9. 9. QualityCode Testing Anyone?
  10. 10. DrupalA First Class CMS?
  11. 11. DrupalA First Class CMS?
  12. 12. DrupalA First Class REST Server?
  13. 13. DrupalA First Class REST Server?
  14. 14. 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.
  15. 15. 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
  16. 16. Enter Cliche` Wisdom
  17. 17. Symfony2
  18. 18. Symfony2A reusable set of standalone, decoupled, andcohesive PHP components that solve commonweb development problems.
  19. 19. 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
  20. 20. Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher● Routing● Dependency Injection● Class Loader
  21. 21. Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher● Routing● Dependency Injection● Class Loader
  22. 22. Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher
  23. 23. HTTP Kernel ComponentThe HttpKernel Component provides astructured process for converting a Requestinto a Response by making use of the eventdispatcher.
  24. 24. HTTP Kernel Component
  25. 25. 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)
  26. 26. 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)
  27. 27. Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher
  28. 28. HTTP Foundation ComponentThe HttpFoundation Component defines anobject-oriented layer for the HTTPspecification.
  29. 29. HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:
  30. 30. 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
  31. 31. HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Response class abstracts some PHPfunctions like● Header()● Setcookie()● echo
  32. 32. HTTP Foundation ComponentIt is an Object-Oriented abstraction of somenative PHP functions and variables:The Session class and SessionStorageInterfaceinterface abstract session managementsession_*() functions.
  33. 33. Symfony2 Components● Http Kernel● Http Foundation● Event Dispatcher
  34. 34. Event Dispatcher Component
  35. 35. Event Dispatcher Component● A listener (PHP object) tells a central dispatcherobject that it wants to listen to an event;
  36. 36. 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;
  37. 37. 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.
  38. 38. Event Dispatcher Component
  39. 39. 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
  40. 40. Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.
  41. 41. Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes
  42. 42. Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes● Gather information about the incoming request
  43. 43. 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
  44. 44. Routing ComponentThe Routing Component maps an HTTP requestto a set of configuration variables.● Define routes– YAML– XML– PHP
  45. 45. HTTP Kernel Component
  46. 46. HTTP Kernel Componentkernel.request event● Add more information to the Request,● Initialize parts of the system● Router listener● Return a Response (denied!!!)
  47. 47. HTTP Kernel Component
  48. 48. HTTP Kernel Component
  49. 49. HTTP Kernel ComponentResolve the controller based on routing info.● ControllerResolver● getController()● getArguments()
  50. 50. HTTP Kernel Component
  51. 51. HTTP Kernel Componentkernel.controller event● Initialize things for your app● Change the controller
  52. 52. HTTP Kernel Component
  53. 53. HTTP Kernel ComponentHttpKernel::handle()● Executes the controller● Passes it arguments● Controller builds response (resource)
  54. 54. HTTP Kernel Component
  55. 55. HTTP Kernel Component
  56. 56. HTTP Kernel Component
  57. 57. 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
  58. 58. HTTP Kernel Component
  59. 59. HTTP Kernel Componentkernel.response event● Modify Response before its sent● HTTP Headers● Add cookies● Change the response itself
  60. 60. HTTP Kernel Component
  61. 61. Symfony2 Components
  62. 62. Symfony2 ComponentsTWIG Template Engine
  63. 63. Symfony2 ComponentsDoctrine Annotations
  64. 64. Symfony2 ComponentsComposer
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×