SlideShare una empresa de Scribd logo
1 de 22
Symfony2
Symfony2, c’est quoi?
Symfony2, c’est quoi?

Ensemble de composants :
Symfony2, c’est quoi?

Ensemble de composants :



 • autonomes
Symfony2, c’est quoi?

Ensemble de composants :



 • autonomes
 • découplés
Symfony2, c’est quoi?

Ensemble de composants :



 • autonomes
 • découplés
 • cohésifs
Symfony2, c’est quoi?

Ensemble de composants :



 • autonomes
 • découplés
 • cohésifs
MVC ?
MVC ?


• Comment fonctionne le WEB ?
MVC ?


• Comment fonctionne le WEB ?
• Le WEB c’est pas du MVC !
MVC ?


• Comment fonctionne le WEB ?
• Le WEB c’est pas du MVC !
• C’est quoi alors ?
Framework HTTP
• RFC 2616
• HttpBis
• Request / Response !
• Patterns OO établis
• Architecture solide
• Awesome community
Pourquoi changer
       Drupal?
“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
Stop NIH / RTW



• Not Invented Here
• Reinventing The Wheel
ClassLoader



• Le composant ClassLoader charge vos
  classes automatiquement si elles
  suivent une certaine convention
HttpFoundation

• Le composant HTTPFoundation
  fournit une couche remplie de
  fonctionnalités et complètement
  orientée objet pour les messages HTTP
• Il remplace les variables globales
  natives à PHP afin d’écrire un code
  meilleur, plus sûr et facilement
  testable.
HttpFoundation

• Le composant HTTPFoundation
  fournit une couche remplie de
  fonctionnalités et complètement
  orientée objet pour les messages HTTP
• Il remplace les variables globales                       Response
  natives à PHP afin d’écrire un code                      HTTP/1.1 200 OK
                                                          Date: Wed, 15 Oct 2005 07:07:07 GMT
                                                          Content-Length: 14


  meilleur, plus sûr et facilement
                                                          Content-Type: text/html

                                                          Hello World!




  testable.             use SymfonyComponentHttpFoundationResponse;

                        $response = new Response('Not Found', 404,
                            array('Content-Type' => 'text/plain'));
                        $response = new Response();
                        $response->setContent('Hello World');
Routing



• Le composant Routing découple
  l’apparence des url du code qui les
  traite.
Routing



• Le composant Routing découple
  l’apparence des url du code qui les
  traite.
                           use SymfonyComponentRoutingRequestContext;
                           use SymfonyComponentRoutingMatcherUrlMatcher;

                           $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',
                           );
EventDispatcher



• Le composant EventDispatcher est
  une version allégée du pattern
  «Observer» .
HttpKernel

             Sub-Request
                                                                                  expection

                                      “sub-response” content
                                                                                        exception


                          resolve                          resolve      Call
Request   request                         controller                 Controller         response      Response
                         controller                      arguments




                                                                       view
                                                                                                      terminate



             response?



                                                                                          Drupal 8 meets Symfony
• Le HttpKernel par défaut fait en sorte
  que Drupal soit intéropérable avec
  n’importe quelle autre application
  utilisant cette même interface
• Le DrupalHttpKernel étend le
  HttpKernel par défaut

Más contenido relacionado

La actualidad más candente

2013 01-08-php-maturite
2013 01-08-php-maturite2013 01-08-php-maturite
2013 01-08-php-maturite
Rémi Alvado
 
REST JUG Toulouse 20100615
REST JUG Toulouse 20100615REST JUG Toulouse 20100615
REST JUG Toulouse 20100615
JUG Toulouse
 

La actualidad más candente (20)

Symfony 2 : chapitre 4 - Les services et les formulaires
Symfony 2 : chapitre 4 - Les services et les formulairesSymfony 2 : chapitre 4 - Les services et les formulaires
Symfony 2 : chapitre 4 - Les services et les formulaires
 
