SlideShare une entreprise Scribd logo
1  sur  22
Introduction
• Dépôt GitHub
– http://github.com/JeUXdiCode

• Présentation
1.
2.
3.
4.
5.

Qu’est ce que Drupal ?
Pourquoi Symfony ?
Les composants Symfony utilisés dans Drupal 8
Ce qui change pour les développeurs
Module DarkJador (Hello World)
1. Qu’est ce que Drupal ?
•
•
•
•
•
•
•

Un CMS
Version 8
Environnement technique
Communauté
Modules
Références
Utilisations
2. Pourquoi Symfony
• Pourquoi un framework
–
–
–
–

Plus grande communauté
Meilleure prise en main par les devs
Facilité de maintenance
Bonne pratique

• Pourquoi Symfony
–
–
–
–
–

Composantes modulaires
Communauté ouverte
Injection de dépendance
Cache HTTP et ESI
Gestion des webservices REST
3. Les composants Symfony utilisés
dans Drupal 8
•
•
•
•
•
•
•

HttpKernel
Autoloader
DependencyInjection
Routing
EventDispatcher
Twig
HttpCache
3. 1. HTTP Kernel
• Request / Response paradigme
• Event Driven
• MVC
3. 1. HTTP Kernel
3. 2. Autoloader
• Norme PSR-0
– Namespace
– Nommage de classe
– Arborescence

• Composer
3. 3. Dependency Injection
•

class Mailer
{
private $transport;

}

public function __construct()
{
$this->transport = 'sendmail';
}

•
class Mailer
{
private $transport;
public function __construct($transport)
{
$this->transport = $transport;
}
•

}
3. 3. Dependency Injection
• parameters:
# ...
mailer.transport: sendmail
services:
mailer:
class: Mailer
arguments: ["%mailer.transport%"]
newsletter_manager:
class: NewsletterManager
calls:
- [setMailer, ["@mailer"]]
3. 3. Routing
•
•
•
•

Déclarer des routes
Types de Endpoint
Injection de dépendances
Contrôle d’accès
3. 4. EventDispatcher
• Implémentation du pattern Mediator
3. 4. EventDispatcher
Catch Event
$dispatcher = new EventDispatcher();
$listener = new AcmeListener();
$dispatcher->addListener('foo.action', array($listener, 'onFooAction'));
Create Event
class FilterOrderEvent extends Event
{
protected $order;
public function __construct(Order $order)
{
$this->order = $order;
}

}

public function getOrder()
{
return $this->order;
}

$dispatcher = new EventDispatcher();
$event = new FilterOrderEvent($order);
$dispatcher->dispatch(StoreEvents::STORE_ORDER, $event);
3. 5. Twig
• Différent de PHPTemplate
• Filtres Custom
• Exemple
– <span>{{ message | upper }}</span>
3. 4. HttpCache
•
•
•
•

La norme HTTP 1.1 – RFC 2616
Les headers HTTP
Reverse Proxy Cache
Et les sessions ?
3. 4. HttpCache
Header renvoyé par varnish
HTTP/1.1 200 OK
Server: varnish
Content-Type: text/html; charset=utf-8
Content-Length: 15619
Cache-Control: public, max-age=86400
Last-Modified: Wed, 04 Dec 2013 19:13:45 +0000
Expires: Sun, 11 Mar 2014 12:00:00 GMT
Vary: Cookie,Accept-Encoding
X-Varnish-Cache: HIT
3. 4. HttpCache
Header renvoyé par apache
HTTP/1.1 200 OK
Server: apache
Content-Type: text/html; charset=utf-8
Content-Length: 15619
Cache-Control: public, max-age=86400
Last-Modified: Wed, 04 Dec 2013 19:13:45 +0000
Expires: Sun, 11 Mar 2014 12:00:00 GMT
Vary: Cookie,Accept-Encoding
3. 4. HttpCache
• Varnish
– La mise en cache
– Gestion des sessions
– ESI
4. Ce qui change pour les
développeurs
•
•
•
•
•

