Slide 1

Slide 1 text

The path to symfony in the USA

Slide 2

Slide 2 text

This talk will examine how symfony and the community around symfony has evolved since 2006. From the release of the initial symfony code to symfony 2.0, and all of the community milestones along the way. The focus of this talk is on how application development has evolved and how symfony and the community have kept pace over the years.

Slide 3

Slide 3 text

Dustin Whittle dustinwhittle.com

Slide 4

Slide 4 text

How I got started

Slide 5

Slide 5 text

Consulting dustinwhittle.com

Slide 6

Slide 6 text

Yahoo yahoo.com

Slide 7

Slide 7 text

delicious.com

Slide 8

Slide 8 text

answers.yahoo.com

Slide 9

Slide 9 text

pulse.yahoo.com

Slide 10

Slide 10 text

developer.yahoo.com

Slide 11

Slide 11 text

sensiolabs.com

Slide 12

Slide 12 text

Sensio Labs launches in USA Joining Sensio Labs in a partnership to launch services in USA Opening an office in San Francisco Project Consulting Best Practices Consulting / Audits Security Audits Training from open source experts symfony 1, Symfony 2, Doctrine 1, Doctrine 2, PHPUnit

Slide 13

Slide 13 text

guru.sensiolabs.com

Slide 14

Slide 14 text

trainings.sensiolabs.com

Slide 15

Slide 15 text

symfony-project.org

Slide 16

Slide 16 text

Symfony in the beginning Released open source by Sensio Labs in October 2005 Built from years of real world experience in developing web applications Built to improve developer productivity by solving common web problems

Slide 17

Slide 17 text

Symfony 0.x Developed the core philosophy Don’t reinvent the wheel Keep it simple stupid Don’t repeat yourself Invest in unit + functional testing Invest in quality documentation Favor convention over configuration

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Defined the core problem set / features Model - View - Controller Configuration - YAML + Multiple Environments ORM Integration - CRUD / Admin Generators Routing, Forms, Security, I18n, Caching Developer tools - logging, exceptions, debug toolbar Symfony 0.x

Slide 20

Slide 20 text

The start of an open source community Launch of symfony-project.com Initial tutorials / documentation Support channels on IRC, Forum, Mailing lists Established a core team with distinct leadership from Fabien A way to contribute back on Trac - feedback, bugs, patches Symfony 0.x

Slide 21

Slide 21 text

symfony-project.com

Slide 22

Slide 22 text

symfony 1.0

Slide 23

Slide 23 text

symfony-project.org/book/1_0

Slide 24

Slide 24 text

askeet.com

Slide 25

Slide 25 text

symfony 1.0 was good enough for Yahoo! to adopt

Slide 26

Slide 26 text

bookmarks.yahoo.com

Slide 27

Slide 27 text

delicious.com

Slide 28

Slide 28 text

answers.yahoo.com

Slide 29

Slide 29 text

current.com

Slide 30

Slide 30 text

symfony 1.x

Slide 31

Slide 31 text

The path to symfony 1.2 The original symfony 2! Introduction of the event dispatcher Introduction of new sub frameworks Forms / Caching / Tasks Swiftmailer Refactored major components Configuration, Routing, I18n, Admin Generator, Plugins Added support for Doctrine ORM

Slide 32

Slide 32 text

The path to symfony 1.2 The community starts to mature Core team has dedicated release / community managers The community gives back to symfony Plugins + Patches + Documentation + Translations Case studies + Evangelism Community events Our first official meetup at SymfonyCamp

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

jobeet.org

Slide 35

Slide 35 text

symfonians.org

Slide 36

Slide 36 text

symfony-check.org

Slide 37

Slide 37 text

symfony 1.4

Slide 38

Slide 38 text

The path to symfony 1.4 A stable + tested version of symfony Removed deprecated code (kept in 1.3 instead) Long Term Support A healthy community supports itself Active mailing lists where users support each other Documentation - Translated into six languages Events - SymfonyLive + SymfonyDay

