SlideShare a Scribd company logo
1 of 135
Download to read offline
Fabien Potencier
A bit of history
symfony 1.0 – January 2007
•  Started as a glue between existing Open-Source libraries:
   – Mojavi (heavily modified), Propel, Prado i18n, …
•  Borrowed concepts from other languages and frameworks:
   – Routing, CLI, functional tests, YAML, Rails helpers…
•  Added new concepts to the mix
   – Web Debug Toolbar, admin generator, configuration cascade, …
symfony 1.2 – November 2008
•  Based on decoupled but cohesive components

   –  Forms, Routing, Cache, YAML, ORMs, …

•  Controller still based on Mojavi

   –  View, Filter Chain, …
symfony 1.4 – November 2009
•  Added some polish on existing features

•  Removed the support for deprecated features

•  Current LTS release, maintained until late 2012
Symfony Components
  YAML
  Dependency Injection Container
  Event Dispatcher
  Templating
  Routing
  Console
  Output Escaper
  Request Handler
  …
What is Symfony 2?
Symfony 2 is the next version
        of the symfony framework…

except Symfony now takes a S instead of a s
Talk about
Symfony 2
     or
 symfony 1
To make it clear:
      Symfony 1
does not make any sense
symfony 2
does not make more sense
Symfony 2
Same philosophy,
   just better
MVC
hmmm,
now that I think about it…
…it’s now probably more
a Fabien’s style framework
    than anything else
Highly configurable
    Highly extensible
Same Symfony Components
Same great developer tools
      Full-featured
Ok, but why a major version then?
Symfony 2 has
    a brand new
low-level architecture
PHP 5.3
A Quick Tour
<?php

require_once __DIR__.'/../blog/BlogKernel.php';

$kernel = new BlogKernel('prod', false);
$kernel->run();
<?php                             Everything is namespaced
namespace ApplicationHelloBundleController;

use SymfonyFrameworkWebBundleController;

class HelloController extends Controller
{
  public function indexAction($name) Variables come from the routing
  {
    return $this->render('HelloBundle:Hello:index', array('name' => $name));
  }
}
                          Template name                      Variables to pass
                                                             to the template
Layout

<?php $view->extend('HelloBundle::layout') ?>

Hello <?php echo $name ?>!
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
  </head>
  <body>
    <?php $view->slots->output('_content') ?>
  </body>
</html>        Helpers are objects
hello:
  pattern: /hello/:name
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index
hello:
  pattern: /hello/:name
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index

namespace ApplicationHelloBundleController;

class HelloController extends Controller
{
  public function indexAction($name)
  {
    // ...
  }
}
hello:
  pattern: /hello/:name
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index

namespace ApplicationHelloBundleController;

class HelloController extends Controller
{
  public function indexAction($name)
  {
    // ...
  }
}
hello:
  pattern: /hello/:name
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index

namespace ApplicationHelloBundleController;

class HelloController extends Controller
{
  public function indexAction($name)
  {
    // ...
  }
}
hello:
  pattern: /hello/:name
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index

namespace ApplicationHelloBundleController;

class HelloController extends Controller
{
  public function indexAction($name)
  {
    // ...
  }
}
hello:
  pattern: /hello/:name
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index

namespace ApplicationHelloBundleController;

class HelloController extends Controller
{
  public function indexAction($name)
  {
    // ...
  }
}
hello:
  pattern: /hello/:year/:month/:slug
  defaults:
    _bundle:     HelloBundle
    _controller: Hello
    _action:     index

namespace ApplicationHelloBundleController;

class HelloController extends Controller
{
  public function indexAction($slug, $year)
  {
    // ...
  }
}
Extremely
Configurable
Dependency
 Injection
 Container
Replaces a lot of symfony 1 “things”
                     sfConfig
                  All config handlers
         sfProjectConfiguration /
         sfApplicationConfiguration
         sfContext (No Singleton anymore)
            The configuration cache system
                  … and some more
in one
   easy-to-master
       unified
and cohesive package
Thanks to the DIC,
Configuration has never been
   so easy and so flexible
Name your configuration files
     the way you want
Store them where you want
Use PHP, XML, YAML, or INI
$configuration = new BuilderConfiguration();
$configuration->addResource(new FileResource(__FILE__));

$configuration
  ->mergeExtension('web.user',
     array('default_culture' => 'fr', 'session' => array('name' => 'SYMFONY',
       'type' => 'Native', 'lifetime' => 3600)))

  ->mergeExtension('doctrine.dbal',
     array('dbname' => 'sfweb', 'username' => 'root'))

  ->mergeExtension('web.templating',
     array('escaping' => 'htmlspecialchars', 'assets_version' =>
'SomeVersionScheme'))

  ->mergeExtension('swift.mailer',
     array('transport' => 'gmail', 'username' => 'fabien.potencier',
'password' => 'xxxxxx'))                                               PHP	
  
;
web.user:
    default_culture: fr
    session: { name: SYMFONY, type: Native, lifetime: 3600 }

web.templating:
  escaping:       htmlspecialchars
  assets_version: SomeVersionScheme

doctrine.dbal: { dbname: sfweb, username: root, password: null }

swift.mailer:
  transport: gmail
  username: fabien.potencier
  password: xxxxxxxx
                                                                   YAML	
  
<web:user default_culture="fr">
  <web:session name="SYMFONY" type="Native" lifetime="3600" />
</web:user>

<web:templating
  escaping="htmlspecialchars"
  assets_version="SomeVersionScheme" />

<doctrine:dbal dbname="sfweb" username="root" password="" />

<swift:mailer
  transport="gmail"
  username="fabien.potencier"
  password="xxxxxxxx" />
                                                                 XML	
  
$configuration->mergeExtension('swift.mailer', array(
    'transport' => 'gmail',
    'username' => 'fabien.potencier',
    'password' => 'xxxxxx',
));



                                                    PHP	
  
swift.mailer:
  transport: gmail
  username: fabien.potencier
  password: xxxxxxxx

                               YAML	
  
<swift:mailer
  transport="gmail"
  username="fabien.potencier"
  password="xxxxxxxx" />

                                XML	
  
<?xml version="1.0" ?>

<container xmlns="http://www.symfony-project.org/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance »
    xmlns:doctrine="http://www.symfony-project.org/schema/dic/doctrine"
    xmlns:zend="http://www.symfony-project.org/schema/dic/zend"
    xmlns:swift="http://www.symfony-project.org/schema/dic/swiftmailer"
>




                                                                     XML	
  
<?xml version="1.0" ?>

<container xmlns="http://www.symfony-project.org/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance »
    xmlns:doctrine="http://www.symfony-project.org/schema/dic/doctrine"
    xmlns:zend="http://www.symfony-project.org/schema/dic/zend"
    xmlns:swift="http://www.symfony-project.org/schema/dic/swiftmailer"
    xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services