Arborescence du CMS
Répertoires des modules autoloadés
Routing
Hooks
Composer
4. Ce qui change pour les
développeurs
• Nouvelles solutions frontend
– Backbone
– Underscorejs
– Modernizr
– Préprocesseur CSS ( LESS / SASS )
5. Module DarkJador (HelloWorld)
• Utilise les composants présentés
Conclusion

Contenu connexe

Tendances

Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016
Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016
Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016Nicolas Ledez
 
Mysql Apche PHP sous linux
Mysql Apche PHP sous linuxMysql Apche PHP sous linux
Mysql Apche PHP sous linuxKhalid ALLILI
 
Examen
Examen Examen
Examen TECOS
 
Etes vous prêts pour le succes ?
Etes vous prêts pour le succes ?Etes vous prêts pour le succes ?
Etes vous prêts pour le succes ?Steven VAN POECK
 
Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...
Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...
Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...Aurelien Navarre
 
DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8
DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8
DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8Aurelien Navarre
 
Mettre son site en ligne
Mettre son site en ligneMettre son site en ligne
Mettre son site en ligneJoachim Ramet
 
ZendFramework2 - Présentation
ZendFramework2 - PrésentationZendFramework2 - Présentation
ZendFramework2 - Présentationjulien pauli
 
05 2014-varnish
05 2014-varnish05 2014-varnish
05 2014-varnishthomaslc
 
Meetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cache
Meetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cacheMeetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cache
Meetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cacheAurelien Navarre
 
Nouveautés PHP 7 : Introduction et performances - MeetUP Openska
Nouveautés PHP 7 : Introduction et performances - MeetUP OpenskaNouveautés PHP 7 : Introduction et performances - MeetUP Openska
Nouveautés PHP 7 : Introduction et performances - MeetUP OpenskaOpenska
 
Tout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshop
Tout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshopTout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshop
Tout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshopNuxeo
 
Zabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvertZabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvertLook a box
 

Tendances (16)

Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016
Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016
Retour d'XP de saltstack chez Cozy Cloud - web2day 15 juin 2016
 
Mysql Apche PHP sous linux
Mysql Apche PHP sous linuxMysql Apche PHP sous linux
Mysql Apche PHP sous linux
 
nodejs vs vertx
nodejs vs vertxnodejs vs vertx
nodejs vs vertx
 
Examen
Examen Examen
Examen
 
Etes vous prêts pour le succes ?
Etes vous prêts pour le succes ?Etes vous prêts pour le succes ?
Etes vous prêts pour le succes ?
 
Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...
Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...
Meetup Drupal Lyon 2016 - Environnements de dév Drupal automatisés LXC et Ans...
 
DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8
DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8
DrupalCamp Nantes 2016 - Migrer un site Drupal 6 ou Drupal 7 vers Drupal 8
 
Serveur http
Serveur httpServeur http
Serveur http
 
Mettre son site en ligne
Mettre son site en ligneMettre son site en ligne
Mettre son site en ligne
 
ZendFramework2 - Présentation
ZendFramework2 - PrésentationZendFramework2 - Présentation
ZendFramework2 - Présentation
 
05 2014-varnish
05 2014-varnish05 2014-varnish
05 2014-varnish
 
Meetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cache
Meetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cacheMeetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cache
Meetup Drupal Lyon mars 2013 - Optimiser les performances Drupal par le cache
 
Python + ansible = ♥
Python + ansible = ♥Python + ansible = ♥
Python + ansible = ♥
 
Nouveautés PHP 7 : Introduction et performances - MeetUP Openska
Nouveautés PHP 7 : Introduction et performances - MeetUP OpenskaNouveautés PHP 7 : Introduction et performances - MeetUP Openska
Nouveautés PHP 7 : Introduction et performances - MeetUP Openska
 
Tout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshop
Tout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshopTout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshop
Tout comprendre de Nuxeo Drive - Nuxeo Tour 2014 - workshop
 
Zabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvertZabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvert
 

En vedette

Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For TechiesRobert Carr
 
Technologies
TechnologiesTechnologies
Technologieshelkin
 
Kế hoạch bài dạy
Kế hoạch bài dạyKế hoạch bài dạy
Kế hoạch bài dạynhok_violet
 