Slide 39

Slide 39 text

symfony 1.4 Documentation symfony-project.org/doc

Slide 40

Slide 40 text

SymfonyLive symfony-live.com

Slide 41

Slide 41 text

symfonyday.com

Slide 42

Slide 42 text

bit.ly/sf-symfony-meetup

Slide 43

Slide 43 text

symfony 1.x is used on many web applications from large companies to small startups

Slide 44

Slide 44 text

pulse.yahoo.com

Slide 45

Slide 45 text

ted.com

Slide 46

Slide 46 text

plancast.com

Slide 47

Slide 47 text

dogster.com

Slide 48

Slide 48 text

demo.apostrophenow.com

Slide 49

Slide 49 text

symfony-reloaded.org

Slide 50

Slide 50 text

symfony-reloaded.org

Slide 51

Slide 51 text

Symfony 2.x Learning from experience Developed from scratch for performance and flexibility PHP 5.3 - Support for namespaces and lambdas Better Development Model A collection of independent components A framework for frameworks / full-stack framework Better Community Github enables collaboration + contributions

Slide 52

Slide 52 text

Symfony 2.x Evolved the philosophy Dependency Injection Container + Event Dispatcher Design by interface for a stable API Less Magic = Favor explicit over implicit Don’t reinvent the wheel Doctrine 2 (DBAL / ORM / ODM) Zend Framework 2 (Logger) PHPUnit 3.5.x

Slide 53

Slide 53 text

Symfony 2.x More flexibility Configuration: YAML, XML, PHP Templating: Twig or PHP ORM: Doctrine or Propel More features HTTP Cache ACL Security Asset Management

Slide 54

Slide 54 text

Symfony 2.x NoSQL via Doctrine 2 MongoDB CouchDB Better testing via PHPUnit Jenkins / phpUnderControl Integration Selenium Support Code Coverage Reporting

Slide 55

Slide 55 text

Symfony 2.x GitHub vs SVN Better core team management Weekly IRC Meetings Hackdays / Sprints / Meetups

Slide 56

Slide 56 text

github.com/symfony/symfony

Slide 57

Slide 57 text

docs.symfony-reloaded.org

Slide 58

Slide 58 text

symfony2bundles.org

Slide 59

Slide 59 text

Symfony 2 is so good it is already used in production

Slide 60

Slide 60 text

dailymotion.com

Slide 61

Slide 61 text

lexpress.fr

Slide 62

Slide 62 text

shopopensky.com

Slide 63

Slide 63 text

exercise.com

Slide 64

Slide 64 text

weka-entertainment.com

Slide 65

Slide 65 text

control.servergrove.com

Slide 66

Slide 66 text

From symfony 1 to Symfony 2

Slide 67

Slide 67 text

It has never been easier to get started with symfony

Slide 68

Slide 68 text

aws.amazon.com/free

Slide 69

Slide 69 text

zerigo.com

Slide 70

Slide 70 text

cloudflare.com

Slide 71

Slide 71 text

The symfony 1.x sandbox wget symfony-project.org/get/sf_sandbox_1_4.tgz tar -xzf sf_sandbox_1_4.tgz

Slide 72

Slide 72 text

./symfony

Slide 73

Slide 73 text

Available tasks: :help Displays help for a task :list Lists tasks app :routes Displays current routes for an application cache :clear Clears the cache (cc) configure :author Configure project author :database Configure database DSN doctrine :build Generate code based on your schema :build-db Creates database for current model (doctrine:create-db) :build-filters Creates filter form classes for the current model :build-forms Creates form classes for the current model :build-model Creates classes for the current model :build-schema Creates a schema from an existing database :build-sql Creates SQL for the current model :clean-model-files Delete all generated model classes for models which no longer exist in your YAML :create-model-tables Drop and recreate tables for specified models. :data-dump Dumps data to the fixtures directory :data-load Loads YAML fixture data :delete-model-files Delete all the related auto generated files for a given model name. :dql Execute a DQL query and view the results :drop-db Drops database for current model :generate-admin Generates a Doctrine admin module :generate-migration Generate migration class :generate-migrations-db Generate migration classes from existing database connections :generate-migrations-diff Generate migration classes by producing a diff between your old and new schema. :generate-migrations-models Generate migration classes from an existing set of models :generate-module Generates a Doctrine module :generate-module-for-route Generates a Doctrine module for a route definition :insert-sql Inserts SQL for current model :migrate Migrates database to current/specified version generate :app Generates a new application :module Generates a new module :project Generates a new project :task Creates a skeleton class for a new task