http://www.symfony-project.org/schema/dic/services/services-1.0.xsd
                        http://www.symfony-project.org/schema/dic/doctrine
http://www.symfony-project.org/schema/dic/doctrine/doctrine-1.0.xsd
                        http://www.symfony-project.org/schema/dic/zend http://
www.symfony-project.org/schema/dic/zend/zend-1.0.xsd
                        http://www.symfony-project.org/schema/dic/swiftmailer
http://www.symfony-project.org/schema/dic/swiftmailer/swiftmailer-1.0.xsd »>


                                                                     XML	
  
Inherit them as much as you want
Mix and match
configuration files written in any
            format
   useful when using third-party plugins
<imports>
  <import resource="parent.xml" />
  <import resource="config.yml" />
                                     Mix and match formats
  <import resource="parameters.ini" />
</imports>

<zend:logger
   priority="debug"
   path="%kernel.logs_dir%/%kernel.environment%.log"
/>

<web:debug
   exception="%kernel.debug%"
   toolbar="%kernel.debug%"
   ide="textmate"
/>
You choose the format you want

                       Pros                    Cons
 XML                   validation              verbose (not that much)
                       IDE completion & help

 YAML                  concise                 needs the YAML component
                       simple to read          no validation
                       easy to change          no IDE auto-completion
 PHP                   flexible                 no validation
                       more expressive
Store sensitive settings
 outside of your project
<doctrine:dbal
   dbname="sfweb"
   username="root"
   password="SuperSecretPasswordThatAnyoneCanSee"
/>
in a .htaccess or httpd.conf file

SetEnv SYMFONY__DOCTRINE__DBAL__PASSWORD "foobar"
                             %doctrine.dbal.password%
Semantic
Configuration
<swift:mailer
  transport="gmail"
  username="fabien.potencier"
  password="xxxxxxxx" />

                                XML	
  
<swift:mailer
   transport="smtp"
   encryption="ssl"
   auth_mode="login"
   host="smtp.gmail.com"
   username="fabien.potencier"
   password="xxxxxxxx" />
                                 XML	
  
<parameters>



        <parameter key="swiftmailer.class">Swift_Mailer</parameter>
  <parameter key="swiftmailer.transport.smtp.class">Swift_Transport_EsmtpTransport</parameter>

  <parameter key="swiftmailer.transport.smtp.host">smtp.gmail.com</parameter>
  <parameter key="swiftmailer.transport.smtp.port">25</parameter>
  <parameter key="swiftmailer.transport.smtp.encryption">ssl</parameter>
  <parameter key="swiftmailer.transport.smtp.username">fabien.potencier</parameter>
  <parameter key="swiftmailer.transport.smtp.password">xxxxxx</parameter>
  <parameter key="swiftmailer.transport.smtp.auth_mode">login</parameter>
  <parameter key="swiftmailer.init_file">swift_init.php</parameter>
</parameters>

<services>



        <service id="swiftmailer.mailer" class="%swiftmailer.class%">
          <argument type="service" id="swiftmailer.transport" />
          <file>%swiftmailer.init_file%</file>
        </service>
  <service id="swiftmailer.transport.smtp" class="%swiftmailer.transport.smtp.class%">
    <argument type="service" id="swiftmailer.transport.buffer" />
    <argument type="collection">
      <argument type="service" id="swiftmailer.transport.authhandler" />
    </argument>
    <argument type="service" id="swiftmailer.transport.eventdispatcher" />

    <call method="setHost"><argument>%swiftmailer.transport.smtp.host%</argument></call>
    <call method="setPort"><argument>%swiftmailer.transport.smtp.port%</argument></call>
    <call method="setEncryption"><argument>%swiftmailer.transport.smtp.encryption%</argument></call>
    <call method="setUsername"><argument>%swiftmailer.transport.smtp.username%</argument></call>
    <call method="setPassword"><argument>%swiftmailer.transport.smtp.password%</argument></call>
    <call method="setAuthMode"><argument>%swiftmailer.transport.smtp.auth_mode%</argument></call>
  </service>

  <service id="swiftmailer.transport.buffer" class="Swift_Transport_StreamBuffer">
    <argument type="service" id="swiftmailer.transport.replacementfactory" />
  </service>

  <service id="swiftmailer.transport.authhandler" class="Swift_Transport_Esmtp_AuthHandler">
    <argument type="collection">
      <argument type="service"><service class="Swift_Transport_Esmtp_Auth_CramMd5Authenticator" /></argument>
      <argument type="service"><service class="Swift_Transport_Esmtp_Auth_LoginAuthenticator" /></argument>
      <argument type="service"><service class="Swift_Transport_Esmtp_Auth_PlainAuthenticator" /></argument>
    </argument>


                                                                                                                         XML	
  
  </service>

  <service id="swiftmailer.transport.eventdispatcher" class="Swift_Events_SimpleEventDispatcher" />

  <service id="swiftmailer.transport.replacementfactory" class="Swift_StreamFilters_StringReplacementFilterFactory" />

  <service id="swiftmailer.transport" alias="swiftmailer.transport.smtp" />
</services>
Creating DIC extensions
   is insanely simple
Very Fast
  thanks to a Smart
 Caching mechanism
it always knows when to flush the cache
/**
  * Gets the 'swiftmailer.mailer' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return Swift_Mailer A Swift_Mailer instance.
                                                    PHPDoc for auto-completion
  */
protected function getSwiftmailer_MailerService()
{
    if (isset($this->shared['swiftmailer.mailer']))
      return $this->shared['swiftmailer.mailer'];    As fast as it could be
    $instance = new Swift_Mailer($this->getSwiftmailer_Transport_SmtpService());

    return $this->shared['swiftmailer.mailer'] = $instance;
}
The DIC can manage
ANY PHP object (POPO)
Plugins…
or Bundles
Plugins are first-class citizens
   They are called Bundles
Everything is a bundle
       Core features
     Third-party code
     Application code
app/
src/
web/
app/
  AppKernel.php
  cache/
  config/
  console
  logs/
src/
  autoload.php
  Application/
  Bundle/
  vendor/
     doctrine/
     swiftmailer/
     symfony/
     zend/
web/
  index.php
  index_dev.php
.../
  SomeBundle/
     Bundle.php
     Controller/
     Model/
     Resources/
       config/
       views/
public function registerBundleDirs()
{
  return array(
     'Application'        => __DIR__.'/../src/Application',
     'Bundle'             => __DIR__.'/../src/Bundle',
     'SymfonyFramework' => __DIR__.'/../src/vendor/
symfony/src/Symfony/Framework',
  );
}
$this->render('SomeBundle:Hello:index', $params)
hello:
  pattern: /hello/:name
  defaults: { _bundle: SomeBundle, ... }