Php 5.3
Php 5.3Php 5.3
Php 5.3
 
2013 01-08-php-maturite
2013 01-08-php-maturite2013 01-08-php-maturite
2013 01-08-php-maturite
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
les servlets-java EE
les  servlets-java EEles  servlets-java EE
les servlets-java EE
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 Performant
 
Introduction à Symfony
Introduction à SymfonyIntroduction à Symfony
Introduction à Symfony
 
Introduction à Angular JS
Introduction à Angular JSIntroduction à Angular JS
Introduction à Angular JS
 
Initiation à Express js
Initiation à Express jsInitiation à Express js
Initiation à Express js
 
Fondamentaux d’une API REST
Fondamentaux d’une API RESTFondamentaux d’une API REST
Fondamentaux d’une API REST
 
Aspnetcore introduction
Aspnetcore introductionAspnetcore introduction
Aspnetcore introduction
 
REST JUG Toulouse 20100615
REST JUG Toulouse 20100615REST JUG Toulouse 20100615
REST JUG Toulouse 20100615
 
Cours php
Cours php Cours php
Cours php
 
Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
 
Programmation concurrente en Java
Programmation concurrente en JavaProgrammation concurrente en Java
Programmation concurrente en Java
 
Presentation Tomcat Load Balancer
Presentation Tomcat Load BalancerPresentation Tomcat Load Balancer
Presentation Tomcat Load Balancer
 
Ns python-flask
Ns python-flaskNs python-flask
Ns python-flask
 
Introduction à Symfony
Introduction à SymfonyIntroduction à Symfony
Introduction à Symfony
 
Introduction à Symfony2
Introduction à Symfony2Introduction à Symfony2
Introduction à Symfony2
 
PHP 7 et Symfony 3
PHP 7 et Symfony 3PHP 7 et Symfony 3
PHP 7 et Symfony 3
 

Similar a Présentation symfony drupal

Drupal 8, symfony
Drupal 8, symfonyDrupal 8, symfony
Drupal 8, symfony
jeUXdiCode
 
ENIB cours CAI Web - Séance 3 - JSP/Servlet - Cours
ENIB cours CAI Web - Séance 3 - JSP/Servlet - CoursENIB cours CAI Web - Séance 3 - JSP/Servlet - Cours
ENIB cours CAI Web - Séance 3 - JSP/Servlet - Cours
Horacio Gonzalez
 
Soutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonySoutenance Zend Framework vs Symfony
Soutenance Zend Framework vs Symfony
Vincent Composieux
 
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - Cours
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - CoursENIB cours CAI Web - Séance 4 - Frameworks/Spring - Cours
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - Cours
Horacio Gonzalez
 
Présentation de RMI Java
Présentation de RMI JavaPrésentation de RMI Java
Présentation de RMI Java
Zakaria Bouazza
 
Play Framework
Play FrameworkPlay Framework
Play Framework
Armaklan
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJS
Abdoulaye Dieng
 
BordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets JavaBordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets Java
Camblor Frédéric
 

Similar a Présentation symfony drupal (20)

SOLID : les principes à l’origine du succès de Symfony et de vos applications
SOLID : les principes à l’origine du succès de Symfony et de vos applicationsSOLID : les principes à l’origine du succès de Symfony et de vos applications
SOLID : les principes à l’origine du succès de Symfony et de vos applications
 
Chef - Paris BlockCamp - Nov 09
Chef - Paris BlockCamp - Nov 09Chef - Paris BlockCamp - Nov 09
Chef - Paris BlockCamp - Nov 09
 
Drupal 8, symfony
Drupal 8, symfonyDrupal 8, symfony
Drupal 8, symfony
 
DevOps illustré : la jungle de la configuration d'une application
DevOps illustré : la jungle de la configuration d'une applicationDevOps illustré : la jungle de la configuration d'une application
DevOps illustré : la jungle de la configuration d'une application
 