Slide 74

Slide 74 text

# You can find more information about this file on the symfony website: # http://www.symfony-project.org/reference/1_4/en/04-Settings prod: .settings: no_script_name: true logging_enabled: false dev: .settings: error_reporting: web_debug: true cache: false no_script_name: false etag: false test: .settings: error_reporting: cache: false web_debug: false no_script_name: false etag: false all: .settings: # Form security secret (CSRF protection) csrf_secret: 1b1783c5ae00e1d90926fb970d5df01c40c8ab98 # Output escaping settings escaping_strategy: true escaping_method: ESC_SPECIALCHARS # Enable the database manager use_database: true Sandbox/apps/frontend/config/settings.yml

Slide 75

Slide 75 text

./symfony generate:module frontend hello

Slide 76

Slide 76 text

localhost/sandbox/frontend_dev.php/hello/sf

Slide 77

Slide 77 text

# You can find more information about this file on the symfony website: # http://www.symfony-project.org/reference/1_4/en/10-Routing # hello module rules hello: url: /hello/:name param: { module: hello, action: index } # default rules homepage: url: / param: { module: default, action: index } sandbox/apps/frontend/config/routing.yml

Slide 78

Slide 78 text

name = $request->getParameter('name', 'World'); } } sandbox/apps/frontend/modules/hello/actions/actions.class.php

Slide 79

Slide 79 text

Hello Application

Hello ! sandbox/apps/frontend/modules/hello/templates/indexSuccess.php

Slide 80

Slide 80 text

sandbox/apps/frontend/templates/layout.php

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

get('/hello/sf')-> with('request')->begin()-> isParameter('module', 'hello')-> isParameter('action', 'index')-> end()-> with('response')->begin()-> isStatusCode(200)-> checkElement('body', '/Hello sf!/')-> end() ; sandbox/test/functional/frontend/helloActionsTest.php

Slide 83

Slide 83 text

./symfony test:all

Slide 84

Slide 84 text

The symfony 2.x sandbox wget symfony-reloaded.org/downloads/sandbox_2_0_PR6.tgz tar -xzf sandbox_2_0_PR6.tgz

Slide 85

Slide 85 text

localhost/sandbox/check.php

Slide 86

Slide 86 text

localhost/sandbox/app_dev.php/

Slide 87

Slide 87 text

./app/console

Slide 88

Slide 88 text

Available commands: help Displays help for a command (?) list Lists commands assets :install cache :warmup Warms up an empty cache doctrine :ensure-production-settings Verify that Doctrine is properly configured for a production environment. doctrine:cache :clear-metadata Clear all metadata cache for a entity manager. :clear-query Clear all query cache for a entity manager. :clear-result Clear result cache for a entity manager. doctrine:data :load Load data fixtures to your database. doctrine:database :create Create the configured databases. :drop Drop the configured databases. doctrine:generate :entities Generate entity classes and method stubs from your mapping information. :entity Generate a new Doctrine entity inside a bundle. :proxies Generates proxy classes for entity classes. :repositories Generate repository classes from your mapping information. doctrine:mapping :convert Convert mapping information between supported formats. :import Import mapping information from an existing database. :info Show basic information about all mapped entities. doctrine:query :dql Executes arbitrary DQL directly from the command line. :sql Executes arbitrary SQL directly from the command line. doctrine:schema :create Processes the schema and either create it directly on EntityManager Storage Connection :drop Drop the complete database schema of EntityManager Storage Connection :update Processes the schema and either update the database schema of EntityManager Storage init :bundle router :debug Displays current routes for an application :dump-apache Dumps all routes as Apache rewrite rules