SomeBundle can be any of


ApplicationSomeBundle
BundleSomeBundle
SymfonyFrameworkSomeBundle
Less concepts…
but more powerful ones
symfony 1 View Layer
         templates
           layouts
             slots
        components
           partials
      component slots
Symfony 2 View Layer

       templates
         slots
A layout is just another template with _content as a special slot

A partial is just a template you embed in another one

A component is just another action embedded in a template
<?php $view->output('BlogBundle:Post:list', array('posts'
=> $posts)) ?>
<?php $view->actions->output('BlogBundle:Post:list', array
('limit' => 2)) ?>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
  </head>
  <body>
    <?php $view->slots->output('_content') ?>
  </body>
</html>
Big and Small
Improvements
multiple level of layouts
partials can be decorated!
Better
 Logs
INFO: Matched route "blog_home" (parameters: array ( '_bundle' =>
'BlogBundle', '_controller' => 'Post', '_action' => 'index', '_route' =>
'blog_home',))

INFO: Using controller "BundleBlogBundleController
PostController::indexAction"

INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2,
s0_.excerpt AS excerpt3, s0_.published_at AS published_at4 FROM sf_weblog_post
s0_ ORDER BY s0_.published_at DESC LIMIT 10 (array ())
INFO: Matched route "blog_post" (parameters: array ( '_bundle' =>
'BlogBundle', '_controller' => 'Post', '_action' => 'show', '_format' =>
'html', 'id' => '3456', '_route' => 'blog_post',))

INFO: Using controller "BundleBlogBundleController
PostController::showAction »

INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2,
s0_.excerpt AS excerpt3, s0_.published_at AS published_at4 FROM sf_weblog_post
s0_ WHERE s0_.id = ? (array ( 0 => '3456',))
ERR: Post "3456" not found! (No result was found for query although at least
one row was expected.) (uncaught SymfonyComponentsRequestHandlerException
NotFoundHttpException exception)

INFO: Using controller "SymfonyFrameworkWebBundleController
ExceptionController::exceptionAction"
<zend:logger priority="debug" />
DEBUG: Notifying (until) event "core.request" to listener "(SymfonyFrameworkWebBundleListenerRequestParser, resolve)"
INFO: Matched route "blog_post" (parameters: array ( '_bundle' => 'BlogBundle', '_controller' => 'Post', '_action' => 'show',
'_format' => 'html', 'id' => '3456', '_route' => 'blog_post',))
DEBUG: Notifying (until) event "core.load_controller" to listener "(SymfonyFrameworkWebBundleListenerControllerLoader,
resolve)"
INFO: Using controller "BundleBlogBundleControllerPostController::showAction"
DEBUG: Listener "(SymfonyFrameworkWebBundleListenerControllerLoader, resolve)" processed the event "core.load_controller"
INFO: Trying to get post "3456" from database
INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2, s0_.excerpt AS excerpt3, s0_.published_at AS
published_at4 FROM sf_weblog_post s0_ WHERE s0_.id = ? (array ( 0 => '3456',))
DEBUG: Notifying (until) event "core.exception" to listener "(SymfonyFrameworkWebBundleListenerExceptionHandler, handle)"
ERR: Post "3456" not found! (No result was found for query although at least one row was expected.) (uncaught SymfonyComponents
RequestHandlerExceptionNotFoundHttpException exception)
DEBUG: Notifying (until) event "core.request" to listener "(SymfonyFrameworkWebBundleListenerRequestParser, resolve)"
DEBUG: Notifying (until) event "core.load_controller" to listener "(SymfonyFrameworkWebBundleListenerControllerLoader,
resolve)"
INFO: Using controller "SymfonyFrameworkWebBundleControllerExceptionController::exceptionAction"
DEBUG: Listener "(SymfonyFrameworkWebBundleListenerControllerLoader, resolve)" processed the event "core.load_controller"
DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleListenerResponseFilter, filter)"
DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugDataCollector
DataCollectorManager, handle)"
DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugWebDebugToolbar, handle)"
DEBUG: Listener "(SymfonyFrameworkWebBundleListenerExceptionHandler, handle)" processed the event "core.exception"
DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleListenerResponseFilter, filter)"
DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugDataCollector
DataCollectorManager, handle)"
DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugWebDebugToolbar, handle)"
Even Better
Exception Error Pages
An Event Better
Web Debug Toolbar
Everything you need is
at the bottom of the screen
Web Designer
 “friendly”
app/
  views/
     BlogBundle/
       Post/
          index.php
     AdminGeneratorBundle/
         DefaultTheme/
           list.php
           edit.php
     ...
“Mount” Routing
  Configuration
blog:
  resource: BlogBundle/Resources/config/routing.yml

forum:
  resource: ForumBundle/Resources/config/routing.yml
  prefix: /forum
Symfony 2
is a lazy framework
Smart Autoloading
require_once __DIR__.'/vendor/symfony/src/Symfony/Foundation/UniversalClassLoader.php';

use SymfonyFoundationUniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
  'Symfony'     => __DIR__.'/vendor/symfony/src',
  'Application' => __DIR__,
  'Bundle'      => __DIR__,
  'Doctrine'    => __DIR__.'/vendor/doctrine/lib',
));
$loader->registerPrefixes(array(
  'Swift_' => __DIR__.'/vendor/swiftmailer/lib/classes',
  'Zend_' => __DIR__.'/vendor/zend/library',
));
$loader->register();