Formation Google App Engine
Formation Google App EngineFormation Google App Engine
Formation Google App Engine
 
Industrialiser le contrat dans un projet PHP
Industrialiser le contrat dans un projet PHPIndustrialiser le contrat dans un projet PHP
Industrialiser le contrat dans un projet PHP
 
Introduction à Hibernate p.1
Introduction à Hibernate p.1Introduction à Hibernate p.1
Introduction à Hibernate p.1
 
Formation PHP avancé - Cake PHP
Formation PHP avancé - Cake PHPFormation PHP avancé - Cake PHP
Formation PHP avancé - Cake PHP
 
Un exemple élémentaire d'application MVC en PHP
Un exemple élémentaire d'application MVC en PHPUn exemple élémentaire d'application MVC en PHP
Un exemple élémentaire d'application MVC en PHP
 
Rails 3 au Djangocong
Rails 3 au DjangocongRails 3 au Djangocong
Rails 3 au Djangocong
 
ENIB cours CAI Web - Séance 3 - JSP/Servlet - Cours
ENIB cours CAI Web - Séance 3 - JSP/Servlet - CoursENIB cours CAI Web - Séance 3 - JSP/Servlet - Cours
ENIB cours CAI Web - Séance 3 - JSP/Servlet - Cours
 
Soutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonySoutenance Zend Framework vs Symfony
Soutenance Zend Framework vs Symfony
 
Atelier symfony n 2
Atelier symfony n 2Atelier symfony n 2
Atelier symfony n 2
 
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - Cours
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - CoursENIB cours CAI Web - Séance 4 - Frameworks/Spring - Cours
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - Cours
 
Présentation de RMI Java
Présentation de RMI JavaPrésentation de RMI Java
Présentation de RMI Java
 
Demystification de Spring Une histoire de Pattern.pptx
Demystification de Spring Une histoire de Pattern.pptxDemystification de Spring Une histoire de Pattern.pptx
Demystification de Spring Une histoire de Pattern.pptx
 
Play Framework
Play FrameworkPlay Framework
Play Framework
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJS
 
Apéro PHP Amiens - l'ORM de CakePHP, c'est du gâteau !
Apéro PHP Amiens - l'ORM de CakePHP, c'est du gâteau !Apéro PHP Amiens - l'ORM de CakePHP, c'est du gâteau !
Apéro PHP Amiens - l'ORM de CakePHP, c'est du gâteau !
 
BordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets JavaBordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets Java
 

Más de Christophe Willemsen

Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16
Christophe Willemsen
 

Más de Christophe Willemsen (12)

Knowledge graphs + Chatbots with Neo4j
Knowledge graphs + Chatbots with Neo4jKnowledge graphs + Chatbots with Neo4j
Knowledge graphs + Chatbots with Neo4j
 
Chatbots and Voice Conversational Interfaces with Amazon Alexa, Neo4j and Gra...
Chatbots and Voice Conversational Interfaces with Amazon Alexa, Neo4j and Gra...Chatbots and Voice Conversational Interfaces with Amazon Alexa, Neo4j and Gra...
Chatbots and Voice Conversational Interfaces with Amazon Alexa, Neo4j and Gra...
 
Management des issues Github avec Neo4j et NLP
Management des issues Github avec Neo4j et NLPManagement des issues Github avec Neo4j et NLP
Management des issues Github avec Neo4j et NLP
 
Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16
 
Recommendation Engines with Neo4j, Symfony and Reco4PHP
Recommendation Engines with Neo4j, Symfony and Reco4PHPRecommendation Engines with Neo4j, Symfony and Reco4PHP
Recommendation Engines with Neo4j, Symfony and Reco4PHP
 
Moteurs de recommendation avec Neo4j et GraphAwareReco
Moteurs de recommendation avec Neo4j et GraphAwareRecoMoteurs de recommendation avec Neo4j et GraphAwareReco
Moteurs de recommendation avec Neo4j et GraphAwareReco
 
