SlideShare a Scribd company logo
Starting with
About Me
●   Kevin Bond
    ●   Kitchener, Ontario
    ●   PHP Developer
         –   Symfony2 core/docs contributor



        kevinbond@gmail.com
        zenstruck.com
                                              @zenstruck
What is Symfony2?




                    @zenstruck
What is Symfony2?
●   Set of stand-alone, decoupled components




                                           @zenstruck
What is Symfony2?
●   Set of stand-alone, decoupled components
●   Full-stack framework based on these
    components




                                           @zenstruck
What is Symfony2?
●   Set of stand-alone, decoupled components
●   Full-stack framework based on these
    components
●   Community
    ●   Forum/Mailing List/IRC (#symfony on Freenode)
    ●   3rd party bundles (knpbundles.com)
    ●   5000+ watchers / 1300+ forks
    ●   560+ unique contributors
                                                  @zenstruck
Symfony2 Components
            DependencyInjection
              EventDispatcher
              HttpFoundation
               DomCrawler
               ClassLoader
                CssSelector
                HttpKernel
                BrowserKit
                Templating
                Translation
                 Serializer
                 Validator
                 Security
                 Routing
                 Console
                 Process
                  Config
                  Finder
                  Locale
                   Yaml
                   Form

                                  @zenstruck
Projects using Symfony2
●   Assetic (Process)
●   Doctrine2 (Console)
●   PHPUnit (Yaml)
●   Behat
●   Silex
●   Drupal 8
●   Propel
                          @zenstruck
Why use Symfony2?
●   Fast
●   PHP 5.3
●   Well engineered (no singletons)
●   Forces* best practices
●   Extensible and flexible
●   Stable and established
●   Testable
                                      @zenstruck
What Symfony2 is not




                       @zenstruck
What Symfony2 is not




           MVC Framework




                           @zenstruck
What Symfony2 is not




           MVC Framework




                           @zenstruck
HTTP Framework



       Request   Response




                            @zenstruck
HTTP Framework



            Request                   Response

    I don't like MVC because that's not how the web works. Symfony2
    is 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




                                                                      @zenstruck
Bundles
●   Everything is a bundle (even the framework is a collection of core
    bundles)
●   Bundles contain:
    ●   Configuration/Translations/Documentation
    ●   Routes/Controllers/Views
    ●   Public resources (js/css/images)
    ●   Services/Events/Models/Forms etc (* don't make your bundle a library)
    ●   Tests
    ●   NOT VENDOR LIBS
●   Override with child bundle
●   690+ bundles on knpbundles.com
                                                                        @zenstruck
Useful Bundles
●   FOSUserBundle
●   FOSFacebookBundle
●   KnpMenuBundle
●   SonataAdminBundle
●   FOSJsRoutingBundle
●   OAuthBundle
●   JMSI18nRoutingBundle
                           @zenstruck
Anatomy of a Request




                       @zenstruck
Anatomy of a Request
●   Request




                       @zenstruck
Anatomy of a Request
●   Request
●   Kernel




                       @zenstruck
Anatomy of a Request
●   Request
●   Kernel
    ●   Controller




                       @zenstruck
Anatomy of a Request
●   Request
●   Kernel
    ●   Controller
●   Response (html, json, xml, etc...)




                                         @zenstruck
Anatomy of a Request
●   Request
●   Kernel
    ●   Controller
    ●   Exception?
●   Response (html, json, xml, etc...)



                                         @zenstruck
Service Container
Get Started



curl -s http://getcomposer.org/installer | php


composer.phar create-project symfony/framework-standard-edition path/to/install




                                                                      @zenstruck
Demo
“Killer” Feature




                   @zenstruck
“Killer” Feature



         Symfony2 Reverse Proxy




                                  @zenstruck
3 Types of HTTP Cache
●   From the docs:
    ●   Browser caches: Every browser comes with its own local cache that
        is mainly useful for when you hit "back" or for images and other
        assets. The browser cache is a private cache as cached resources
        aren't shared with anyone else.
    ●   Proxy caches: A proxy is a shared cache as many people can be
        behind a single one. It's usually installed by large corporations and
        ISPs to reduce latency and network traffic.
    ●   Gateway caches: Like a proxy, it's also a shared cache but on the
        server side. Installed by network administrators, it makes websites
        more scalable, reliable and performant.


                                                                       @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)




                                         @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Reverse Proxy
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)



                                         @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Reverse Proxy
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)
    ●   Set s-maxage header


                                         @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Reverse Proxy
    ●   Cached version?
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)
    ●   Set s-maxage header
                                         @zenstruck
Caching Dynamic Content




                          @zenstruck
Caching Dynamic Content
●   Sub-requests




                          @zenstruck
Caching Dynamic Content
●   Sub-requests
    ●   ESI – Edge Side Includes
        –   Server side sub-requests




                                       @zenstruck
