Learn more how to embed presentation in WordPress
Copy and paste the code below into your blog post or website
Copy URL
Embed into WordPress (learn more)
Comments
comments powered by DisqusPresentation Slides & Transcript
Presentation Slides & Transcript
Un framework PHP robuste et moderne Geoffrey Bachelet Ð Pandanova mercredi 5 septembre 12
HTTP MVC INJECTION DE DPENDANCE COMPOSANTS BUNDLES CONTRïLE QUALIT mercredi 5 septembre 12
HTTP mercredi 5 septembre 12
HTTP Quel est le cycle de vie dÕune page web ? mercredi 5 septembre 12
Requte Rponse HTTP mercredi 5 septembre 12
Requte Rponse Application HTTP mercredi 5 septembre 12
Requte Rponse Application GET HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT DELETE HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT DELETE ... HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT DELETE ... HTML HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT DELETE ... HTML XML HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT DELETE ... HTML XML JSON HTTP mercredi 5 septembre 12
Requte Rponse Application GET POST PUT DELETE ... HTML XML JSON ... HTTP mercredi 5 septembre 12
Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Codes dÕtat (200, 404, ...) Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Codes dÕtat (200, 404, ...) Redirections Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Codes dÕtat (200, 404, ...) Redirections Verbes (GET, POST, ...) Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Codes dÕtat (200, 404, ...) Redirections Verbes (GET, POST, ...) Cache (etags, validation, ...) Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Codes dÕtat (200, 404, ...) Redirections Verbes (GET, POST, ...) Cache (etags, validation, ...) Ngociation de contenu Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Codes dÕtat (200, 404, ...) Redirections Verbes (GET, POST, ...) Cache (etags, validation, ...) Ngociation de contenu ... Tirer parti du protocole HTTP HTTP mercredi 5 septembre 12
Documentation : http://symfony.com/doc/current/book/http_fundamentals.html Composant : http://symfony.com/doc/current/components/http_foundation/ introduction.html HTTP mercredi 5 septembre 12
MVC mercredi 5 septembre 12
MVC mercredi 5 septembre 12
La couche modle MVC mercredi 5 septembre 12
php /** @Entity **/ class Post { !!!! /** @Id @GeneratedValue @Column(type="integer") **/ !!!! protected $id ; !!!! /** @Column(type="string") **/ !!!! protected $title ; !!!! /** @Column(type="text") **/ !!!! protected $body ; !!!! public function getAbbrTitle () !!!! { !!!!!!!! return substr( $this -> title , 0 , 15 ); !!!! } } http://doctrine-project.org / MVC mercredi 5 septembre 12
php /** @Entity **/ class Post { !!!! /** @Id @GeneratedValue @Column(type="integer") **/ !!!! protected $id ; !!!! /** @Column(type="string") **/ !!!! protected $title ; !!!! /** @Column(type="text") **/ !!!! protected $body ; !!!! public function getAbbrTitle () !!!! { !!!!!!!! return substr( $this -> title , 0 , 15 ); !!!! } } http://doctrine-project.org / MVC Donnes mercredi 5 septembre 12
php /** @Entity **/ class Post { !!!! /** @Id @GeneratedValue @Column(type="integer") **/ !!!! protected $id ; !!!! /** @Column(type="string") **/ !!!! protected $title ; !!!! /** @Column(type="text") **/ !!!! protected $body ; !!!! public function getAbbrTitle () !!!! { !!!!!!!! return substr( $this -> title , 0 , 15 ); !!!! } } http://doctrine-project.org / MVC Mtier mercredi 5 septembre 12
!!!!!!!!
!!!!!!!!
php /** * Skeleton subclass for representing a row from the 'user' table. * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. */ class Post extends BasePost { !!!! public function getAbbrTitle () !!!! { !!!!!!!! return substr( $this -> title , 0 , 15 ); !!!! } } http://propelorm.org/ MVC mercredi 5 septembre 12
php /** * Skeleton subclass for representing a row from the 'user' table. * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. */ class Post extends BasePost { !!!! public function getAbbrTitle () !!!! { !!!!!!!! return substr( $this -> title , 0 , 15 ); !!!! } } http://propelorm.org/ MVC Mtier mercredi 5 septembre 12
La couche vue MVC mercredi 5 septembre 12
{% extends 'layout.html.twig' %} {% for post in posts %}
{{ post.title }}
!!!!{% extends 'layout.html.twig' %} {% for post in posts %}
{{ post.title }}
!!!!{% extends 'layout.html.twig' %} {% for post in posts %}
{{ post.title }}
!!!!{% extends 'layout.html.twig' %} {% for post in posts %}
{{ post.title }}
!!!!{% extends 'layout.html.twig' %} {% for post in posts %}
{{ post.title }}
!!!!Le contrleur MVC mercredi 5 septembre 12
php namespace MyBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class PostController extends Controller { !!!! public function listAction () !!!! { !!!!!!!! return $this -> render ( 'MyBundle:Post:list' , array ( !!!!!!!!!!!! 'posts' => PostQuery :: create () -> find () !!!!!!!! )); !!!! } } MVC mercredi 5 septembre 12
php namespace MyBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class PostController extends Controller { !!!! public function listAction () !!!! { !!!!!!!! return $this -> render ( 'MyBundle:Post:list' , array ( !!!!!!!!!!!! 'posts' => PostQuery :: create () -> find () !!!!!!!! )); !!!! } } MVC Template mercredi 5 septembre 12
php namespace MyBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class PostController extends Controller { !!!! public function listAction () !!!! { !!!!!!!! return $this -> render ( 'MyBundle:Post:list' , array ( !!!!!!!!!!!! 'posts' => PostQuery :: create () -> find () !!!!!!!! )); !!!! } } MVC Donnes mercredi 5 septembre 12
Logique mtier encapsule Facilement testable Facilement maintenable MVC mercredi 5 septembre 12
INJECTION DE DPENDANCE mercredi 5 septembre 12
class User { !!!! public function __construct () !!!! { !!!!!!!! $this -> storage = new SessionStorage( 'SESSION_ID' ); !!!! } !!!! public function setLanguage ( $language ) !!!! { !!!!!!!! $this -> storage -> set ( 'language' , $language ); !!!! } } $user = new User(); INJECTION DE DPENDANCE mercredi 5 septembre 12
class User { !!!! public function __construct () !!!! { !!!!!!!! $this -> storage = new SessionStorage( 'SESSION_ID' ); !!!! } !!!! public function setLanguage ( $language ) !!!! { !!!!!!!! $this -> storage -> set ( 'language' , $language ); !!!! } } $user = new User(); INJECTION DE DPENDANCE Dpendance forte mercredi 5 septembre 12
class User { !!!! private $storage ; !!!! public function __construct (StorageInterface $storage ) !!!! { !!!!!!!! $this -> storage = $storage ; !!!! } } $storage = new SessionStorage( 'SESSION_ID' ); $user = new User( $storage ); INJECTION DE DPENDANCE Injection mercredi 5 septembre 12
class User { !!!! private $storage ; !!!! public function __construct (StorageInterface $storage ) !!!! { !!!!!!!! $this -> storage = $storage ; !!!! } } $storage = new SessionStorage( 'my_session_name' ); $user = new User( $storage ); INJECTION DE DPENDANCE mercredi 5 septembre 12
class User { !!!! private $storage ; !!!! public function __construct (StorageInterface $storage ) !!!! { !!!!!!!! $this -> storage = $storage ; !!!! } } $storage = new MemcacheStorage(); $user = new User( $storage ); INJECTION DE DPENDANCE mercredi 5 septembre 12
class User { !!!! private $storage ; !!!! public function __construct (StorageInterface $storage ) !!!! { !!!!!!!! $this -> storage = $storage ; !!!! } } $storage = new MemcacheStorage($memcacheClient); $user = new User( $storage ); INJECTION DE DPENDANCE mercredi 5 septembre 12
http://www.slideshare.net/fabpot/dependency-injection-in-php-5354 Flexible Configurable Dcoupl INJECTION DE DPENDANCE mercredi 5 septembre 12
COMPOSANTS mercredi 5 septembre 12
COMPOSANTS ClassLoader Config Console DependencyInjection EventDispatcher Finder Form HttpFoundation Locale Process Routing Security Templating Validation YAML ... mercredi 5 septembre 12
CLASSLOADER mercredi 5 septembre 12
CLASSLOADER ÒAutoloadingÓ respectant le standard PSR-0 https://github.com/php-fig/fig-standards/blob/master/accepted/ PSR-0.md COMPOSANTS mercredi 5 septembre 12
CLASSLOADER php $loader = new UniversalClassLoader(); $loader -> registerNamespaces ( array ( !!!! 'Symfony' => __DIR__ . '/../vendor/symfony/src' , !!!! 'Monolog' => __DIR__ . '/../vendor/monolog/src' , )); $loader -> registerPrefixes ( array ( !!!! 'Swift_' => __DIR__ . '/vendor/swiftmailer/lib/classes' , !!!! 'Twig_' => __DIR__ . '/vendor/twig/lib' , )); $loader -> register (); COMPOSANTS mercredi 5 septembre 12
CLASSLOADER php $loader = new UniversalClassLoader(); $loader -> registerNamespaces ( array ( !!!! 'Symfony' => __DIR__ . '/../vendor/symfony/src' , !!!! 'Monolog' => __DIR__ . '/../vendor/monolog/src' , )); $loader -> registerPrefixes ( array ( !!!! 'Swift_' => __DIR__ . '/vendor/swiftmailer/lib/classes' , !!!! 'Twig_' => __DIR__ . '/vendor/twig/lib' , )); $loader -> register (); COMPOSANTS Namespaces mercredi 5 septembre 12
CLASSLOADER php $loader = new UniversalClassLoader(); $loader -> registerNamespaces ( array ( !!!! 'Symfony' => __DIR__ . '/../vendor/symfony/src' , !!!! 'Monolog' => __DIR__ . '/../vendor/monolog/src' , )); $loader -> registerPrefixes ( array ( !!!! 'Swift_' => __DIR__ . '/vendor/swiftmailer/lib/classes' , !!!! 'Twig_' => __DIR__ . '/vendor/twig/lib' , )); $loader -> register (); COMPOSANTS Prfixes mercredi 5 septembre 12
CONFIG mercredi 5 septembre 12
CONFIG Gestion avance de configuration COMPOSANTS mercredi 5 septembre 12
CONFIG Gestion avance de configuration Chargement de fichiers de configuration COMPOSANTS mercredi 5 septembre 12
CONFIG Gestion avance de configuration Chargement de fichiers de configuration Mise en cache de la configuration COMPOSANTS mercredi 5 septembre 12
CONFIG Gestion avance de configuration Chargement de fichiers de configuration Mise en cache de la configuration Dfinition du format de configuration COMPOSANTS mercredi 5 septembre 12
CONFIG Gestion avance de configuration Chargement de fichiers de configuration Mise en cache de la configuration Dfinition du format de configuration Multi-source (fichiers, base de donnes) COMPOSANTS mercredi 5 septembre 12
CONFIG Gestion avance de configuration Chargement de fichiers de configuration Mise en cache de la configuration Dfinition du format de configuration Multi-source (fichiers, base de donnes) Multi-format (YAML, XML, JSON) COMPOSANTS mercredi 5 septembre 12
CONSOLE mercredi 5 septembre 12
CONSOLE COMPOSANTS mercredi 5 septembre 12
CONSOLE COMPOSANTS mercredi 5 septembre 12
CONSOLE options COMPOSANTS mercredi 5 septembre 12
CONSOLE options argument COMPOSANTS mercredi 5 septembre 12
CONSOLE options argument valeur par dfaut COMPOSANTS mercredi 5 septembre 12
DEPENDENCYINJECTION mercredi 5 septembre 12
DEPENDENCYINJECTION parameters: !!!! mailer.transport: sendmail services: !!!! mailer: !!!!!!!! class: Mailer !!!!!!!! arguments: [ % mailer.transport% ] !!!! newsletter_manager: !!!!!!!! class: NewsletterManager !!!!!!!! calls: !!!!!!!!!!!! - [ setMailer , [ @ mailer ] ] COMPOSANTS mercredi 5 septembre 12
DEPENDENCYINJECTION parameters: !!!! mailer.transport: sendmail services: !!!! mailer: !!!!!!!! class: Mailer !!!!!!!! arguments: [ % mailer.transport% ] !!!! newsletter_manager: !!!!!!!! class: NewsletterManager !!!!!!!! calls: !!!!!!!!!!!! - [ setMailer , [ @ mailer ] ] COMPOSANTS mercredi 5 septembre 12
DEPENDENCYINJECTION parameters: !!!! mailer.transport: sendmail services: !!!! mailer: !!!!!!!! class: Mailer !!!!!!!! arguments: [ % mailer.transport% ] !!!! newsletter_manager: !!!!!!!! class: NewsletterManager !!!!!!!! calls: !!!!!!!!!!!! - [ setMailer , [ @ mailer ] ] COMPOSANTS Paramtre mercredi 5 septembre 12
DEPENDENCYINJECTION parameters: !!!! mailer.transport: sendmail services: !!!! mailer: !!!!!!!! class: Mailer !!!!!!!! arguments: [ % mailer.transport% ] !!!! newsletter_manager: !!!!!!!! class: NewsletterManager !!!!!!!! calls: !!!!!!!!!!!! - [ setMailer , [ @ mailer ] ] COMPOSANTS Service mercredi 5 septembre 12
DEPENDENCYINJECTION use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; $container = new ContainerBuilder(); $loader = new YamlFileLoader( $container , new FileLocator(__DIR__)); $loader -> load ( 'services.yml' ); $manager = $container -> get ( 'newsletter_manager' ); COMPOSANTS mercredi 5 septembre 12
DEPENDENCYINJECTION use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; $container = new ContainerBuilder(); $loader = new YamlFileLoader( $container , new FileLocator(__DIR__)); $loader -> load ( 'services.yml' ); $manager = $container -> get ( 'newsletter_manager' ); COMPOSANTS mercredi 5 septembre 12
EVENTDISPATCHER mercredi 5 septembre 12
EVENTDISPATCHER Implmentation du design pattern ÒObserverÓ COMPOSANTS mercredi 5 septembre 12
EVENTDISPATCHER use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; $dispatcher = new EventDispatcher(); $dispatcher -> addListener ( 'foo.action' , function (Event $event ) { !!!! // will be executed when the foo.action event is dispatched }); $dispatcher -> dispatch ( 'foo.action' , new Event()); COMPOSANTS mercredi 5 septembre 12
EVENTDISPATCHER use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; $dispatcher = new EventDispatcher(); $dispatcher -> addListener ( 'foo.action' , function (Event $event ) { !!!! // will be executed when the foo.action event is dispatched }); $dispatcher -> dispatch ( 'foo.action' , new Event()); COMPOSANTS mercredi 5 septembre 12
EVENTDISPATCHER use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; $dispatcher = new EventDispatcher(); $dispatcher -> addListener ( 'foo.action' , function (Event $event ) { !!!! // will be executed when the foo.action event is dispatched }); $dispatcher -> dispatch ( 'foo.action' , new Event()); COMPOSANTS Listener mercredi 5 septembre 12
EVENTDISPATCHER use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; $dispatcher = new EventDispatcher(); $dispatcher -> addListener ( 'foo.action' , function (Event $event ) { !!!! // will be executed when the foo.action event is dispatched }); $dispatcher -> dispatch ( 'foo.action' , new Event()); COMPOSANTS vnement mercredi 5 septembre 12
FINDER mercredi 5 septembre 12
FINDER use Symfony\Component\Finder\Finder; $finder = new Finder(); $finder -> files () -> in (__DIR__); foreach ( $finder as $file ) { !!!! // Print the absolute path !!!! print $file -> getRealpath () . "\n" ; !!!! // Print the relative path to the file, omitting the filename !!!! print $file -> getRelativePath () . "\n" ; !!!! // Print the relative path to the file !!!! print $file -> getRelativePathname () . "\n" ; } COMPOSANTS mercredi 5 septembre 12
FINDER use Symfony\Component\Finder\Finder; $finder = new Finder(); $finder -> files () -> in (__DIR__); foreach ( $finder as $file ) { !!!! // Print the absolute path !!!! print $file -> getRealpath () . "\n" ; !!!! // Print the relative path to the file, omitting the filename !!!! print $file -> getRelativePath () . "\n" ; !!!! // Print the relative path to the file !!!! print $file -> getRelativePathname () . "\n" ; } SplFileInfo COMPOSANTS mercredi 5 septembre 12
FINDER use Symfony\Component\Finder\Finder; $finder = new Finder(); $finder -> files () -> in (__DIR__); foreach ( $finder as $file ) { !!!! // Print the absolute path !!!! print $file -> getRealpath () . "\n" ; !!!! // Print the relative path to the file, omitting the filename !!!! print $file -> getRelativePath () . "\n" ; !!!! // Print the relative path to the file !!!! print $file -> getRelativePathname () . "\n" ; } COMPOSANTS mercredi 5 septembre 12
FINDER use Symfony\Component\Finder\Finder; $finder = new Finder(); $finder -> files () -> in (__DIR__); foreach ( $finder as $file ) { !!!! // Print the absolute path !!!! print $file -> getRealpath () . "\n" ; !!!! // Print the relative path to the file, omitting the filename !!!! print $file -> getRelativePath () . "\n" ; !!!! // Print the relative path to the file !!!! print $file -> getRelativePathname () . "\n" ; } COMPOSANTS mercredi 5 septembre 12
FINDER use Symfony\Component\Finder\Finder; $finder = new Finder(); $finder -> files () -> in (__DIR__); foreach ( $finder as $file ) { !!!! // Print the absolute path !!!! print $file -> getRealpath () . "\n" ; !!!! // Print the relative path to the file, omitting the filename !!!! print $file -> getRelativePath () . "\n" ; !!!! // Print the relative path to the file !!!! print $file -> getRelativePathname () . "\n" ; } COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers Recherche par taille COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers Recherche par taille Recherche par date COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers Recherche par taille Recherche par date Tri standard (nom, type) COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers Recherche par taille Recherche par date Tri standard (nom, type) Tri personnalis (ÒcallbackÓ) COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers Recherche par taille Recherche par date Tri standard (nom, type) Tri personnalis (ÒcallbackÓ) Compatible avec les ÒstreamsÓ PHP COMPOSANTS mercredi 5 septembre 12
FINDER Recherche dans plusieurs rpertoires Exclusion de rpertoire Recherche sur masques de fichiers Recherche par taille Recherche par date Tri standard (nom, type) Tri personnalis (ÒcallbackÓ) Compatible avec les ÒstreamsÓ PHP ... COMPOSANTS mercredi 5 septembre 12
FORM mercredi 5 septembre 12
FORM Gestion de formulaires complexes COMPOSANTS mercredi 5 septembre 12
FORM Gestion de formulaires complexes Rendu personnalisable via Twig COMPOSANTS mercredi 5 septembre 12
FORM Gestion de formulaires complexes Rendu personnalisable via Twig Validation des donnes COMPOSANTS mercredi 5 septembre 12
FORM Gestion de formulaires complexes Rendu personnalisable via Twig Validation des donnes Encore en beta (prvu pour la 2.1) COMPOSANTS mercredi 5 septembre 12
COMPOSANTS ClassLoader Config Console DependencyInjection EventDispatcher Finder Form HttpFoundation Locale Process Routing Security Templating Validation YAML ... mercredi 5 septembre 12
ÒIl y a un composant pour aÓ http://symfony.com/doc/current/components/index.html COMPOSANTS mercredi 5 septembre 12
BUNDLES mercredi 5 septembre 12
BUNDLES ÒTout est Bundle !Ó mercredi 5 septembre 12
BUNDLES mercredi 5 septembre 12
BUNDLES Bundle mercredi 5 septembre 12
BUNDLES Bundle mercredi 5 septembre 12
BUNDLES Bundle mercredi 5 septembre 12
BUNDLES Bundle mercredi 5 septembre 12
Un Bundle peut contenir : BUNDLES mercredi 5 septembre 12
Un Bundle peut contenir : Des extensions pour lÕinjection de dpendance BUNDLES mercredi 5 septembre 12
Un Bundle peut contenir : Des extensions pour lÕinjection de dpendance Des contrleurs BUNDLES mercredi 5 septembre 12
Un Bundle peut contenir : Des extensions pour lÕinjection de dpendance Des contrleurs Des gabarits Twig BUNDLES mercredi 5 septembre 12
Un Bundle peut contenir : Des extensions pour lÕinjection de dpendance Des contrleurs Des gabarits Twig La couche modle BUNDLES mercredi 5 septembre 12
Un Bundle peut contenir : Des extensions pour lÕinjection de dpendance Des contrleurs Des gabarits Twig La couche modle Tout le ncessaire pour votre application BUNDLES mercredi 5 septembre 12
Un moyen efficace de structurer du code BUNDLES mercredi 5 septembre 12
Un moyen efficace de partager du code BUNDLES mercredi 5 septembre 12
BUNDLES mercredi 5 septembre 12
BUNDLES 1611 Bundles ! mercredi 5 septembre 12
Assetic Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle Gravatar Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle Gravatar Bundle HWIOAuth Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle Gravatar Bundle HWIOAuth Bundle KnpMenu Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle Gravatar Bundle HWIOAuth Bundle KnpMenu Bundle KnpRad Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle Gravatar Bundle HWIOAuth Bundle KnpMenu Bundle KnpRad Bundle RabbitMq Bundle BUNDLES mercredi 5 septembre 12
Assetic Bundle AvalancheImagine Bundle FOSComment Bundle FOSRest Bundle FOSUser Bundle Gravatar Bundle HWIOAuth Bundle KnpMenu Bundle KnpRad Bundle RabbitMq Bundle ... BUNDLES mercredi 5 septembre 12
ÒIl y a un Bundle pour a !Ó http://knpbundles.com/ BUNDLES mercredi 5 septembre 12
CONTRïLE QUALIT mercredi 5 septembre 12
CONTRïLE QUALIT mercredi 5 septembre 12
// src/Acme/DemoBundle/Tests/Utility/CalculatorTest.php namespace Acme\DemoBundle\Tests\Utility; use Acme\DemoBundle\Utility\Calculator; class CalculatorTest extends \PHPUnit_Framework_TestCase { !!!! public function testAdd () !!!! { !!!!!!!! $calc = new Calculator(); !!!!!!!! $result = $calc -> add ( 30 , 12 ); !!!!!!!! // assert that our calculator added the numbers correctly! !!!!!!!! $this -> assertEquals ( 42 , $result ); !!!! } } CONTRïLE QUALIT mercredi 5 septembre 12
CONTRïLE QUALIT Barre verte ! mercredi 5 septembre 12
CONTRïLE QUALIT Seulement une partie des tests mercredi 5 septembre 12
http://phpunit.de / CONTRïLE QUALIT mercredi 5 septembre 12
Tests fonctionnels CONTRïLE QUALIT mercredi 5 septembre 12
// src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php namespace Acme\DemoBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DemoControllerTest extends WebTestCase { !!!! public function testIndex () !!!! { !!!!!!!! $client = static:: createClient (); !!!!!!!! $crawler = $client -> request ( 'GET' , '/demo/hello/Fabien' ); !!!!!!!! $count = $crawler -> filter ( 'html:contains("Hello Fabien")' ) -> count (); !!!!!!!! $this -> assertGreaterThan ( 0 , $count ); !!!! } } CONTRïLE QUALIT mercredi 5 septembre 12
// src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php namespace Acme\DemoBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DemoControllerTest extends WebTestCase { !!!! public function testIndex () !!!! { !!!!!!!! $client = static:: createClient (); !!!!!!!! $crawler = $client -> request ( 'GET' , '/demo/hello/Fabien' ); !!!!!!!! $count = $crawler -> filter ( 'html:contains("Hello Fabien")' ) -> count (); !!!!!!!! $this -> assertGreaterThan ( 0 , $count ); !!!! } } CONTRïLE QUALIT Navigateur mercredi 5 septembre 12
// src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php namespace Acme\DemoBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DemoControllerTest extends WebTestCase { !!!! public function testIndex () !!!! { !!!!!!!! $client = static:: createClient (); !!!!!!!! $crawler = $client -> request ( 'GET' , '/demo/hello/Fabien' ); !!!!!!!! $count = $crawler -> filter ( 'html:contains("Hello Fabien")' ) -> count (); !!!!!!!! $this -> assertGreaterThan ( 0 , $count ); !!!! } } CONTRïLE QUALIT mercredi 5 septembre 12
// src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php namespace Acme\DemoBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DemoControllerTest extends WebTestCase { !!!! public function testIndex () !!!! { !!!!!!!! $client = static:: createClient (); !!!!!!!! $crawler = $client -> request ( 'GET' , '/demo/hello/Fabien' ); !!!!!!!! $count = $crawler -> filter ( 'html:contains("Hello Fabien")' ) -> count (); !!!!!!!! $this -> assertGreaterThan ( 0 , $count ); !!!! } } CONTRïLE QUALIT Assertion mercredi 5 septembre 12
CONTRïLE QUALIT mercredi 5 septembre 12
ÒA PHP framework for testing your business expectations.Ó CONTRïLE QUALIT mercredi 5 septembre 12
Feature: buy an article In order to be happy As a consumer I want to be able to buy something Scenario: Given I am on the homepage When I search for " fridge " And I follow " Awesome Fridge " And I add the article to my cart And I follow " checkout " # steps that describe the checkout process Then I should see " Your order is complete! " And I should be happy to have a new fridge CONTRïLE QUALIT mercredi 5 septembre 12
Feature: buy an article In order to be happy As a consumer I want to be able to buy something Scenario: Given I am on the homepage When I search for " fridge " And I follow " Awesome Fridge " And I add the article to my cart And I follow " checkout " # steps that describe the checkout process Then I should see " Your order is complete! " And I should be happy to have a new fridge CONTRïLE QUALIT Step mercredi 5 septembre 12
CONTRïLE QUALIT /** * @When /^I search for "(?P
CONTRïLE QUALIT Extensible mercredi 5 septembre 12
CONTRïLE QUALIT Extensible Support de Selenium 1/2, ZombieJS, etc mercredi 5 septembre 12
CONTRïLE QUALIT Extensible Support de Selenium 1/2, ZombieJS, etc Extension Symfony 2 mercredi 5 septembre 12
http://behat.org/ CONTRïLE QUALIT mercredi 5 septembre 12
RSUM mercredi 5 septembre 12
HTTP mercredi 5 septembre 12
HTTP Design Pattern MVC mercredi 5 septembre 12
HTTP Design Pattern MVC Injection de dependance mercredi 5 septembre 12
HTTP Design Pattern MVC Injection de dependance Composants mercredi 5 septembre 12
HTTP Design Pattern MVC Injection de dependance Composants Bundles mercredi 5 septembre 12
HTTP Design Pattern MVC Injection de dependance Composants Bundles Contrle qualit mercredi 5 septembre 12
Documentation complte mercredi 5 septembre 12
Documentation complte Sur le ÒframeworkÓ mercredi 5 septembre 12
Documentation complte Sur le ÒframeworkÓ Par composant mercredi 5 septembre 12
Documentation complte Sur le ÒframeworkÓ Par composant ÒCookbooksÓ mercredi 5 septembre 12
plus de 100 contributeurs mercredi 5 septembre 12
plus de 1600 bundles mercredi 5 septembre 12
Drupal mercredi 5 septembre 12
Drupal PHPBB mercredi 5 septembre 12
Drupal PHPBB Symfony-CMF / PHPCR mercredi 5 septembre 12
Drupal PHPBB Symfony-CMF / PHPCR Midgard / MIDCOM mercredi 5 septembre 12
Drupal PHPBB Symfony-CMF / PHPCR Midgard / MIDCOM ... mercredi 5 septembre 12
Pourquoi pas vous ? mercredi 5 septembre 12
Geoffrey Bachelet https://github.com/ubermuda https://twitter.com/ubermuda http://pandanova.com / http://knplabs.ca / geoffrey.bachelet@pandanova.com mercredi 5 septembre 12
Geoffrey Bachelet https://github.com/ubermuda https://twitter.com/ubermuda http://pandanova.com / http://knplabs.ca / geoffrey.bachelet@pandanova.com mercredi 5 septembre 12