6. Drupal & W.S.C.C.I.
Web Services and Context Core Initiative
The Web Services and Context Core Initiative (WSCCI)
aims to transform Drupal from a first-class CMS to a first-class
REST server with a first-class CMS on top of it.
7. Drupal & W.S.C.C.I.
Web Services and Context Core Initiative
The Web Services and Context Core Initiative (WSCCI)
aims to transform Drupal from a first-class CMS to a
first-class REST server with a first-class CMS on top of it.
15. Drupal W.S.C.C.I.
Web Services and Context Core Initiative
The Web Services and Context Core Initiative (WSCCI) aims
to transform Drupal from a first-class CMS to a first-class
REST server with a first-class CMS on top of it.
16. Drupal W.S.C.C.I.
Web Services and Context Core Initiative
The Web Services and Context Core Initiative (WSCCI) aims
to transform Drupal from a first-class CMS to a first-class
REST server with a first-class CMS on top of it.
To do that, we must give Drupal a unified, powerful context
system that will support smarter, context- sensitive, easily
cacheable block-centric layouts and non-page responses
using a robust unified plugin mechanism.
Source: http://groups.drupal.org/wscci
19. Symfony2
A reusable set of standalone, decoupled, and
cohesive PHP components that solve common
web development problems.
20. Symfony2
A reusable set of standalone, decoupled, and
cohesive PHP components that solve common
web development problems.
“An HTTP framework; it is a Request /
Response framework. That's the big deal. The
fundamental principles of Symfony2 are
centered around the HTTP specification.”
~ Fabien Potencier
21. Symfony2 Components
● Http Kernel
● Http Foundation
● Event Dispatcher
● Routing
● Dependency Injection
● Class Loader
22. Symfony2 Components
● Http Kernel
● Http Foundation
● Event Dispatcher
● Routing
● Dependency Injection
● Class Loader
24. HTTP Kernel Component
The HttpKernel Component provides a
structured process for converting a Request
into a Response by making use of the event
dispatcher.
26. HTTP Kernel Component
The HttpKernel Component provides a
structured process for converting a Request
into a Response by making use of the event
dispatcher.
Flexible enough to create:
● a full-stack framework (Symfony)
● a micro-framework (Silex)
● an advanced CMS system (Drupal)
27. HTTP Kernel Component
The HttpKernel Component provides a
structured process for converting a Request
into a Response by making use of the event
dispatcher.
Flexible enough to create:
● a full-stack framework (Symfony)
● a micro-framework (Silex)
● an advanced CMS system (Drupal)
31. HTTP Foundation Component
It is an Object-Oriented abstraction of some
native PHP functions and variables:
The Request class abstracts the main PHP
global variables like:
● $_GET
● $_POST
● $_COOKIE
● $_FILES
● $_SERVER
32. HTTP Foundation Component
It is an Object-Oriented abstraction of some
native PHP functions and variables:
The Response class abstracts some PHP
functions like
● Header()
● Setcookie()
● echo
33. HTTP Foundation Component
It is an Object-Oriented abstraction of some
native PHP functions and variables:
The Session class and SessionStorageInterface
interface abstract session management
session_*() functions.
36. Event Dispatcher Component
● A listener (PHP object) tells a central dispatcher
object that it wants to listen to an event;
37. Event Dispatcher Component
● A listener (PHP object) tells a central dispatcher
object that it wants to listen to an event;
● At some point, the dispatcher object is told to
dispatch the event, passing with it an Event
object;
38. Event Dispatcher Component
● A listener (PHP object) tells a central dispatcher
object that it wants to listen to an event;
● At some point, the dispatcher object is told to
dispatch the event, passing with it an Event
object;
● The dispatcher notifies (i.e. calls a method on) all
listeners of the dispatched event, allowing each of
them to make modifications to the Event object.
40. Event Dispatcher Component
● Enable a system-wide plugin system
● Drupal 8 will run hook system and Event
Dispatcher in parallel and power a lot of the
core-level Drupal components.
● Drupal 9 – its up for discussion! “The D8 cycle
will allow us to gain some experience with event
subscribers, and compare them with hooks.”
● EventDispatcher more flexible (inheritance) &
dependencies can be injected via the DIC.
http://drupal.org/node/1509164
43. Routing Component
The Routing Component maps an HTTP request
to a set of configuration variables.
● Define routes
● Gather information about the incoming request
44. Routing Component
The Routing Component maps an HTTP request
to a set of configuration variables.
● Define routes
● Gather information about the incoming request
● Match the incoming request route to the route definitions
45. Routing Component
The Routing Component maps an HTTP request
to a set of configuration variables.
● Define routes
– YAML
– XML
– PHP
47. HTTP Kernel Component
kernel.request event
● Add more information to the Request,
● Initialize parts of the system
● Router listener
● Return a Response (denied!!!)
58. HTTP Kernel Component
kernel.view event
Transform a non-Response return value from a
controller into a Response.
● Array to JSON
● Array to HTML
● Whatever you want to Whatever you want