Caching Dynamic Content
●   Sub-requests
    ●   ESI – Edge Side Includes
        –   Server side sub-requests
    ●   CSI – Client Side Includes (new in 2.1)
        –   Uses javascript (hinclude.js)
        –   Client side sub-requests




                                                  @zenstruck
Resources
●   github.com/kbond/gpug-symfony2
●   symfony.com (docs/cookbook)
●   fabien.potencier.org
●   knpbundles.com
●   richardmiller.co.uk
●   knpuniversity.com
●   connect.sensiolabs.com
●   live.symfony.com
●   mnot.github.com/hinclude
                                     @zenstruck

More Related Content

PPTX
T4T Training day - NodeJS
PDF
The Future of library dependency management of Ruby
PDF
OSS Security the hard way
PDF
What's new in RubyGems3
PDF
An introduction and future of Ruby coverage library
PDF
Deep drive into rust programming language
PDF
Automate Yo'self -- SeaGL
PDF
The art of concurrent programming
T4T Training day - NodeJS
The Future of library dependency management of Ruby
OSS Security the hard way
What's new in RubyGems3
An introduction and future of Ruby coverage library
Deep drive into rust programming language
Automate Yo'self -- SeaGL
The art of concurrent programming

What's hot (20)

PPT
Rust Programming Language
PDF
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
PDF
Concurrent Ruby Application Servers
PDF
Ruby projects of interest for DevOps
PPTX
Programming The Arduino Due in Rust
KEY
Building MapAttack
PPTX
How *NOT* to firmware
PPTX
My month with Ruby
PDF
Git+jenkins+rex presentation
PDF
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
PDF
vert.x - life beyond jetty and apache
PDF
Node.js and Ruby
PPTX
Rust 101 (2017 edition)
PDF
Dive into sentry
PPTX
I believe in rust
PDF
vert.x 3.1 - be reactive on the JVM but not only in Java
PDF
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
PDF
The Rust Programming Language
KEY
Ruby On Rails Ecosystem
PDF
From 'Legacy' to 'Edge'
Rust Programming Language
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Concurrent Ruby Application Servers
Ruby projects of interest for DevOps
Programming The Arduino Due in Rust
Building MapAttack
How *NOT* to firmware
My month with Ruby
Git+jenkins+rex presentation
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
vert.x - life beyond jetty and apache
Node.js and Ruby
Rust 101 (2017 edition)
Dive into sentry
I believe in rust
vert.x 3.1 - be reactive on the JVM but not only in Java
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
The Rust Programming Language
Ruby On Rails Ecosystem
From 'Legacy' to 'Edge'
Ad

Similar to Starting with Symfony2 (20)

ODP
Malware analysis
PPTX
Dependency injection
PDF
[KubeCon EU 2020] containerd Deep Dive
PDF
Modularity problems
PDF
Welcome to the Symfony2 World - FOSDEM 2013
PDF
CloudNativeTurkey - Lines of Defence.pdf
PDF
NetflixOSS meetup lightning talks and roadmap
PPTX
Metasploit For Beginners
PDF
Frameworks choice
ODP
Learning Symfony2 by practice
PDF
AFW: Dynamic Firewalls with Chef and Netfilter
ODP
Repositories as Code
KEY
The use of Symfony2 @ Overblog
KEY
Building A Sensor Network Controller
PDF
ContextualContinuous Profilng
PDF
CFEngine 3
PDF
A3Sec Advanced Deployment System
PDF
(phpconftw2012) PHP as a Middleware in Embedded Systems
PDF
Let's Containerize New York with Docker!
PDF
Cobbler, Func and Puppet: Tools for Large Scale Environments
Malware analysis
Dependency injection
[KubeCon EU 2020] containerd Deep Dive
Modularity problems
Welcome to the Symfony2 World - FOSDEM 2013
CloudNativeTurkey - Lines of Defence.pdf
NetflixOSS meetup lightning talks and roadmap
Metasploit For Beginners
Frameworks choice
Learning Symfony2 by practice
AFW: Dynamic Firewalls with Chef and Netfilter
Repositories as Code
The use of Symfony2 @ Overblog
Building A Sensor Network Controller
ContextualContinuous Profilng
CFEngine 3
A3Sec Advanced Deployment System
(phpconftw2012) PHP as a Middleware in Embedded Systems
Let's Containerize New York with Docker!
Cobbler, Func and Puppet: Tools for Large Scale Environments
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Machine learning based COVID-19 study performance prediction
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Advanced methodologies resolving dimensionality complications for autism neur...