Slide 89

Slide 89 text

app.config: charset: UTF-8 error_handler: null csrf_protection: enabled: true secret: xxxxxxxxxx router: { resource: "%kernel.root_dir%/config/routing.yml" } validation: { enabled: true, annotations: true } templating: { engines: ['twig'], assets_version: 1.0 } session: default_locale: en lifetime: 3600 auto_start: true twig.config: debug: %kernel.debug% strict_variables: %kernel.debug% doctrine.dbal: dbname: xxxxxxxx user: xxxxxxxx password: ~ logging: %kernel.debug% doctrine.orm: auto_generate_proxy_classes: %kernel.debug% mappings: HelloBundle: ~ swiftmailer.config: transport: gmail username: xxxxxxxx password: xxxxxxxx sandbox/app/config/config.yml

Slide 90

Slide 90 text

localhost/sandbox/app_dev.php/hello/sf

Slide 91

Slide 91 text

hello: pattern: /hello/{name} defaults: { _controller: HelloBundle:Hello:index } sandbox/src/Sensio/HelloBundle/Resources/config/routing.yml homepage: pattern: / defaults: { _controller: FrameworkBundle:Default:index } hello: resource: @HelloBundle/Resources/config/routing.yml sandbox/app/config/routing.yml

Slide 92

Slide 92 text

render(‘HelloBundle:Hello:index.html.twig', array('name' => $name)); } } sandbox/src/Sensio/HelloBundle/Controller/HelloController.php

Slide 93

Slide 93 text

{% block title %}Hello Application{% endblock %}</ title> </head> <body> {% block body %}{% endblock %} </body> </html> sandbox/app/views/base.html.twig

Slide 94

Slide 94 text

{% extends "HelloBundle::layout.html.twig" %} {% block content %} Hello {{ name }}! {% endblock %} sandbox/src/Sensio/HelloBundle/Resources/views/Hello/index.html.twig {% extends "::base.html.twig" %} {% block body %}

Hello Application

{% block content %}{% endblock %} {% endblock %} sandbox/src/Sensio/HelloBundle/Resources/views/layout.html.twig

Slide 95

Slide 95 text

localhost/sandbox/app_dev.php/_profiler/{token}

Slide 96

Slide 96 text

createClient(); $crawler = $client->request('GET', '/hello/Fabien'); $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); } } sandbox/src/Sensio/HelloBundle/Tests/Controller/HelloController.php

Slide 97

Slide 97 text

phpunit -c app/phpunit.xml.dist

Slide 98

Slide 98 text

A community of symfony specialists

Slide 99

Slide 99 text

punkave.com

Slide 100

Slide 100 text

knplabs.com

Slide 101

Slide 101 text

liip.ch

Slide 102

Slide 102 text

clever-age.fr

Slide 103

Slide 103 text

interlutions.de

Slide 104

Slide 104 text

ideato.it

Slide 105

Slide 105 text

osscube.com

Slide 106

Slide 106 text

solutionset.com

Slide 107

Slide 107 text

servergrove.com

Slide 108

Slide 108 text

pagodabox.com/private-beta

Slide 109

Slide 109 text

symfonyexperts.com

Slide 110

Slide 110 text

SymfonyLive symfony-live.com

Slide 111

Slide 111 text

Having a large community of specialists means more contributors and better services. The community moves the project faster.

Slide 112

Slide 112 text

Want to contribute? Join the community! http://github.com/symfony Contribute: code, documentation, tests, translations, bundles

Slide 113

Slide 113 text

Everyone is Hiring!

Slide 114

Slide 114 text

Questions?

Slide 115

Slide 115 text

Enjoy Symfony Live 2011

Slide 116

Slide 116 text

See you in Paris!