Script
ScriptScript
Scripthelkin
 
Upload getting pissed off
Upload getting pissed offUpload getting pissed off
Upload getting pissed offhelkin
 
Regulation of advertising in the uk
Regulation of advertising in the ukRegulation of advertising in the uk
Regulation of advertising in the ukJackalynWest2013
 
Алгоритмы автоматизированного составления и группировки семантических ядер (Н...
Алгоритмы автоматизированного составления и группировки семантических ядер (Н...Алгоритмы автоматизированного составления и группировки семантических ядер (Н...
Алгоритмы автоматизированного составления и группировки семантических ядер (Н...Nikolay Khivrin
 
Piosenki patriotyczne
Piosenki patriotycznePiosenki patriotyczne
Piosenki patriotyczneLusia100
 
Kế hoạch bài dạy
Kế hoạch bài dạyKế hoạch bài dạy
Kế hoạch bài dạynhok_violet
 
Nhóm 1 kỹ sư vật lý
Nhóm 1 kỹ sư vật lýNhóm 1 kỹ sư vật lý
Nhóm 1 kỹ sư vật lýnhok_violet
 
Qualitative research feedback and analysis
Qualitative research feedback and analysisQualitative research feedback and analysis
Qualitative research feedback and analysisChloe_ann07
 
Still image analysis 2 kesha
Still image analysis 2 keshaStill image analysis 2 kesha
Still image analysis 2 keshahelkin
 
The Top Ten ThingsMyExSaid of 2013
The Top Ten ThingsMyExSaid of 2013The Top Ten ThingsMyExSaid of 2013
The Top Ten ThingsMyExSaid of 2013thingsmyexsaid
 
Script done
Script doneScript done
Script donehelkin
 
SSR book review by: Cara LaBelle
SSR book review by: Cara LaBelleSSR book review by: Cara LaBelle
SSR book review by: Cara LaBellecarzard
 
Analysing a pop music video conventions (5sos)
Analysing a pop music video conventions (5sos)Analysing a pop music video conventions (5sos)
Analysing a pop music video conventions (5sos)helkin
 

En vedette (20)

Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For Techies
 
Technologies
TechnologiesTechnologies
Technologies
 
Kế hoạch bài dạy
Kế hoạch bài dạyKế hoạch bài dạy
Kế hoạch bài dạy
 
Sit and get
Sit and getSit and get
Sit and get
 
Thuyết trình
Thuyết trìnhThuyết trình
Thuyết trình
 
Evaluation q2
Evaluation q2Evaluation q2
Evaluation q2
 
Script
ScriptScript
Script
 
Upload getting pissed off
Upload getting pissed offUpload getting pissed off
Upload getting pissed off
 
Regulation of advertising in the uk
Regulation of advertising in the ukRegulation of advertising in the uk
Regulation of advertising in the uk
 
Алгоритмы автоматизированного составления и группировки семантических ядер (Н...
Алгоритмы автоматизированного составления и группировки семантических ядер (Н...Алгоритмы автоматизированного составления и группировки семантических ядер (Н...
Алгоритмы автоматизированного составления и группировки семантических ядер (Н...
 
Piosenki patriotyczne
Piosenki patriotycznePiosenki patriotyczne
Piosenki patriotyczne
 
Kế hoạch bài dạy
Kế hoạch bài dạyKế hoạch bài dạy
Kế hoạch bài dạy
 
Wrr ppt
Wrr pptWrr ppt
Wrr ppt
 
Nhóm 1 kỹ sư vật lý
Nhóm 1 kỹ sư vật lýNhóm 1 kỹ sư vật lý
Nhóm 1 kỹ sư vật lý
 
Qualitative research feedback and analysis
Qualitative research feedback and analysisQualitative research feedback and analysis
Qualitative research feedback and analysis
 
Still image analysis 2 kesha
Still image analysis 2 keshaStill image analysis 2 kesha
Still image analysis 2 kesha
 
The Top Ten ThingsMyExSaid of 2013
The Top Ten ThingsMyExSaid of 2013The Top Ten ThingsMyExSaid of 2013
The Top Ten ThingsMyExSaid of 2013
 
Script done
Script doneScript done
Script done
 
SSR book review by: Cara LaBelle
SSR book review by: Cara LaBelleSSR book review by: Cara LaBelle
SSR book review by: Cara LaBelle
 
Analysing a pop music video conventions (5sos)
Analysing a pop music video conventions (5sos)Analysing a pop music video conventions (5sos)
Analysing a pop music video conventions (5sos)
 

Similaire à Drupal 8, symfony

Presentation
PresentationPresentation
Presentationbois
 
Intellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server InternalsIntellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server InternalsNeil Armstrong
 
php2 : formulaire-session-PDO
php2 : formulaire-session-PDOphp2 : formulaire-session-PDO
php2 : formulaire-session-PDOAbdoulaye Dieng
 
technologie web - part3
technologie web - part3technologie web - part3
technologie web - part3Benoît Simard
 
Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !Olivier Le Goaër
 
Mieux Développer en PHP avec Symfony
Mieux Développer en PHP avec SymfonyMieux Développer en PHP avec Symfony
Mieux Développer en PHP avec SymfonyHugo Hamon
 
alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)Alphorm
 
Chef - Paris BlockCamp - Nov 09
Chef - Paris BlockCamp - Nov 09Chef - Paris BlockCamp - Nov 09
Chef - Paris BlockCamp - Nov 09Olivier Gutknecht
 
Université de la performance - Devoxx France
Université de la performance - Devoxx FranceUniversité de la performance - Devoxx France
Université de la performance - Devoxx FranceMarc Bojoly
 
I don't always write reactive application but when I do, it run on raspberry pi
I don't always write reactive application but when I do, it run on raspberry piI don't always write reactive application but when I do, it run on raspberry pi
I don't always write reactive application but when I do, it run on raspberry piadelegue
 

Similaire à Drupal 8, symfony (20)

Cours 8 squid.pdf
Cours 8 squid.pdfCours 8 squid.pdf
Cours 8 squid.pdf
 
spring.pdf
spring.pdfspring.pdf
spring.pdf
 
Presentation
PresentationPresentation
Presentation
 
Introduction à Symfony
Introduction à SymfonyIntroduction à Symfony
Introduction à Symfony
 
Intellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server InternalsIntellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server Internals
 
php2 : formulaire-session-PDO
php2 : formulaire-session-PDOphp2 : formulaire-session-PDO
php2 : formulaire-session-PDO
 
technologie web
technologie webtechnologie web
technologie web
 
Introduction à Symfony
Introduction à SymfonyIntroduction à Symfony
Introduction à Symfony
 
technologie web - part3
technologie web - part3technologie web - part3
technologie web - part3
 
Formation Google App Engine
Formation Google App EngineFormation Google App Engine
Formation Google App Engine
 
Paris RailsCamp 2009
Paris RailsCamp 2009Paris RailsCamp 2009
Paris RailsCamp 2009
 
Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !
 
Mieux Développer en PHP avec Symfony
Mieux Développer en PHP avec SymfonyMieux Développer en PHP avec Symfony
Mieux Développer en PHP avec Symfony
 
Perf university
Perf universityPerf university
Perf university
 
Introduction à Laravel
Introduction à LaravelIntroduction à Laravel
Introduction à Laravel
 
alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)
 
Chef - Paris BlockCamp - Nov 09
Chef - Paris BlockCamp - Nov 09Chef - Paris BlockCamp - Nov 09
Chef - Paris BlockCamp - Nov 09
 
Support de cours angular
Support de cours angularSupport de cours angular
Support de cours angular
 
Université de la performance - Devoxx France
Université de la performance - Devoxx FranceUniversité de la performance - Devoxx France
Université de la performance - Devoxx France
 
I don't always write reactive application but when I do, it run on raspberry pi
I don't always write reactive application but when I do, it run on raspberry piI don't always write reactive application but when I do, it run on raspberry pi
I don't always write reactive application but when I do, it run on raspberry pi
 

Drupal 8, symfony

  • 1.
  • 2. Introduction • Dépôt GitHub – http://github.com/JeUXdiCode • Présentation 1. 2. 3. 4. 5. Qu’est ce que Drupal ? Pourquoi Symfony ? Les composants Symfony utilisés dans Drupal 8 Ce qui change pour les développeurs Module DarkJador (Hello World)
  • 3. 1. Qu’est ce que Drupal ? • • • • • • • Un CMS Version 8 Environnement technique Communauté Modules Références Utilisations
  • 4. 2. Pourquoi Symfony • Pourquoi un framework – – – – Plus grande communauté Meilleure prise en main par les devs Facilité de maintenance Bonne pratique • Pourquoi Symfony – – – – – Composantes modulaires Communauté ouverte Injection de dépendance Cache HTTP et ESI Gestion des webservices REST
  • 5. 3. Les composants Symfony utilisés dans Drupal 8 • • • • • • • HttpKernel Autoloader DependencyInjection Routing EventDispatcher Twig HttpCache
  • 6. 3. 1. HTTP Kernel • Request / Response paradigme • Event Driven • MVC
  • 7. 3. 1. HTTP Kernel
  • 8. 3. 2. Autoloader • Norme PSR-0 – Namespace – Nommage de classe – Arborescence • Composer
  • 9. 3. 3. Dependency Injection • class Mailer { private $transport; } public function __construct() { $this->transport = 'sendmail'; } • class Mailer { private $transport; public function __construct($transport) { $this->transport = $transport; } • }
  • 10. 3. 3. Dependency Injection • parameters: # ... mailer.transport: sendmail services: mailer: class: Mailer arguments: ["%mailer.transport%"] newsletter_manager: class: NewsletterManager calls: - [setMailer, ["@mailer"]]
  • 11. 3. 3. Routing • • • • Déclarer des routes Types de Endpoint Injection de dépendances Contrôle d’accès
  • 12. 3. 4. EventDispatcher • Implémentation du pattern Mediator
  • 13. 3. 4. EventDispatcher Catch Event $dispatcher = new EventDispatcher(); $listener = new AcmeListener(); $dispatcher->addListener('foo.action', array($listener, 'onFooAction')); Create Event class FilterOrderEvent extends Event { protected $order; public function __construct(Order $order) { $this->order = $order; } } public function getOrder() { return $this->order; } $dispatcher = new EventDispatcher(); $event = new FilterOrderEvent($order); $dispatcher->dispatch(StoreEvents::STORE_ORDER, $event);
  • 14. 3. 5. Twig • Différent de PHPTemplate • Filtres Custom • Exemple – <span>{{ message | upper }}</span>
  • 15. 3. 4. HttpCache • • • • La norme HTTP 1.1 – RFC 2616 Les headers HTTP Reverse Proxy Cache Et les sessions ?
  • 16. 3. 4. HttpCache Header renvoyé par varnish HTTP/1.1 200 OK Server: varnish Content-Type: text/html; charset=utf-8 Content-Length: 15619 Cache-Control: public, max-age=86400 Last-Modified: Wed, 04 Dec 2013 19:13:45 +0000 Expires: Sun, 11 Mar 2014 12:00:00 GMT Vary: Cookie,Accept-Encoding X-Varnish-Cache: HIT
  • 17. 3. 4. HttpCache Header renvoyé par apache HTTP/1.1 200 OK Server: apache Content-Type: text/html; charset=utf-8 Content-Length: 15619 Cache-Control: public, max-age=86400 Last-Modified: Wed, 04 Dec 2013 19:13:45 +0000 Expires: Sun, 11 Mar 2014 12:00:00 GMT Vary: Cookie,Accept-Encoding
  • 18. 3. 4. HttpCache • Varnish – La mise en cache – Gestion des sessions – ESI
  • 19. 4. Ce qui change pour les développeurs • • • • • Arborescence du CMS Répertoires des modules autoloadés Routing Hooks Composer
  • 20. 4. Ce qui change pour les développeurs • Nouvelles solutions frontend – Backbone – Underscorejs – Modernizr – Préprocesseur CSS ( LESS / SASS )
  • 21. 5. Module DarkJador (HelloWorld) • Utilise les composants présentés