// for Zend Framework & SwiftMailer
set_include_path(__DIR__.'/vendor/zend/library'.PATH_SEPARATOR.__DIR__.'/vendor/
swiftmailer/lib'.PATH_SEPARATOR.get_include_path());
lazy-loading of services
lazy-loading of listeners
lazy-loading of helpers
<?php echo $view->router->generate('blog_post', array('id'
=> $post->getId())) ?>
Symfony 2
is a “cachy” framework
blog/
  cache/
    prod/
      blogProjectContainer.php
      blogUrlGenerator.php
      blogUrlMatcher.php
      classes.php
class blogUrlMatcher extends SymfonyComponentsRoutingMatcherUrlMatcher
{
  public function __construct(array $context = array(), array $defaults = array())
  {
    $this->context = $context;
    $this->defaults = $defaults;
  }

  public function match($url)
  {
    $url = $this->normalizeUrl($url);

    if (0 === strpos($url, '/webblog') && preg_match('#^/webblog/(?
P<id>[^/.]+?)$#x', $url, $matches))
      return array_merge($this->mergeDefaults($matches, array
( '_bundle' => 'WebBundle', '_controller' => 'Redirect', '_action'
=> 'redirect', 'route' => 'blog_post',)), array('_route' =>
'old_blog_post_redirect'));
You can use Apache
for Routing matching
A Very Fast
 Dev. Env.
blog/
  cache/
    dev/
      blogProjectContainer.meta
      blogProjectContainer.php
      blogUrlGenerator.meta
      blogUrlGenerator.php
      blogUrlMatcher.meta
      blogUrlMatcher.php
      classes.meta
      classes.php
    prod/
      blogProjectContainer.php
      blogUrlGenerator.php
      blogUrlMatcher.php
      classes.php
Symfony 2
Easy to learn
   Easy to use
Extensible at will
Easy to learn
 Easy to use
Extensible at will
But Symfony 2 should be slow, right?
Fast as hell
Benchmark
on a simple application
2x faster
   than
Solar 1.0.0
2.5x faster
    than
symfony 1.4.2
3x faster
        than
Zend Framework 1.10
4x faster
   than
 Lithium
6x faster
    than
CakePHP 1.2.6
60x faster
   than
  Flow3
…and Symfony 2.0 uses
    half the memory
needed by both symfony 1 and ZF
We have barely scratched the surface
       of all the goodness of
            Symfony 2.0
Controller                   except for the nice default pages
Autoloading
Cache                        via ZF - DI extension coming soon
CLI                          commands still missing
Configuration
Database                     via Doctrine DBAL
Debug                        except Timer and extended WDT
Escaper
Event Dispatcher
Form / Validation / Widget   can use the 1.4 version as is
Admin Generator
Helpers
I18n / L10n                  can use the 1.4 version as is
Logger                       via ZF
Mailer                       except commands
Bundles                      except installing
Doctrine Plugin              just the DBAL part
Propel Plugin
Request / Response
Routing                      no REST support, no Object support
Storage / User
Test
View
Final Release Target Date
      Late 2010
If you want the bleeding edge of news, follow me


         on Twitter @fabpot
    on Github github.com/fabpot
…
http://symfony-reloaded.org/
Questions?
My slides will be available on
http://slideshare.com/fabpot
Sensio S.A.
    92-98, boulevard Victor Hugo
        92 115 Clichy Cedex
              FRANCE
       Tél. : +33 1 40 99 80 80

               Contact
           Fabien Potencier
    fabien.potencier at sensio.com


  http://www.sensiolabs.com/
http://www.symfony-project.org/
 http://fabien.potencier.org/

More Related Content

What's hot

Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 
Building a Pyramid: Symfony Testing Strategies
Building a Pyramid: Symfony Testing StrategiesBuilding a Pyramid: Symfony Testing Strategies
Building a Pyramid: Symfony Testing StrategiesCiaranMcNulty
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupKacper Gunia
 
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkPHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkG Woo
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Leonardo Proietti
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)Fabien Potencier
 
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and more
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreSymfony Guard Authentication: Fun with API Token, Social Login, JWT and more
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreRyan Weaver
 
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteSymfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteLeonardo Proietti
 
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationRich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationKirill Chebunin
 
Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Michael Peacock
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of LithiumNate Abele
 
Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Fabien Potencier
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016Kacper Gunia
 
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
 

What's hot (20)

Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Building a Pyramid: Symfony Testing Strategies
Building a Pyramid: Symfony Testing StrategiesBuilding a Pyramid: Symfony Testing Strategies
Building a Pyramid: Symfony Testing Strategies
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
 
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkPHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)
 
Zero to SOLID
Zero to SOLIDZero to SOLID
Zero to SOLID
 
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and more
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreSymfony Guard Authentication: Fun with API Token, Social Login, JWT and more
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and more
 
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteSymfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il cliente
 
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationRich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 Application
 
Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
 
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
 

Viewers also liked

Niveles de servicio y el soporte que ofrece el CENAM
Niveles de servicio y el soporte que ofrece el CENAMNiveles de servicio y el soporte que ofrece el CENAM
Niveles de servicio y el soporte que ofrece el CENAMJazmin Glez.
 
Avedas orcid outreach_meeting_20130523
Avedas orcid outreach_meeting_20130523Avedas orcid outreach_meeting_20130523
Avedas orcid outreach_meeting_20130523ORCID, Inc
 
Presentación merkint
Presentación merkintPresentación merkint
Presentación merkintE Leon
 
30 receitas com_creme_de_leite
30 receitas com_creme_de_leite30 receitas com_creme_de_leite
30 receitas com_creme_de_leiteedson soares
 
02 folleto seibag 2012
02 folleto seibag 201202 folleto seibag 2012
02 folleto seibag 2012Seinec s.a.
 
Allplan Engineering 2016
Allplan Engineering 2016Allplan Engineering 2016
Allplan Engineering 2016Allplan
 
Trabajo de que es un administrador de red
Trabajo de que es un administrador de redTrabajo de que es un administrador de red
Trabajo de que es un administrador de redCarina Manzano
 
CURRICULLUM VITAE ernest
CURRICULLUM VITAE ernestCURRICULLUM VITAE ernest
CURRICULLUM VITAE ernestMakia Elad
 
Cv Jo Devisch 2010 Event Coordinator
Cv Jo Devisch 2010 Event CoordinatorCv Jo Devisch 2010 Event Coordinator
Cv Jo Devisch 2010 Event Coordinatorjodevisch
 
S.t.a.r. interveiwing 5 7-12 email copy
S.t.a.r. interveiwing 5 7-12 email copyS.t.a.r. interveiwing 5 7-12 email copy
S.t.a.r. interveiwing 5 7-12 email copyRegina Seeley
 
Building a Drupal 8 theme with new-fangled awesomeness
Building a Drupal 8 theme with new-fangled awesomenessBuilding a Drupal 8 theme with new-fangled awesomeness
Building a Drupal 8 theme with new-fangled awesomenessHeather Brooke Drummond
 
Catalohue Montre Maserati 2014
Catalohue Montre Maserati 2014Catalohue Montre Maserati 2014
Catalohue Montre Maserati 2014bijouterie_monaco
 
En manipulación y sociopatía
En manipulación y sociopatíaEn manipulación y sociopatía
En manipulación y sociopatíaJavier Genero
 
Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...
Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...
Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...MaharashtraANiS
 
mapping wilderness in Europe
mapping wilderness in Europemapping wilderness in Europe
mapping wilderness in EuropeZoltan Kun
 
I - CIEF 2015
I - CIEF 2015I - CIEF 2015
I - CIEF 2015juliaca
 
Lesiones musculares
Lesiones muscularesLesiones musculares
Lesiones muscularesyesesv
 

Viewers also liked (20)

Niveles de servicio y el soporte que ofrece el CENAM
Niveles de servicio y el soporte que ofrece el CENAMNiveles de servicio y el soporte que ofrece el CENAM
Niveles de servicio y el soporte que ofrece el CENAM
 
Avedas orcid outreach_meeting_20130523
Avedas orcid outreach_meeting_20130523Avedas orcid outreach_meeting_20130523
Avedas orcid outreach_meeting_20130523
 
Presentación merkint
Presentación merkintPresentación merkint
Presentación merkint
 
30 receitas com_creme_de_leite
30 receitas com_creme_de_leite30 receitas com_creme_de_leite
30 receitas com_creme_de_leite
 
02 folleto seibag 2012
02 folleto seibag 201202 folleto seibag 2012
02 folleto seibag 2012
 
Carrington
CarringtonCarrington
Carrington
 
Allplan Engineering 2016
Allplan Engineering 2016Allplan Engineering 2016
Allplan Engineering 2016
 
Trabajo de que es un administrador de red
Trabajo de que es un administrador de redTrabajo de que es un administrador de red
Trabajo de que es un administrador de red
 
CURRICULLUM VITAE ernest
CURRICULLUM VITAE ernestCURRICULLUM VITAE ernest
CURRICULLUM VITAE ernest
 
Cv Jo Devisch 2010 Event Coordinator
Cv Jo Devisch 2010 Event CoordinatorCv Jo Devisch 2010 Event Coordinator
Cv Jo Devisch 2010 Event Coordinator
 
S.t.a.r. interveiwing 5 7-12 email copy
S.t.a.r. interveiwing 5 7-12 email copyS.t.a.r. interveiwing 5 7-12 email copy
S.t.a.r. interveiwing 5 7-12 email copy
 
Building a Drupal 8 theme with new-fangled awesomeness
Building a Drupal 8 theme with new-fangled awesomenessBuilding a Drupal 8 theme with new-fangled awesomeness
Building a Drupal 8 theme with new-fangled awesomeness
 
Code lyoko
Code lyokoCode lyoko
Code lyoko
 
Sistema financiero
Sistema financieroSistema financiero
Sistema financiero
 
Catalohue Montre Maserati 2014
Catalohue Montre Maserati 2014Catalohue Montre Maserati 2014
Catalohue Montre Maserati 2014
 
En manipulación y sociopatía
En manipulación y sociopatíaEn manipulación y sociopatía
En manipulación y sociopatía
 
Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...
Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...
Andhashraddha Nirmoolan Samiti Newsletter for September 2011 (VastuShastra Sp...
 
mapping wilderness in Europe
mapping wilderness in Europemapping wilderness in Europe
mapping wilderness in Europe
 
I - CIEF 2015
I - CIEF 2015I - CIEF 2015
I - CIEF 2015
 
Lesiones musculares
Lesiones muscularesLesiones musculares
Lesiones musculares
 

Similar to Symfony2 revealed

Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
Osiąganie mądrej architektury z Symfony2
Osiąganie mądrej architektury z Symfony2 Osiąganie mądrej architektury z Symfony2
Osiąganie mądrej architektury z Symfony2 3camp
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsPhpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsMichael Peacock
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvarsSam Marley-Jarrett
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiJérémy Derussé
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
The Naked Bundle - Tryout
The Naked Bundle - TryoutThe Naked Bundle - Tryout
The Naked Bundle - TryoutMatthias Noback
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricksJavier Eguiluz
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterHaehnchen
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 

Similar to Symfony2 revealed (20)

Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Osiąganie mądrej architektury z Symfony2
Osiąganie mądrej architektury z Symfony2 Osiąganie mądrej architektury z Symfony2
Osiąganie mądrej architektury z Symfony2
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsPhpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
The Naked Bundle - Tryout
The Naked Bundle - TryoutThe Naked Bundle - Tryout
The Naked Bundle - Tryout
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 

More from Fabien Potencier

Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Fabien Potencier
 
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010Dependency injection-zendcon-2010
Dependency injection-zendcon-2010Fabien Potencier
 
Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3Fabien Potencier
 
The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010Fabien Potencier
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010Fabien Potencier
 
Dependency Injection IPC 201
Dependency Injection IPC 201Dependency Injection IPC 201
Dependency Injection IPC 201Fabien Potencier
 
Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Fabien Potencier
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Fabien Potencier
 
Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010Fabien Potencier
 
Dependency Injection with PHP and PHP 5.3
Dependency Injection with PHP and PHP 5.3Dependency Injection with PHP and PHP 5.3
Dependency Injection with PHP and PHP 5.3Fabien Potencier
 
Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Fabien Potencier
 

More from Fabien Potencier (20)

Varnish
VarnishVarnish
Varnish
 
Look beyond PHP
Look beyond PHPLook beyond PHP
Look beyond PHP
 
Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4
 
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010Dependency injection-zendcon-2010
Dependency injection-zendcon-2010
 
Caching on the Edge
Caching on the EdgeCaching on the Edge
Caching on the Edge
 
Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3
 
The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
 
Dependency Injection IPC 201
Dependency Injection IPC 201Dependency Injection IPC 201
Dependency Injection IPC 201
 
Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Caching on the Edge with Symfony2
Caching on the Edge with Symfony2
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2
 
Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Symfony Components
Symfony ComponentsSymfony Components
Symfony Components
 
PHP 5.3 in practice
PHP 5.3 in practicePHP 5.3 in practice
PHP 5.3 in practice
 
Dependency Injection with PHP and PHP 5.3
Dependency Injection with PHP and PHP 5.3Dependency Injection with PHP and PHP 5.3
Dependency Injection with PHP and PHP 5.3
 
Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3
 

Recently uploaded

Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 

Recently uploaded (20)

Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 

Symfony2 revealed

  • 2. A bit of history
  • 3. symfony 1.0 – January 2007 •  Started as a glue between existing Open-Source libraries: – Mojavi (heavily modified), Propel, Prado i18n, … •  Borrowed concepts from other languages and frameworks: – Routing, CLI, functional tests, YAML, Rails helpers… •  Added new concepts to the mix – Web Debug Toolbar, admin generator, configuration cascade, …
  • 4. symfony 1.2 – November 2008 •  Based on decoupled but cohesive components –  Forms, Routing, Cache, YAML, ORMs, … •  Controller still based on Mojavi –  View, Filter Chain, …
  • 5. symfony 1.4 – November 2009 •  Added some polish on existing features •  Removed the support for deprecated features •  Current LTS release, maintained until late 2012
  • 6. Symfony Components YAML Dependency Injection Container Event Dispatcher Templating Routing Console Output Escaper Request Handler …
  • 8. Symfony 2 is the next version of the symfony framework… except Symfony now takes a S instead of a s
  • 9. Talk about Symfony 2 or symfony 1
  • 10. To make it clear: Symfony 1 does not make any sense
  • 11. symfony 2 does not make more sense
  • 13. Same philosophy, just better
  • 14. MVC
  • 15. hmmm, now that I think about it…
  • 16. …it’s now probably more a Fabien’s style framework than anything else
  • 17. Highly configurable Highly extensible Same Symfony Components Same great developer tools Full-featured
  • 18. Ok, but why a major version then?
  • 19. Symfony 2 has a brand new low-level architecture
  • 22. <?php require_once __DIR__.'/../blog/BlogKernel.php'; $kernel = new BlogKernel('prod', false); $kernel->run();
  • 23. <?php Everything is namespaced namespace ApplicationHelloBundleController; use SymfonyFrameworkWebBundleController; class HelloController extends Controller { public function indexAction($name) Variables come from the routing { return $this->render('HelloBundle:Hello:index', array('name' => $name)); } } Template name Variables to pass to the template
  • 25. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <?php $view->slots->output('_content') ?> </body> </html> Helpers are objects
  • 26. hello: pattern: /hello/:name defaults: _bundle: HelloBundle _controller: Hello _action: index
  • 27. hello: pattern: /hello/:name defaults: _bundle: HelloBundle _controller: Hello _action: index namespace ApplicationHelloBundleController; class HelloController extends Controller { public function indexAction($name) { // ... } }
  • 28. hello: pattern: /hello/:name defaults: _bundle: HelloBundle _controller: Hello _action: index namespace ApplicationHelloBundleController; class HelloController extends Controller { public function indexAction($name) { // ... } }
  • 29. hello: pattern: /hello/:name defaults: _bundle: HelloBundle _controller: Hello _action: index namespace ApplicationHelloBundleController; class HelloController extends Controller { public function indexAction($name) { // ... } }
  • 30. hello: pattern: /hello/:name defaults: _bundle: HelloBundle _controller: Hello _action: index namespace ApplicationHelloBundleController; class HelloController extends Controller { public function indexAction($name) { // ... } }
  • 31. hello: pattern: /hello/:name defaults: _bundle: HelloBundle _controller: Hello _action: index namespace ApplicationHelloBundleController; class HelloController extends Controller { public function indexAction($name) { // ... } }
  • 32. hello: pattern: /hello/:year/:month/:slug defaults: _bundle: HelloBundle _controller: Hello _action: index namespace ApplicationHelloBundleController; class HelloController extends Controller { public function indexAction($slug, $year) { // ... } }
  • 35. Replaces a lot of symfony 1 “things” sfConfig All config handlers sfProjectConfiguration / sfApplicationConfiguration sfContext (No Singleton anymore) The configuration cache system … and some more
  • 36. in one easy-to-master unified and cohesive package
  • 37. Thanks to the DIC, Configuration has never been so easy and so flexible
  • 38. Name your configuration files the way you want
  • 39. Store them where you want
  • 40. Use PHP, XML, YAML, or INI
  • 41. $configuration = new BuilderConfiguration(); $configuration->addResource(new FileResource(__FILE__)); $configuration ->mergeExtension('web.user', array('default_culture' => 'fr', 'session' => array('name' => 'SYMFONY', 'type' => 'Native', 'lifetime' => 3600))) ->mergeExtension('doctrine.dbal', array('dbname' => 'sfweb', 'username' => 'root')) ->mergeExtension('web.templating', array('escaping' => 'htmlspecialchars', 'assets_version' => 'SomeVersionScheme')) ->mergeExtension('swift.mailer', array('transport' => 'gmail', 'username' => 'fabien.potencier', 'password' => 'xxxxxx')) PHP   ;
  • 42. web.user: default_culture: fr session: { name: SYMFONY, type: Native, lifetime: 3600 } web.templating: escaping: htmlspecialchars assets_version: SomeVersionScheme doctrine.dbal: { dbname: sfweb, username: root, password: null } swift.mailer: transport: gmail username: fabien.potencier password: xxxxxxxx YAML  
  • 43. <web:user default_culture="fr"> <web:session name="SYMFONY" type="Native" lifetime="3600" /> </web:user> <web:templating escaping="htmlspecialchars" assets_version="SomeVersionScheme" /> <doctrine:dbal dbname="sfweb" username="root" password="" /> <swift:mailer transport="gmail" username="fabien.potencier" password="xxxxxxxx" /> XML  
  • 44. $configuration->mergeExtension('swift.mailer', array( 'transport' => 'gmail', 'username' => 'fabien.potencier', 'password' => 'xxxxxx', )); PHP  
  • 45. swift.mailer: transport: gmail username: fabien.potencier password: xxxxxxxx YAML  
  • 46. <swift:mailer transport="gmail" username="fabien.potencier" password="xxxxxxxx" /> XML  
  • 47. <?xml version="1.0" ?> <container xmlns="http://www.symfony-project.org/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance » xmlns:doctrine="http://www.symfony-project.org/schema/dic/doctrine" xmlns:zend="http://www.symfony-project.org/schema/dic/zend" xmlns:swift="http://www.symfony-project.org/schema/dic/swiftmailer" > XML  
  • 48. <?xml version="1.0" ?> <container xmlns="http://www.symfony-project.org/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance » xmlns:doctrine="http://www.symfony-project.org/schema/dic/doctrine" xmlns:zend="http://www.symfony-project.org/schema/dic/zend" xmlns:swift="http://www.symfony-project.org/schema/dic/swiftmailer" xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd http://www.symfony-project.org/schema/dic/doctrine http://www.symfony-project.org/schema/dic/doctrine/doctrine-1.0.xsd http://www.symfony-project.org/schema/dic/zend http:// www.symfony-project.org/schema/dic/zend/zend-1.0.xsd http://www.symfony-project.org/schema/dic/swiftmailer http://www.symfony-project.org/schema/dic/swiftmailer/swiftmailer-1.0.xsd »> XML  
  • 49.
  • 50. Inherit them as much as you want
  • 51. Mix and match configuration files written in any format useful when using third-party plugins
  • 52. <imports> <import resource="parent.xml" /> <import resource="config.yml" /> Mix and match formats <import resource="parameters.ini" /> </imports> <zend:logger priority="debug" path="%kernel.logs_dir%/%kernel.environment%.log" /> <web:debug exception="%kernel.debug%" toolbar="%kernel.debug%" ide="textmate" />
  • 53. You choose the format you want Pros Cons XML validation verbose (not that much) IDE completion & help YAML concise needs the YAML component simple to read no validation easy to change no IDE auto-completion PHP flexible no validation more expressive
  • 54. Store sensitive settings outside of your project
  • 55. <doctrine:dbal dbname="sfweb" username="root" password="SuperSecretPasswordThatAnyoneCanSee" />
  • 56. in a .htaccess or httpd.conf file SetEnv SYMFONY__DOCTRINE__DBAL__PASSWORD "foobar" %doctrine.dbal.password%
  • 58. <swift:mailer transport="gmail" username="fabien.potencier" password="xxxxxxxx" /> XML  
  • 59. <swift:mailer transport="smtp" encryption="ssl" auth_mode="login" host="smtp.gmail.com" username="fabien.potencier" password="xxxxxxxx" /> XML  
  • 60. <parameters> <parameter key="swiftmailer.class">Swift_Mailer</parameter> <parameter key="swiftmailer.transport.smtp.class">Swift_Transport_EsmtpTransport</parameter> <parameter key="swiftmailer.transport.smtp.host">smtp.gmail.com</parameter> <parameter key="swiftmailer.transport.smtp.port">25</parameter> <parameter key="swiftmailer.transport.smtp.encryption">ssl</parameter> <parameter key="swiftmailer.transport.smtp.username">fabien.potencier</parameter> <parameter key="swiftmailer.transport.smtp.password">xxxxxx</parameter> <parameter key="swiftmailer.transport.smtp.auth_mode">login</parameter> <parameter key="swiftmailer.init_file">swift_init.php</parameter> </parameters> <services> <service id="swiftmailer.mailer" class="%swiftmailer.class%"> <argument type="service" id="swiftmailer.transport" /> <file>%swiftmailer.init_file%</file> </service> <service id="swiftmailer.transport.smtp" class="%swiftmailer.transport.smtp.class%"> <argument type="service" id="swiftmailer.transport.buffer" /> <argument type="collection"> <argument type="service" id="swiftmailer.transport.authhandler" /> </argument> <argument type="service" id="swiftmailer.transport.eventdispatcher" /> <call method="setHost"><argument>%swiftmailer.transport.smtp.host%</argument></call> <call method="setPort"><argument>%swiftmailer.transport.smtp.port%</argument></call> <call method="setEncryption"><argument>%swiftmailer.transport.smtp.encryption%</argument></call> <call method="setUsername"><argument>%swiftmailer.transport.smtp.username%</argument></call> <call method="setPassword"><argument>%swiftmailer.transport.smtp.password%</argument></call> <call method="setAuthMode"><argument>%swiftmailer.transport.smtp.auth_mode%</argument></call> </service> <service id="swiftmailer.transport.buffer" class="Swift_Transport_StreamBuffer"> <argument type="service" id="swiftmailer.transport.replacementfactory" /> </service> <service id="swiftmailer.transport.authhandler" class="Swift_Transport_Esmtp_AuthHandler"> <argument type="collection"> <argument type="service"><service class="Swift_Transport_Esmtp_Auth_CramMd5Authenticator" /></argument> <argument type="service"><service class="Swift_Transport_Esmtp_Auth_LoginAuthenticator" /></argument> <argument type="service"><service class="Swift_Transport_Esmtp_Auth_PlainAuthenticator" /></argument> </argument> XML   </service> <service id="swiftmailer.transport.eventdispatcher" class="Swift_Events_SimpleEventDispatcher" /> <service id="swiftmailer.transport.replacementfactory" class="Swift_StreamFilters_StringReplacementFilterFactory" /> <service id="swiftmailer.transport" alias="swiftmailer.transport.smtp" /> </services>
  • 61. Creating DIC extensions is insanely simple
  • 62. Very Fast thanks to a Smart Caching mechanism it always knows when to flush the cache
  • 63. /** * Gets the 'swiftmailer.mailer' service. * * This service is shared. * This method always returns the same instance of the service. * * @return Swift_Mailer A Swift_Mailer instance. PHPDoc for auto-completion */ protected function getSwiftmailer_MailerService() { if (isset($this->shared['swiftmailer.mailer'])) return $this->shared['swiftmailer.mailer']; As fast as it could be $instance = new Swift_Mailer($this->getSwiftmailer_Transport_SmtpService()); return $this->shared['swiftmailer.mailer'] = $instance; }
  • 64. The DIC can manage ANY PHP object (POPO)
  • 67. Plugins are first-class citizens They are called Bundles
  • 68. Everything is a bundle Core features Third-party code Application code
  • 70. app/ AppKernel.php cache/ config/ console logs/
  • 71. src/ autoload.php Application/ Bundle/ vendor/ doctrine/ swiftmailer/ symfony/ zend/
  • 72. web/ index.php index_dev.php
  • 73. .../ SomeBundle/ Bundle.php Controller/ Model/ Resources/ config/ views/
  • 74. public function registerBundleDirs() { return array( 'Application' => __DIR__.'/../src/Application', 'Bundle' => __DIR__.'/../src/Bundle', 'SymfonyFramework' => __DIR__.'/../src/vendor/ symfony/src/Symfony/Framework', ); }
  • 76. hello: pattern: /hello/:name defaults: { _bundle: SomeBundle, ... }
  • 77. SomeBundle can be any of ApplicationSomeBundle BundleSomeBundle SymfonyFrameworkSomeBundle
  • 78. Less concepts… but more powerful ones
  • 79. symfony 1 View Layer templates layouts slots components partials component slots
  • 80. Symfony 2 View Layer templates slots
  • 81. A layout is just another template with _content as a special slot A partial is just a template you embed in another one A component is just another action embedded in a template
  • 84. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <?php $view->slots->output('_content') ?> </body> </html>
  • 86. multiple level of layouts
  • 87. partials can be decorated!
  • 89. INFO: Matched route "blog_home" (parameters: array ( '_bundle' => 'BlogBundle', '_controller' => 'Post', '_action' => 'index', '_route' => 'blog_home',)) INFO: Using controller "BundleBlogBundleController PostController::indexAction" INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2, s0_.excerpt AS excerpt3, s0_.published_at AS published_at4 FROM sf_weblog_post s0_ ORDER BY s0_.published_at DESC LIMIT 10 (array ())
  • 90. INFO: Matched route "blog_post" (parameters: array ( '_bundle' => 'BlogBundle', '_controller' => 'Post', '_action' => 'show', '_format' => 'html', 'id' => '3456', '_route' => 'blog_post',)) INFO: Using controller "BundleBlogBundleController PostController::showAction » INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2, s0_.excerpt AS excerpt3, s0_.published_at AS published_at4 FROM sf_weblog_post s0_ WHERE s0_.id = ? (array ( 0 => '3456',)) ERR: Post "3456" not found! (No result was found for query although at least one row was expected.) (uncaught SymfonyComponentsRequestHandlerException NotFoundHttpException exception) INFO: Using controller "SymfonyFrameworkWebBundleController ExceptionController::exceptionAction"
  • 92. DEBUG: Notifying (until) event "core.request" to listener "(SymfonyFrameworkWebBundleListenerRequestParser, resolve)" INFO: Matched route "blog_post" (parameters: array ( '_bundle' => 'BlogBundle', '_controller' => 'Post', '_action' => 'show', '_format' => 'html', 'id' => '3456', '_route' => 'blog_post',)) DEBUG: Notifying (until) event "core.load_controller" to listener "(SymfonyFrameworkWebBundleListenerControllerLoader, resolve)" INFO: Using controller "BundleBlogBundleControllerPostController::showAction" DEBUG: Listener "(SymfonyFrameworkWebBundleListenerControllerLoader, resolve)" processed the event "core.load_controller" INFO: Trying to get post "3456" from database INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2, s0_.excerpt AS excerpt3, s0_.published_at AS published_at4 FROM sf_weblog_post s0_ WHERE s0_.id = ? (array ( 0 => '3456',)) DEBUG: Notifying (until) event "core.exception" to listener "(SymfonyFrameworkWebBundleListenerExceptionHandler, handle)" ERR: Post "3456" not found! (No result was found for query although at least one row was expected.) (uncaught SymfonyComponents RequestHandlerExceptionNotFoundHttpException exception) DEBUG: Notifying (until) event "core.request" to listener "(SymfonyFrameworkWebBundleListenerRequestParser, resolve)" DEBUG: Notifying (until) event "core.load_controller" to listener "(SymfonyFrameworkWebBundleListenerControllerLoader, resolve)" INFO: Using controller "SymfonyFrameworkWebBundleControllerExceptionController::exceptionAction" DEBUG: Listener "(SymfonyFrameworkWebBundleListenerControllerLoader, resolve)" processed the event "core.load_controller" DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleListenerResponseFilter, filter)" DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugDataCollector DataCollectorManager, handle)" DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugWebDebugToolbar, handle)" DEBUG: Listener "(SymfonyFrameworkWebBundleListenerExceptionHandler, handle)" processed the event "core.exception" DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleListenerResponseFilter, filter)" DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugDataCollector DataCollectorManager, handle)" DEBUG: Notifying (filter) event "core.response" to listener "(SymfonyFrameworkWebBundleDebugWebDebugToolbar, handle)"
  • 94.
  • 95. An Event Better Web Debug Toolbar
  • 96. Everything you need is at the bottom of the screen
  • 98. app/ views/ BlogBundle/ Post/ index.php AdminGeneratorBundle/ DefaultTheme/ list.php edit.php ...
  • 99. “Mount” Routing Configuration
  • 100. blog: resource: BlogBundle/Resources/config/routing.yml forum: resource: ForumBundle/Resources/config/routing.yml prefix: /forum
  • 101. Symfony 2 is a lazy framework
  • 103. require_once __DIR__.'/vendor/symfony/src/Symfony/Foundation/UniversalClassLoader.php'; use SymfonyFoundationUniversalClassLoader; $loader = new UniversalClassLoader(); $loader->registerNamespaces(array( 'Symfony' => __DIR__.'/vendor/symfony/src', 'Application' => __DIR__, 'Bundle' => __DIR__, 'Doctrine' => __DIR__.'/vendor/doctrine/lib', )); $loader->registerPrefixes(array( 'Swift_' => __DIR__.'/vendor/swiftmailer/lib/classes', 'Zend_' => __DIR__.'/vendor/zend/library', )); $loader->register(); // for Zend Framework & SwiftMailer set_include_path(__DIR__.'/vendor/zend/library'.PATH_SEPARATOR.__DIR__.'/vendor/ swiftmailer/lib'.PATH_SEPARATOR.get_include_path());
  • 107. <?php echo $view->router->generate('blog_post', array('id' => $post->getId())) ?>
  • 108. Symfony 2 is a “cachy” framework
  • 109. blog/ cache/ prod/ blogProjectContainer.php blogUrlGenerator.php blogUrlMatcher.php classes.php
  • 110. class blogUrlMatcher extends SymfonyComponentsRoutingMatcherUrlMatcher { public function __construct(array $context = array(), array $defaults = array()) { $this->context = $context; $this->defaults = $defaults; } public function match($url) { $url = $this->normalizeUrl($url); if (0 === strpos($url, '/webblog') && preg_match('#^/webblog/(? P<id>[^/.]+?)$#x', $url, $matches)) return array_merge($this->mergeDefaults($matches, array ( '_bundle' => 'WebBundle', '_controller' => 'Redirect', '_action' => 'redirect', 'route' => 'blog_post',)), array('_route' => 'old_blog_post_redirect'));
  • 111. You can use Apache for Routing matching
  • 112. A Very Fast Dev. Env.
  • 113. blog/ cache/ dev/ blogProjectContainer.meta blogProjectContainer.php blogUrlGenerator.meta blogUrlGenerator.php blogUrlMatcher.meta blogUrlMatcher.php classes.meta classes.php prod/ blogProjectContainer.php blogUrlGenerator.php blogUrlMatcher.php classes.php
  • 115. Easy to learn Easy to use Extensible at will
  • 116. Easy to learn Easy to use
  • 118. But Symfony 2 should be slow, right?
  • 120. Benchmark on a simple application
  • 121. 2x faster than Solar 1.0.0
  • 122. 2.5x faster than symfony 1.4.2
  • 123. 3x faster than Zend Framework 1.10
  • 124. 4x faster than Lithium
  • 125. 6x faster than CakePHP 1.2.6
  • 126. 60x faster than Flow3
  • 127. …and Symfony 2.0 uses half the memory needed by both symfony 1 and ZF
  • 128. We have barely scratched the surface of all the goodness of Symfony 2.0
  • 129. Controller except for the nice default pages Autoloading Cache via ZF - DI extension coming soon CLI commands still missing Configuration Database via Doctrine DBAL Debug except Timer and extended WDT Escaper Event Dispatcher Form / Validation / Widget can use the 1.4 version as is Admin Generator Helpers I18n / L10n can use the 1.4 version as is Logger via ZF Mailer except commands Bundles except installing Doctrine Plugin just the DBAL part Propel Plugin Request / Response Routing no REST support, no Object support Storage / User Test View
  • 130. Final Release Target Date Late 2010
  • 131. If you want the bleeding edge of news, follow me on Twitter @fabpot on Github github.com/fabpot
  • 132.
  • 134. Questions? My slides will be available on http://slideshare.com/fabpot
  • 135. Sensio S.A. 92-98, boulevard Victor Hugo 92 115 Clichy Cedex FRANCE Tél. : +33 1 40 99 80 80 Contact Fabien Potencier fabien.potencier at sensio.com http://www.sensiolabs.com/ http://www.symfony-project.org/ http://fabien.potencier.org/