Starting with Symfony2

  • 2. About Me ● Kevin Bond ● Kitchener, Ontario ● PHP Developer – Symfony2 core/docs contributor kevinbond@gmail.com zenstruck.com @zenstruck
  • 3. What is Symfony2? @zenstruck
  • 4. What is Symfony2? ● Set of stand-alone, decoupled components @zenstruck
  • 5. What is Symfony2? ● Set of stand-alone, decoupled components ● Full-stack framework based on these components @zenstruck
  • 6. What is Symfony2? ● Set of stand-alone, decoupled components ● Full-stack framework based on these components ● Community ● Forum/Mailing List/IRC (#symfony on Freenode) ● 3rd party bundles (knpbundles.com) ● 5000+ watchers / 1300+ forks ● 560+ unique contributors @zenstruck
  • 7. Symfony2 Components DependencyInjection EventDispatcher HttpFoundation DomCrawler ClassLoader CssSelector HttpKernel BrowserKit Templating Translation Serializer Validator Security Routing Console Process Config Finder Locale Yaml Form @zenstruck
  • 8. Projects using Symfony2 ● Assetic (Process) ● Doctrine2 (Console) ● PHPUnit (Yaml) ● Behat ● Silex ● Drupal 8 ● Propel @zenstruck
  • 9. Why use Symfony2? ● Fast ● PHP 5.3 ● Well engineered (no singletons) ● Forces* best practices ● Extensible and flexible ● Stable and established ● Testable @zenstruck
  • 10. What Symfony2 is not @zenstruck
  • 11. What Symfony2 is not MVC Framework @zenstruck
  • 12. What Symfony2 is not MVC Framework @zenstruck
  • 13. HTTP Framework Request Response @zenstruck
  • 14. HTTP Framework Request Response I don't like MVC because that's not how the web works. Symfony2 is 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 @zenstruck
  • 15. Bundles ● Everything is a bundle (even the framework is a collection of core bundles) ● Bundles contain: ● Configuration/Translations/Documentation ● Routes/Controllers/Views ● Public resources (js/css/images) ● Services/Events/Models/Forms etc (* don't make your bundle a library) ● Tests ● NOT VENDOR LIBS ● Override with child bundle ● 690+ bundles on knpbundles.com @zenstruck
  • 16. Useful Bundles ● FOSUserBundle ● FOSFacebookBundle ● KnpMenuBundle ● SonataAdminBundle ● FOSJsRoutingBundle ● OAuthBundle ● JMSI18nRoutingBundle @zenstruck
  • 17. Anatomy of a Request @zenstruck
  • 18. Anatomy of a Request ● Request @zenstruck
  • 19. Anatomy of a Request ● Request ● Kernel @zenstruck
  • 20. Anatomy of a Request ● Request ● Kernel ● Controller @zenstruck
  • 21. Anatomy of a Request ● Request ● Kernel ● Controller ● Response (html, json, xml, etc...) @zenstruck
  • 22. Anatomy of a Request ● Request ● Kernel ● Controller ● Exception? ● Response (html, json, xml, etc...) @zenstruck
  • 24. Get Started curl -s http://getcomposer.org/installer | php composer.phar create-project symfony/framework-standard-edition path/to/install @zenstruck
  • 25. Demo
  • 26. “Killer” Feature @zenstruck
  • 27. “Killer” Feature Symfony2 Reverse Proxy @zenstruck
  • 28. 3 Types of HTTP Cache ● From the docs: ● Browser caches: Every browser comes with its own local cache that is mainly useful for when you hit "back" or for images and other assets. The browser cache is a private cache as cached resources aren't shared with anyone else. ● Proxy caches: A proxy is a shared cache as many people can be behind a single one. It's usually installed by large corporations and ISPs to reduce latency and network traffic. ● Gateway caches: Like a proxy, it's also a shared cache but on the server side. Installed by network administrators, it makes websites more scalable, reliable and performant. @zenstruck
  • 29. Symfony2 Reverse Proxy ● Request ● Kernel ● Controller ● Response (html, json, xml, etc...) @zenstruck
  • 30. Symfony2 Reverse Proxy ● Request ● Reverse Proxy ● Kernel ● Controller ● Response (html, json, xml, etc...) @zenstruck
  • 31. Symfony2 Reverse Proxy ● Request ● Reverse Proxy ● Kernel ● Controller ● Response (html, json, xml, etc...) ● Set s-maxage header @zenstruck
  • 32. Symfony2 Reverse Proxy ● Request ● Reverse Proxy ● Cached version? ● Kernel ● Controller ● Response (html, json, xml, etc...) ● Set s-maxage header @zenstruck
  • 34. Caching Dynamic Content ● Sub-requests @zenstruck
  • 35. Caching Dynamic Content ● Sub-requests ● ESI – Edge Side Includes – Server side sub-requests @zenstruck
  • 36. Caching Dynamic Content ● Sub-requests ● ESI – Edge Side Includes – Server side sub-requests ● CSI – Client Side Includes (new in 2.1) – Uses javascript (hinclude.js) – Client side sub-requests @zenstruck
  • 37. Resources ● github.com/kbond/gpug-symfony2 ● symfony.com (docs/cookbook) ● fabien.potencier.org ● knpbundles.com ● richardmiller.co.uk ● knpuniversity.com ● connect.sensiolabs.com ● live.symfony.com ● mnot.github.com/hinclude @zenstruck