Recommandations avec Neo4j et le GraphAware Recommendation Engine
Recommandations avec Neo4j et le GraphAware Recommendation EngineRecommandations avec Neo4j et le GraphAware Recommendation Engine
Recommandations avec Neo4j et le GraphAware Recommendation Engine
 
Neo4j au secours de l'Internet of Connected Things
Neo4j au secours de l'Internet of Connected ThingsNeo4j au secours de l'Internet of Connected Things
Neo4j au secours de l'Internet of Connected Things
 
Graph Database Prototyping made easy with Graphgen
Graph Database Prototyping made easy with GraphgenGraph Database Prototyping made easy with Graphgen
Graph Database Prototyping made easy with Graphgen
 
Graphgen - le générateur de graphes
Graphgen - le générateur de graphesGraphgen - le générateur de graphes
Graphgen - le générateur de graphes
 
Analysing Github events with Neo4j
Analysing Github events with Neo4jAnalysing Github events with Neo4j
Analysing Github events with Neo4j
 
GMDSS - Practice1
GMDSS - Practice1GMDSS - Practice1
GMDSS - Practice1
 

Présentation symfony drupal

  • 4. Symfony2, c’est quoi? Ensemble de composants : • autonomes
  • 5. Symfony2, c’est quoi? Ensemble de composants : • autonomes • découplés
  • 6. Symfony2, c’est quoi? Ensemble de composants : • autonomes • découplés • cohésifs
  • 7. Symfony2, c’est quoi? Ensemble de composants : • autonomes • découplés • cohésifs
  • 9. MVC ? • Comment fonctionne le WEB ?
  • 10. MVC ? • Comment fonctionne le WEB ? • Le WEB c’est pas du MVC !
  • 11. MVC ? • Comment fonctionne le WEB ? • Le WEB c’est pas du MVC ! • C’est quoi alors ?
  • 12. Framework HTTP • RFC 2616 • HttpBis • Request / Response ! • Patterns OO établis • Architecture solide • Awesome community
  • 13. Pourquoi changer Drupal? “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
  • 14. Stop NIH / RTW • Not Invented Here • Reinventing The Wheel
  • 15. ClassLoader • Le composant ClassLoader charge vos classes automatiquement si elles suivent une certaine convention
  • 16. HttpFoundation • Le composant HTTPFoundation fournit une couche remplie de fonctionnalités et complètement orientée objet pour les messages HTTP • Il remplace les variables globales natives à PHP afin d’écrire un code meilleur, plus sûr et facilement testable.
  • 17. HttpFoundation • Le composant HTTPFoundation fournit une couche remplie de fonctionnalités et complètement orientée objet pour les messages HTTP • Il remplace les variables globales Response natives à PHP afin d’écrire un code HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Content-Length: 14 meilleur, plus sûr et facilement Content-Type: text/html Hello World! testable. use SymfonyComponentHttpFoundationResponse; $response = new Response('Not Found', 404, array('Content-Type' => 'text/plain')); $response = new Response(); $response->setContent('Hello World');
  • 18. Routing • Le composant Routing découple l’apparence des url du code qui les traite.
  • 19. Routing • Le composant Routing découple l’apparence des url du code qui les traite. use SymfonyComponentRoutingRequestContext; use SymfonyComponentRoutingMatcherUrlMatcher; $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', );
  • 20. EventDispatcher • Le composant EventDispatcher est une version allégée du pattern «Observer» .
  • 21. HttpKernel Sub-Request expection “sub-response” content exception resolve resolve Call Request request controller Controller response Response controller arguments view terminate response? Drupal 8 meets Symfony
  • 22. • Le HttpKernel par défaut fait en sorte que Drupal soit intéropérable avec n’importe quelle autre application utilisant cette même interface • Le DrupalHttpKernel étend le HttpKernel par défaut

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n